mikezang
asked on
Can I use a parameter in SELECT FROM as table name?
I am making a common functuion, one parameter is a array table name, I need to select some columns from that table. Can I use as below?
Select *
FROM param1
Select *
FROM param1
If the function rsturns the colelction object then it can be used in select statements
select * from TABLE(<function name>);
select * from TABLE(<function name>);
ASKER
Can you explain more detail or give a smaple?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
For more details related EXECUTE IMMIDIATE or Dynamic SQL:
http://www.utexas.edu/its/unix/reference/oracledocs/v92/B10501_01/appdev.920/a96624/11_dynam.htm
With regards, Hardik
For more details related EXECUTE IMMIDIATE or Dynamic SQL:
http://www.utexas.edu/its/unix/reference/oracledocs/v92/B10501_01/appdev.920/a96624/11_dynam.htm
With regards, Hardik
Example
qry_string := 'select * from ' || param1;
execute immediate qry_string into var;