Home » SQL & PL/SQL » SQL & PL/SQL » Dynamic From Statement in PL/SQL
Dynamic From Statement in PL/SQL [message #37831] Fri, 01 March 2002 05:22 Go to next message
Anu
Messages: 82
Registered: May 2000
Member
I want to write a dynamic from statement.
How can I do that????
For eg.
In the first query I am getting the list of all the tables having Column "EMP_NAME" and storing the Result in cursor.
CURSOR c_t_table is
SELECT distinct table_name from cols where column_name ='EMP_NAME'.

Now I want to fire Second query on the basis of the result returned by first query.Suppose my first query is returning 40 such tables.
Can i write like this.??

CURSOR c_vehicle(table_name )
IS SELECT emp_no
FROM '||table_name ||'
WHERE emp_name="SMITH".
Re: Dynamic From Statement in PL/SQL [message #37832 is a reply to message #37831] Fri, 01 March 2002 05:32 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
use ref cursor
Previous Topic: Thanks Pratap! How do i call the Images stored in the Database using a procedure?
Next Topic: lot of packages?
Goto Forum:
  


Current Time: Tue Apr 23 04:29:06 CDT 2024