TheWizardofInt Posted July 12, 2006 Posted July 12, 2006 I am taking over a Sybase app for a new company, and wading through the SQL statements of a guy who knew one variable type: the string One of his queries includes in the Where clause of a SQL statement: Where <Var> || '' = '' Which I think is supposed to handle the possibility of <Var> being Null (in this case, <Var> is representing the variable name, and the variable is an integer in the table from whence it comes). Am I right? Has anyone seen this before? Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
Leaders snarfblam Posted July 12, 2006 Leaders Posted July 12, 2006 I don't know didly about databases, but I've never seen || mean anything except "or". Quote [sIGPIC]e[/sIGPIC]
TheWizardofInt Posted July 13, 2006 Author Posted July 13, 2006 I wish it were that simple A sample of the statement would be: Where (CheckInDate=20060606 OR ReqStayDaysMax || '' = '') ReqStayDaysMax is an Int value, so I tend to think that is a week attempt to say 'Is Not Null' Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.