lakerhxh
September 19th, 2001, 03:56 AM
I want to get a recoreset from SP in oracle.
the code of store precedure is listed as below:
---------------------------------------------
CREATE OR REPLACE PROCEDURE SP_TEST
(
ret_cur out DEFPKG.EMPTY_CUR
)
IS
BEGIN
OPEN RET_CUR FOR Select * FROM mytable;
END SP_TEST;
-------------------------------------------------
the type "DEFPKG.EMPTY_CUR" is defined in package "DEFPKG"
TYPE EMPTY_CUR IS REF CURSOR;
And the calling codes is:
---------------------------------------------------------
.....
QSQL = "{call SP_TEST({resultset 1000,ret_cur})}"
Set CPw = New ADODB.Command
With CPw
Set .ActiveConnection = Cn
.CommandText = QSQL
.CommandType = adCmdText
End With
Set Rs = New ADODB.Recordset
With Rs
.CursorType = adOpenStatic
.LockType = adLockReadOnly
End With
Rs = CPw.Execute 'Error occurs
--------------------------------------
when running to the last line,system report ORA-01060 error.
(array binds or executes not allowed).
Oracle document tell me that this is because "The client application attempted to bind an array of cursors or attempted to repeatedly execute against a PL/SQL block with a bind variable of type cursor".
But I donn't know how to solve it.
Thanks a lot.
the code of store precedure is listed as below:
---------------------------------------------
CREATE OR REPLACE PROCEDURE SP_TEST
(
ret_cur out DEFPKG.EMPTY_CUR
)
IS
BEGIN
OPEN RET_CUR FOR Select * FROM mytable;
END SP_TEST;
-------------------------------------------------
the type "DEFPKG.EMPTY_CUR" is defined in package "DEFPKG"
TYPE EMPTY_CUR IS REF CURSOR;
And the calling codes is:
---------------------------------------------------------
.....
QSQL = "{call SP_TEST({resultset 1000,ret_cur})}"
Set CPw = New ADODB.Command
With CPw
Set .ActiveConnection = Cn
.CommandText = QSQL
.CommandType = adCmdText
End With
Set Rs = New ADODB.Recordset
With Rs
.CursorType = adOpenStatic
.LockType = adLockReadOnly
End With
Rs = CPw.Execute 'Error occurs
--------------------------------------
when running to the last line,system report ORA-01060 error.
(array binds or executes not allowed).
Oracle document tell me that this is because "The client application attempted to bind an array of cursors or attempted to repeatedly execute against a PL/SQL block with a bind variable of type cursor".
But I donn't know how to solve it.
Thanks a lot.