Reputation: 1
I'm sending in a variable _activeflag which can be 1 or 0 (char, not smallint). If I send in a blank for _activeflag, I want to get all records, but if I send in a 1 or 0, I want records with those activeflags so my where clause is
WHERE ( activeflag
= _activeflag OR _activeflag = "" )
Is that not correct? What exactly does that line mean? I had convinced myself from some other page that I can't find that it's like a shorthand if statement. If _activeflag is not blank then search on the column specified. Am I wrong?
Upvotes: 0
Views: 19
Reputation: 77896
I think you should probably check for IS NULL
rather like
WHERE ( activeflag = _activeflag OR _activeflag IS NULL )
Upvotes: 1