Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Can't get Proc Parameter with ODBC from C++
I'm trying to capture an output parameter from an Oracle stored proc
using C++ and ODBC.
I am trying to return one of the proc parameters (the only one defined as an OUT on the Oracle end), not a return code.
Here's a clip of ODBC C++ I've been trying(return codes from debugger in parenthesis in comments above statement):
// bind to output parameter from stored proc (returns 0, OK)
retCode = SQLBindParameter(oConnection->hStmt, 1, SQL_PARAM_OUTPUT,
SQL_C_CHAR, SQL_VARCHAR, 60, 0, pszErrorMessage, 60, &nErrMsg);
// Execute proc (this returns 99 = SQL_NEED_DATA, not getting anything
back)
retCode = SQLExecute(oConnection->hStmt);
//Try retrieving param with MoreResults (this returns -1 on the first pass and loops infin, still not getting anything back) while ( ( retCode = SQLMoreResults(oConnection->hStmt) ) != SQL_NO_DATA ) {
retCode = retCode; // just a bogus line to monitor loop } *************************************************Any Oracle ODBC examples capturing a single value from a stored proc would be greatly appreciated.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Wed Jun 16 1999 - 18:59:33 CDT