Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Read the Fovean Chronicles

Because you just can't spend your whole day programming!

Posted

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'

Read the Fovean Chronicles

Because you just can't spend your whole day programming!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...