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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reports - Dynamically Changing the FROM Clause

Status
Not open for further replies.

thebull1

Programmer
Oct 24, 2001
68
I'd like to dynamically change the FROM clause in the Report query, such that I should be able to provide the table from which to select in the parameter form at runtime. How would I go about that ??

Thanks.
 
Use lexical parameters. eg.

Select x from &table_name

Then populate the table_name parameter in a before-report or somesuch.
 
Thanks Lewisp... I did come across the Lexical parameters but could not implement them. I kept getting the error of "table or view does not exist". After a long struggle, I did however manage to use the SRW.DO_SQL build-in package which worked very well with a view that I created to pass the table name into its string.
Thanks again.
 
You have to provide default value for table_name variable. With this table name your query must be valid during design time.
 
Hiya !

This lexical parameter is applicable for other report objects also, when you want to handle something dynamically in the report !

Please get back to me in case you need a clarification regarding this.

Rgds,
Hari
hariharan_murugan@infy.com
 
I guess my problem with the lexical parameters was that issue of providing a default value for the parameter. I just did not understand what the problem was so I resulted to a view, but I'll be sure to get back to you all the next time I have to use the dynamic select with a lexical parameter.
Thanks a lot guys!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top