Home » Developer & Programmer » Reports & Discoverer » i need one parameter to display either all the cases or restrict one
i need one parameter to display either all the cases or restrict one [message #280527] Wed, 14 November 2007 00:09 Go to next message
LAZYGIRL
Messages: 34
Registered: May 2006
Member
good morning every one

I have a query that should use parameter to display either all the cases or just restrict one

for example if the user choose from the parameter ALL it well give him all the cases but if he choose other it well give him only that cases

can I accomplish this by using only one parameter instead of using two parameter such as from_user to_user
Re: i need one parameter to display either all the cases or restrict one [message #280553 is a reply to message #280527] Wed, 14 November 2007 01:29 Go to previous messageGo to next message
musman
Messages: 147
Registered: July 2007
Location: Lahore
Senior Member

yes use lexical parameter in your query.
like
create two parameters.
P_TEST
TEST

use

&TEST in your query.
and in after parameter from write like this..

if :P_TEST='ALL' then
:TEST:=' ';
ELSE
:TEST:='AND ABC=:P_TEST';

where abc is table field.

and on run time only show P_TEST to user.

[Updated on: Wed, 14 November 2007 01:32]

Report message to a moderator

Re: i need one parameter to display either all the cases or restrict one [message #280561 is a reply to message #280527] Wed, 14 November 2007 01:39 Go to previous messageGo to next message
skooman
Messages: 912
Registered: March 2005
Location: Netherlands
Senior Member
You could create a where clause with a decode in it, like:

column_1 = decode(:p_col,'ALL',column_1,:p_col)


(this is discoverer syntax, but I assume something similar can be done in reports too)
Re: i need one parameter to display either all the cases or restrict one [message #280570 is a reply to message #280527] Wed, 14 November 2007 02:09 Go to previous message
LAZYGIRL
Messages: 34
Registered: May 2006
Member
skoman and musman I am very grateful to you guys for your help
Previous Topic: Numeric OR value error in After param
Next Topic: No display of values if the key figures are 0
Goto Forum:
  


Current Time: Sat Dec 03 11:58:08 CST 2016

Total time taken to generate the page: 0.05787 seconds