[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Conditional selects



Yes ... just enclose your variable in square brackets in the sql statement
ie from tablename where field2 =  [$selectedValue]


Karen

Extension 4774



-----Original Message-----
From: Andrew Rivers [mailto:andrew.rivers@CWCOM.NET]
Sent: Tuesday, May 30, 2000 2:54 PM
To: SQR-USERS@list.iex.net
Subject: Conditional selects


Hi
In SQR it is possible to make a conditional select by passing in a variable
into the where clause:
e.g.
...
...
let $selectedValue = 'valueSelected'
begin-select
field1
field2
field3
...
from tablename where field2 =  $selectedValue
end-select
...


***************************************************************
However, I need to select on whether field1 is null or field1 is equal to a
particular value
i.e,
...
let $selectedValue = 'valueSelected'
begin-select
field1
field2
field3
...
from tablename where     field2 is null
                                     field2 = $selectedValue
end-select
...

Somehow, I think that it should be possible to pass in a string/string
literal...
        ...but so far I have drawn a blank...

Am I chasing moonbeams?
Is it possible? Or am I wasting my time?

Thanks.

Andrew
********