Reports where_clause [message #89700] |
Tue, 29 June 2004 03:09 |
tt
Messages: 16 Registered: September 2000
|
Junior Member |
|
|
Hi,
I new with Oracle Reports and i'm using version 9i.
Question : If i have two different forms calling the same report, is it possible to change the where_clause of the report query depending on which form i'm printing from ???
Any help will be very much appreciated.
|
|
|
Re: Reports where_clause [message #89702 is a reply to message #89700] |
Tue, 29 June 2004 07:07 |
Steve
Messages: 190 Registered: September 1999
|
Senior Member |
|
|
Tt-
Yes it is possible. You need to use what is known as LEXICAL PARAMETERS. You can replace the entire where clause (if that is suitable) with this approach. The syntax would be:
select *
from table_name
&where
&where would consist of all the parameters you would want to pass to the where clause. You would build your form (this is known as building a flexible front-end, extremely useful and eliminates the need for so much repetition!) and pass those values determined in the form to the report via the &where. The exact methodology on how to accomplish this I am still uncertain about, maybe somebody else can walk you through it? Hope I have helped somewhat.
Regards,
Steve
|
|
|
|
Re: Reports where_clause [message #89716 is a reply to message #89700] |
Sat, 03 July 2004 21:11 |
Atul P
Messages: 61 Registered: June 2003 Location: Mumbai-Jakarta
|
Member |
|
|
Do this
Make one Parameter inyour report named
V_WHERE varchar2(2000)
Now your query should be like this
select ename, dept_code, sal
from emp
&V_WHERE
Now through your FormPass the respective string for where cluase.
e.g Form_1
V_WHERE := 'WHERE EMP_CODE = XX AND DEPT = 10';
FORM_2
V_WHERE := 'WHERE SAL> 10000';
Enjoy ....
|
|
|