Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Retrieve a REF CURSOR from procedure in ASP

622897Feb 13 2008 — edited Feb 13 2008
Hi!
I'm developing a classic ASP application in which I'm supposed to retrieve a recordset from an Oracle procedure.

The Oracleprocedure only has one parameter, an out parameter of type REF CURSOR. The provider we are using is "ASPOraOLEDB.Oracle.1".

I can retrieve strings and other types from the procedures in the same Oracle database but I cannot get the ref cursor to work from ASP.

This is the code in ASP:
Dim lcConnectionString, loConn
lcConnectionString = "Provider=OraOLEDB.Oracle.1;Data Source={Datasource};Persist Security Info=True;Password=[password};User ID={user}"

Set loConnection = Server.CreateObject("ADODB.Connection")
loConnection.Open lcConnectionString
Dim loRS
Set loRS = Server.CreateObject("ADODB.RecordSet")

Set CMD = Server.CreateObject("ADODB.Command")
CMD.ActiveConnection = loConnection
cmd.CommandType = adCmdStoredProc
CMD.CommandText = "{call package.utdata()}"

Set loRS = CMD.Execute()

I am receiving the following error:
OraOLEDB error '80040e14'

ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'UTDATA' ORA-06550: line 1, column 7: PL/SQL: Statement ignored

If I use the following syntax for the command.commantext: CMD.CommandText = "{call package.utdata(?)}" I only get an empty resultset which is closed.

I also tried to add an out Parameter to the Command object such as:
CMD.Parameters.Append CMD.CreateParameter("varde", adVarChar, adParamOutput)
where "varde" is the name of the out parameter in the Oracle procedure. But got the same error.

I know that we have succeded to get data from the same procedure in VBA/Excel but not from ASP.

I will be really thankful if anyone has a solution to this.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 12 2008
Added on Feb 13 2008
1 comment
6,848 views