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!

Returning ref cursor from sproc call

566045Mar 8 2007 — edited Mar 9 2007
I'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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 6 2007
Added on Mar 8 2007
1 comment
2,511 views