[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Working with Null values of database in SQR
- Subject: Re: Working with Null values of database in SQR
- From: David Donnelly <dave@ISISBIO.COM>
- Date: Thu, 9 Jul 1998 20:35:53 -0700
Hi Parijat,
The solution of specifying $column2-value = '' works in Oracle and
may work in other databases, but causes me no end of pain in Ingres, and
maybe other databases, in which "null" and "a string of length zero" are
definitely NOT the same. In this case, you would need to search for
"my_column_2 is null" or perhaps make some use of the NVL or equivalent
function.
Dave Donnelly
ISIS BioComp
At 04:30 PM 7/9/1998 PDT, you wrote:
>Hi all,
>
>Thanks for the reponse to my query (no pun intended).
>
>My problem was how to specify null value in an SQR variable, i.e., my
>query would be
>begin-select
>my_column_1
>from my_table
>where my_column_2 = $column2-value
>end-select
>I wanted to be able to specify at runtime the value of $column2-value
>to be either 'null' or any valid string.
>As one of you suggested, specifying $column2-value = '' would work fine.
>Thanks. It works. Another method would be to write following code:
>let $exp-col2 = 'is'
>let $column2-value = 'null'
>begin-select
>my_column_1
>from my_table
>where my_column_2 [$exp-col2] [$column2-value]
>end-select
>Now I can change $exp-col2 and $column2-value at runtime to select on a
>specific value or on 'null'.
>
>Parijat
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
>
>