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

data link question

Status
Not open for further replies.

sjh7899

Programmer
Jun 11, 2002
20
CA
Hey,

I was wondering if a problem i have been having is a bug or if you just cant do what i want to do. Heres the situation...

I have a data block, that block is linked to alot of other blocks. I have the column that they are linked on in a parameter which changes depending on what is chosen in the parameter form.
ie the parameter starts as: to_char(date_col, 'YYYY-MON')
What i am doing in the after parameter form program unit is changing this parameter to be : to_char(date_col,'YYYY')

Now I use this parameter in all the blocks that are linked and they are all linked on this parameter. When i change the value in the program unit it doesnt seem to be linked anymore. I was wondering if this is because the datalinks are already binded to the blocks before i make the change.
Does anyone know how i can get around this ?

This is pretty hard to explain so if my problem is unclear just ask questions and I will try to clarify as best I can.
Thanks in advance.

Steve.
 
Please explain what this means:
the parameter starts as: to_char(date_col, 'YYYY-MON')
And this:
changing this parameter to be : to_char(date_col,'YYYY')
 
i mean the initial value of the parameter starts as:
to_char(date_col, 'YYYY-MON')

and when the user chooses to see the report yearly and not monthly i change it to :
to_char(date_col,'YYYY')

is this clear enough ? if not let me know..
Steve.
 
OK, then what do you mean by this:
"I have the column that they are linked on in a parameter"
Are you dynamically assigning in the parameter which column the blocks linked on? How are you doing this?
 
well ya, i am dynamically doing that.... i just create a paramter with an initial value..

ie initial value of p_1 is rpad(' ', 11) columnname, rpad(' ', 5) columnname .... in the query i would say :

select &p_1 from table_name where ...

and even table can be a parameter too and the where and group by or whatever...(this is what i use alot because it makes your queries so dynamic which saves you alot of time by not creating 2+ reports when you can do it with one.)

then in the after parameter form program unit is make p_1 = column1,column2 etc and then the columns become dynamic.. you can change the actual database column names to whatever depending on what is specified by the user in the parameter form.

the problem is that I link on these dynamic columns and the data link doesnt seem to be getting refreshed when i change the column in the after param form program unit...
 
OK. Are you also using lexicals in child query? How do you define columns linked to your dymanic column in master query?
 
i am using them in the child query...

i just create the parameter and put this in the initial value of lets call it p_1

rpad(' ', 11) col1, etc..

for each column name. This one would be a varchar2 with name col1. then i use this col1 variable on the layout model. In the program unit i then could say

:p_1 := 'real_db_col1, etc...' ;

this is how the real db column gets put into the query.
All the columns have to be character for this to work.(i think).
 
I think in this case you may try linking the queries not field-to-field, but field-to-group or group-to-group and referring your variable master column in the DECODE statement of child query. The DECODE would return different columns depending on which master column is currently active.
 
good idea!! i will give it a try.
Thanks,

Steve.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top