Subject | About input params in stored procedure and where clause |
---|---|
Author | Sławek Cabaj |
Post date | 2010-07-01T10:47:50Z |
Hello,
The case is like that:
A stored proc has some input params: column_1_param, column_2_param etc
Params may have a value (int, date, varchar) or may be set to null;
I'd like to use them in where clause of select statement inside the proc
something like that
...
where column1 = column_1_param and ...
but when column_1_param is set to null I get
...
where column1 = NULL ...
but in such situation I'd like to accept all records from column1
Any hints, please ?
[Non-text portions of this message have been removed]
The case is like that:
A stored proc has some input params: column_1_param, column_2_param etc
Params may have a value (int, date, varchar) or may be set to null;
I'd like to use them in where clause of select statement inside the proc
something like that
...
where column1 = column_1_param and ...
but when column_1_param is set to null I get
...
where column1 = NULL ...
but in such situation I'd like to accept all records from column1
Any hints, please ?
[Non-text portions of this message have been removed]