Returning ref cursor from sproc call
566045Mar 8 2007 — edited Mar 9 2007I've done search upon search to figure out how to do this - and I found plenty of examples, however unfortunately none of them seemed to work.
I don't have access to the SQL of the procedure I'm calling, but the call signature is basically: procedure(val in VARCHAR2, pResult OUT REF CURSOR).
I know the procedure works, I've been calling it with .NET code for well over a year now. However, it has been decided that some legacy apps now need to call this procedure as well, so I need to be able to do the call with direct ODBC API calls.
From the searching I've done, it seems that the following should work (after the first parameter is bound with SQLBindParameter)
SQLExecDirect(hstmt, "{call procedure(?)}" ...);
However, if I execute this, I'll get the following errors:
[Oracle][ODBC][Ora]ORA-04043: object procedure does not exist
[Oracle][ODBC][Ora]ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'PROCEDURE'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
If I change the call to:
SQLExecDirect(hstmt, "{call package.procedure(?)}" ...);
I then get the error:
[Oracle][ODBC][Ora]ORA-24328: illegal attribute value
After that, I even tried:
SQLExecDirect(hstmt, '{call package.procedure('some value')}" ...);
but I still got the same ORA-24328: illegal attribute value error.
I'm definitely at my wit's end with this issue, and I've already spent twice as much time as I should have on it. Does anyone have anything I can try out?