Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Inspecting CURSOR properties for information
If I were to write a routine to sequentially query a list of tables, is
there anyway to find out, after creating the cursor, what the field
names are and what their realtive postion in the record is?
For example if I had a table called 'tables' that had one field called
'tablename' that contained a list of table names; TABLE1, TABLE2,
TABLE3. Next I loop through this table creating a cursor called
'tableinfo' on "SELECT * FROM " + tables.tablename.
I would then like to be able to reference the cursor in such a way that I can loop though each field in the record and display the field name and field values. Something like this:
Do while not EOF tables
Cursor tableinfo = "Select * from " + tables.tablename For i = 1 to tableinfo.FieldCount
display tableinfo(i).name, tableinfo(i).value
Next
Loop
I realize that none of my examples are using PL/SQL. I figured pseudo-code would be better for explaing what I would like to do. Everything I have read has explicitly used the field name to reference the value within a field.
Any help would be appreciated,
Thanks,
Dan
Received on Fri Aug 14 1998 - 13:52:02 CDT
![]() |
![]() |