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!

How to use a variable to pass parameters

Status
Not open for further replies.

mkooian

Programmer
May 19, 2005
2
US
I am using Reports Builder 10g. I have one query which pulls out a key and seven OTHER queries that use that key to create seven different report sections. All queries access data in the same table.

The first query should set a key so the other seven can use that key to get data. The key changes everytime all seven queries get executed (one report page is displayed),
The first query may be running in a repeating frame.

Questions?
How do I get the seven queries to check that key. Can you have (or declare) variables in Reports Builder to which you can assign a value in each iteration and then include a check (for that value)in the where clause of other queries? If yes how would I do that?

In a programming language (or in a Stored Proc) this is simple, in a loop you pull a value from an array(or table) and pass it as a parameter to several functions(or SPs)... Can you do something similar in Reports Builder at run time? Like a local or global variable. I though a Ref cursor maybe a way but haven't found a lot of good docs on it.

Thanks

Mike
 
Use the "Link" tool in the data model toolbar to link all your seven queries to the master query.
 
Thanks for responding. Here is how the output is to look. Query 0 pulls the key.

key 138
data to be pulled from query 1 for 138
data to be pulled from query 2 for 138
data to be pulled from query 3 for 138
..
key 139
data to be pulled from query 1 for 139
data to be pulled from query 2 for 139
data to be pulled from query 3 for 139
..
Key 140
...

Even if I make a link how will the other queries know what key to use in their where clause? They should ONLY be using ONE KEY ata a time. Right now the spit out data for all keys.
Do I need to include the layouts for queries 1,2,3.... inside the layout for query 0.

Thanks again
 
Yes, you need to include those layouts into the repeating frame for the keys generated by the first query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top