access varray returned from oracle

D

displayname

The ASP page calls an Oracle procedure which returns a varray in the output
parameter. How can I access the values in the varray from the ASP side?

If the procedure returns a REF CURSOR then I can do the following to access
the data.

Set objCmd = Server.CreateObject("ADODB.Command")
With objCmd
.ActiveConnection = objConnection
.CommandText = "{call proc1(?,{resultset 0, outRefCurs}), ? }"
.CommandType = adCmdText
.Parameters(0).Value = 12
Set recordset1 = .Execute()
End With

if not recordset1.eof then
array1 = recordset1.GetRows
array1Index = UBound(array1, 2)
end if
free_object(recordset1)
response.Write(array1(1,0) )
response.Write(array1(1,1) )


How can the above codes be changed for varray?

The varray has multiple rows where each row has 2 columns.

Thanks.
 
B

Bob Barrows

displayname said:
The ASP page calls an Oracle procedure which returns a varray in the
output parameter. How can I access the values in the varray from the
ASP side?

If the procedure returns a REF CURSOR then I can do the following to
access the data.

Set objCmd = Server.CreateObject("ADODB.Command")
With objCmd
.ActiveConnection = objConnection
.CommandText = "{call proc1(?,{resultset 0, outRefCurs}), ? }"
.CommandType = adCmdText
.Parameters(0).Value = 12
Set recordset1 = .Execute()
End With

if not recordset1.eof then
array1 = recordset1.GetRows
array1Index = UBound(array1, 2)
end if
free_object(recordset1)
response.Write(array1(1,0) )
response.Write(array1(1,1) )


How can the above codes be changed for varray?

The varray has multiple rows where each row has 2 columns.
I don't believe it is possible. You will need to return a cursor rather than
a varray. Here is the list of possible ADO data types:
http://www.carlprothman.net/Technology/DataTypeMapping/tabid/97/Default.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top