Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Can't get Proc Parameter with ODBC from C++

Can't get Proc Parameter with ODBC from C++

From: <jashaw1_at_my-deja.com>
Date: Wed, 16 Jun 1999 23:59:33 GMT
Message-ID: <7k9dp0$3pq$1@nnrp1.deja.com>


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):



// Prep SQL statement (returns 0, OK)

retCode = SQLPrepare(oConnection->hStmt, (SQLCHAR*)"{call myproc1(1, 'test2', 'test3', 'test4', 'test5', 'test6', 'C', ?)}", SQL_NTS);

// 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.
Thanks,
Jeff

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US