33
Views
1
Comments
Solved
How to pass a NULL value into a stored procedure SQL statement?
Question

I am currently working with a SQL stored procedure that has unique behavior when passed a NULL value as one of its parameters. Due to Outsystems' lack of a true NULL value, I can't seem to actually do this without hardcoding it into the SQL statement. Using NULLIF() does not work since I don't think you can pass a function as a stored proc parameter - whenever I try, I get an "incorrect syntax near keyword NULLIF" error. 

Is there a workaround for this that I can implement within a single call to the SQL widget? I could technically work around this by creating a different hardcoded SQL action for each combination of NULL vs non-NULL parameters, but this stored proc has 10 inputs, so I would have to hardcode a total of 1024 separate SQL actions, which is not reasonable. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.