[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Multiple parameter for WHERE clause
- Subject: Re: Multiple parameter for WHERE clause
- From: David Smith <davesmit@US.IBM.COM>
- Date: Wed, 10 Jan 2001 12:44:17 -0800
- Importance: Normal
Anne,
What I generally do for optional WHERE parameters is to initialize them all
as '1=1', then if the user has entered a parameter, I update the variable
assignment.
Let $where1 = '1=1'
Let $where2 = '1=1'
Let $where3= '1=1'
If ISNULL($userparam1)=0
LET $where1 = 'NAME = ' || '''' || $userparam1 || ''''
end-if
begin-select
column1 &col1
>From Tables
Where [$where1]
and [$where2]
and [$where3]
David L Smith
IBM Global Services