Dynamic PL/SQL query, how to ignore null parameters?
问题 I have a PL/SQL procedure with multiple parameters. When a webapp calls the procedure, if it's not using a certain parameter, it passes is as null, ie procedure test (param1 in varchar2, param2 in varchar2, param3 in varchar2, cursor out sys_refcursor) ... end procedure test; I want to make an SQL query where I include the given parameters in the WHERE clause only if the parameter is not null. Is there a way to achieve this in an elegant way, other than building the SQL query in a string and