Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

REF CURSOR

Status
Not open for further replies.

Chao

MIS
Jun 17, 2002
27
US
Is there an approach to traverse the columns of a ref cursor to extract the column information (i.e. column name and value) in PL/SQL? I can do this with Visual Basic's recordset object. Here's VB code of what I would like to do in PL/SQL:

i.e. set rs = cn.execute("select * from tab")
strOutput = ""
for i = 0 to rs.fields.count-1
stroutput = stroutput & rs.fields(i).name & space(5)
next i
while not rs.eof
for i = 0 to rs.fields.count-1
stroutput = stroutput & rs.fields(i).value
& space(5)
next i
rs.movenext
wend
...
 
DBMS_SQL is the only way to handle a result set with
an unknown number and type of columns in PLSQL.

You cannot parse a ref cursor in PL/SQL (although you can in Java, VB, etc.)

Rgds.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top