I'm writing a procedure in a package. This procedure takes 3 in parameters:
appno number
userno number
action varchar2
I need to select rows from a table based on these 3 parameters however if the parameter is passed in null I don't want it in my where clause.
I thought of doing something like this:
select * from table1 where
if appno is not null then app_no = appno end if
if userno is not null... and so on
Can someone help me figure out what the best solution for my problem is? Thanks!
appno number
userno number
action varchar2
I need to select rows from a table based on these 3 parameters however if the parameter is passed in null I don't want it in my where clause.
I thought of doing something like this:
select * from table1 where
if appno is not null then app_no = appno end if
if userno is not null... and so on
Can someone help me figure out what the best solution for my problem is? Thanks!