Selecting multiple columns in Pl/SQL [message #38773] |
Mon, 13 May 2002 21:10 |
cibi pressley
Messages: 3 Registered: May 2002
|
Junior Member |
|
|
hi
i have constructed a query
like
select * from table_name
i have opened a cursor for the query_string
if the above query returns 1 row of data.
how can i fetch the 1 row data and show it in the output.
the reason for this is i don't know the columns in the table
as the table_name is obtained dynamically from a another cursor.
thanks
|
|
|
Re: Selecting multiple columns in Pl/SQL [message #38778 is a reply to message #38773] |
Tue, 14 May 2002 07:40 |
Lee
Messages: 56 Registered: May 1999
|
Member |
|
|
Query USER_TAB_COLUMNS to get the column names for the unknown table and then loop trough them like:
for i in t_plstable.col_name loop
dbms_output.put_line (v_table_name||', '||t_plstable_col(i));
end loop;
|
|
|