Help with Decode [message #294414] |
Thu, 17 January 2008 08:57 |
petis
Messages: 9 Registered: November 2007
|
Junior Member |
|
|
Hi
Need help on how to get this to work.
What I really want to do is to choose which copies to print depending on if I send the print to printer or to screen.
REPORT_COPIES.COPY_NO IN (1,2,3,6,10) This works but it sends those copies out no matter what the variable DESTYPE is.
Now
REPORT_COPIES.COPY_NO IN DECODE(:DESTYPE,'Cache',(6) ,(10))
Also works, if DESTYPE is set to 'Cache' it produces only the sixth report onto my screen, and if it is set to 'printer' report number 10 is printed.
Problem is that I want multiple pages to go out when DESTYPE is set to 'printer' and
REPORT_COPIES.COPY_NO IN DECODE(:DESTYPE,'Cache',(6) ,(1,2,3,6,10)) doesn't work at all, as the decode thinks that the comma is part of the decode.
Any suggestions for how to get around this?
Been trying with ;:.[]{} but nothing seems to work.
This is in the SQL QUERY STATEMENT that I need to get this in.
|
|
|
|
Re: Help with Decode [message #294599 is a reply to message #294414] |
Fri, 18 January 2008 02:14 |
petis
Messages: 9 Registered: November 2007
|
Junior Member |
|
|
Thanks,
Been looking that up now, but can't seem to get it to work, Could someone please explain in abit more detail how to use them?
I Either want to send in just one number (6) or several (2,3,4,5,6,7,
I can fix the one number, but the problem is when I want ot use multiple numbers.
[Updated on: Fri, 18 January 2008 02:18] Report message to a moderator
|
|
|
Re: Help with Decode [message #294602 is a reply to message #294599] |
Fri, 18 January 2008 02:40 |
|
vamsi kasina
Messages: 2112 Registered: October 2003 Location: Cincinnati, OH
|
Senior Member |
|
|
Where you have codedQuote: | REPORT_COPIES.COPY_NO IN (1,2,3,6,10)
| change this toREPORT_COPIES.COPY_NO IN &v_copy_no
I think DESTYPE will get populated in parameter form.
So, In the afterparameterform trigger you can assign the value to the lexical parameter v_copy_no asIF :DESTYPE = 'Cache' THEN
v_copy_no := '(6)';
ELSE
v_copy_no := '(1,2,3,6,10)';
END IF; Have a look at this.
By
Vamsi
|
|
|
|