Page 1 of 1

stored procedure NULL

Posted: Fri Jun 27, 2008 5:45 pm
by ddragas
Hi all

I'm kind new in stored procedures, so I would appreciate some help

What I want to accomplish is to check if search criteria is null or not, and based on this criteria - to return results.

Code: Select all

 
select table1.*, table2.* 
from some table1, table2 
where table1.client = table2.id 
and (table1.id = searchID or searchID = null)
 
now this is not working.

can somebody suggest me other solution?

Re: stored procedure NULL

Posted: Fri Jun 27, 2008 7:50 pm
by John Cartwright

Code: Select all

.. searchID IS NULL

Re: stored procedure NULL

Posted: Sat Jun 28, 2008 3:31 am
by ddragas
ok I couldn't see tree from woods

thank you

have a nice day

ddragas