Home » SQL & PL/SQL » SQL & PL/SQL » using variable in a query
using variable in a query [message #224401] Wed, 14 March 2007 03:10 Go to next message
udhu
Messages: 1
Registered: March 2007
Junior Member
hii there,
I need to use a variable (whose value is obtained at runtime and not through command prompt) in a simple query.
For eg.
select TABLE_NAME from set;
where TABLE_NAME is a variable.
Suggest me on how to write a query which takes TABLE_NAME as an variable and not as a column name. (This variable's value is decided by another procedure not from command prompt)
Re: using variable in a query [message #224406 is a reply to message #224401] Wed, 14 March 2007 03:21 Go to previous message
aciolac
Messages: 242
Registered: February 2006
Senior Member
The solution is to use dynamic SQL.
Previous Topic: CAST and Multiset options in oracle
Next Topic: SQL-SPOOL
Goto Forum:
  


Current Time: Sun Dec 04 10:46:24 CST 2016

Total time taken to generate the page: 0.03968 seconds