Is it possible to dynamically change the From Clause?
Hi, I have a Oracle SQL query in a MRS report that I would like to change the table (data view) name based on a parameter at run time. I have two data views that have the same column names, but one is for budget version 1 and the other is for budget version 2. I have a report that I would like the user to be able to select the version at run time. I have not been able to figure out how to use a parameter in the from clause. Is this even possible? I am getting "invalid table name' when I try to use a parameter to set the table name. Thanks, Trish Trish Leppa
April 26th, 2011 11:37am

Try this: if(@Parameter='version 1') begin select * from table 1 end else begin select * from table 2 end
Free Windows Admin Tool Kit Click here and download it now
April 26th, 2011 11:45am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics