MySQL Stored Procedures - Sending Variables that Might or Might Not Be Empty -


i'm sending in variable _activeflag can 1 or 0 (char, not smallint). if send in blank _activeflag, want records, if send in 1 or 0, want records activeflags clause is

where ( activeflag = _activeflag or _activeflag = "" )

is not correct? line mean? had convinced myself other page can't find it's shorthand if statement. if _activeflag not blank search on column specified. wrong?

i think should check is null rather like

where ( activeflag = _activeflag or _activeflag null ) 

Comments