Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Can't read multi-field resultsets in ADO with C++
I am trying to call an stored procedure from ADO that has several
resultset outputs. My problem is trying to read from the second field
of the output resultset. The "NextRecordset" method does not give me
access as I would expect. I have seen many examples in VB but cannot
find any C++ code examples.
The stored procedure looks like this:
PROCEDURE multirec
(onessn IN NUMBER, abc OUT NUMBER, tableabc OUT tssn, tablessn OUT tssn, ssn OUT NUMBER)
ssn := 5 * onessn; tableabc(1) := 10 * onessn; tablessn(1) := 20 * onessn; abc := 2 * onessn;
_bstr_t bsExecuteString = "{call mixparam.multirec(?,?,{resultset 100, tableabc},{resultset 100,tablessn},?)}";
comm->put_ActiveConnection(_variant_t((IDispatch *)m_connection,true));
comm->put_CommandText(bsExecuteString); comm->put_CommandType(adCmdText);
I then append all the scalar parameters to the command object and execute the command object with the "open method" like this:
RecSetPtr->Open(_variant_t((IDispatch *)comm,true),vtEmpty, adOpenStatic, adLockReadOnly, 0);
I can then read all the scalar output parameters but only the first field of the resultset. That is, I can only read the records in "tableabc" and not "tablessn":
pFP = RecSetPtr->Fields->GetItem(& index); vRes.bsName = pFP->GetName(); // Gives "tableabc" vRes.cvValue = pFP->GetValue(); // Gives the correct value
How do I get to the second field of the resultset (ie "tablessn")??? The "NextRecordset" method just gives this error:
Code = 800a0cb3 Code meaning = Unknown error 0x800A0CB3 Source = ADODB.Recordset Description = Object or provider is not capable of performingrequested operation.
Thanks in advance. Received on Tue Oct 23 2001 - 14:54:15 CDT