Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Inspecting CURSOR properties for information

Inspecting CURSOR properties for information

From: Dan Harwood <Dan_Harwood_at_cargill.com>
Date: Fri, 14 Aug 1998 13:52:02 -0500
Message-ID: <35D48752.6E921C04@cargill.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US