Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic queries in reports

Status
Not open for further replies.

bilalch

Programmer
Sep 26, 2003
84
0
0
IR
hi dear frends.

i want to select the qyery dynamically on the basis of
my parameter form.

i heard that it can b done through
srw.do_sql
but i dont know how and where to use it .
plz help me.

 
Specify a lexical parameter and you can make a SQL statement as dynamic as you like, as long as the number and types of the columns remain static.

For example, you could specify a SQL like this:

[tt]SELECT something
FROM a_table
&where_clause[/tt]

...then you pass in the where clause to the where_clause parameter when you run the form.
 
hi dear lewisp,

that's alright but the thing abt which i'm worried is how to pass the query selected with this criterion into the data model in the reports.

like if i hav a static LOV having the values

Customer
Construction
Date

now i write code like this
begin

if :LOV='Customer'
then
select something
from customer,product
where .....
order by customer.c_name

else if :LOV='construction'
then
select something
from customer,product
where .....
order by product.construction

end if;
end;

** the point is , will it work besides the actual query given into the data model right in the start of the report.
plz help
thanx
bye

 
Friends,
I want to use an if clause in a select statement. Any help is appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top