passing parameters to Cursors [message #20907] |
Sun, 30 June 2002 20:54 |
Giri Gajjela
Messages: 14 Registered: June 2002
|
Junior Member |
|
|
Hi,
I have two cursors. I need to pass the output of first cursor as a parameter to the second cursor.
Its like..
First I need to find out all the table names, then find out the column names for each table.
Regards,
- Giri Gajjela
|
|
|
Re: passing parameters to Cursors [message #20909 is a reply to message #20907] |
Sun, 30 June 2002 22:23 |
Saga
Messages: 51 Registered: April 2002
|
Member |
|
|
Hope the following solution helps.
DECLARE
CURSOR ctab IS
SELECT table_name
FROM ALL_TABLES
WHERE owner = USER;
CURSOR ccol ( tname VARCHAR2 )IS
SELECT column_name
FROM ALL_TAB_COLUMNS
WHERE table_name = tname;
BEGIN
FOR i IN ctab LOOP
FOR j IN ccol(i.table_name) LOOP
dbms_output.put_line ( j.column_name );
END LOOP;
END LOOP;
END;
|
|
|