I have an integer field person_id with the default value of NULL. I am using a stored procedure and pulling people names and address. if a user does not pass a value all records are pulled both, null and not nulls. How do I do it. May be Case statement or otherwise?
my_procedure( <--- this is pseudo code
@person_id int null
begin
select name, address from PERSON
WHERE person_id like case NULL then NULL else '%'
end
Null requires -> IS NULL number requires = 123
EDIT I need a condition too, if nothing is passed, all values are pulled. If something is passed, that value is searched
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)