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 -> Pushing the bounds of StoredProcs called from ADO with C++

Pushing the bounds of StoredProcs called from ADO with C++

From: seekingsolns <seekingsolns_at_yahoo.com>
Date: 25 Oct 2001 11:57:49 -0700
Message-ID: <ab3e23fe.0110251057.6018259b@posting.google.com>


I originally posted "Can't read multi-field resultsets in ADO with C++" to the group but am reposting now I have a better understanding of the problem.

I am trying to push the use of the C++ ADO command object to call oracle stored procedures (using the "call" execute syntax) further than any examples I can find. I need to be able to call a stored proc with arbitrarily many output scalar parameters and output table/record parameters. Further, the parameters need to be in arbitrary positions.

Using this execute string works fine for calling a stored proc with one input, 4 scalar outputs and an output recordset with 4 fields. If I save the RecordSetPtr object to XML using "adPersistXML" flag, I can see all records of all fields correctly.

        // Works fine provided all output scalars appear before
        // resultsets in the parameter list.

_bstr_t bsExecuteString = "{call mixparam.manyparams(?, ?, ?, ?,
?,{resultset 100, tableabc,tablessn,tablecnn,tablenbc})}";

However, if I try to call a similar function with an extra scalar output that appears _after_ the resultsets, I get this error:

        // Gives errors:

_bstr_t bsExecuteString = "{call mixparam.manyparams_endscalar(?, ?,
?, ?, ?,{resultset 100, tableabc,tablessn,tablecnn,tablenbc},?)}";

(error returned)

        Code = 80004005
        Code meaning = Unspecified error
        Source = Microsoft OLE DB Provider for ODBC Drivers
        Description = [Microsoft][ODBC driver for Oracle]Invalid
parameter type

If, instead I specify multiple resultsets (which would be my prefered syntax for flexible resultset sizes) from ADO, I can read all the output scalars but only the first field in the returned ADO recordset and cannot find the right method to read subsequent fields. Further, using the "NextRecordset" method on the RecordsetPtr object just gave me errors.

        //Can only read elements of "tableabc" with the following

_bstr_t bsExecuteString = "{call

mixparam.manyparams_endscalar(?,?,?,?,?,{resultset 100,tableabc},{resultset 20,tablessn},{resultset 80,tablecnn},{resultset 42,tablenbc},?)}";

Any help would be most gratefully received! Received on Thu Oct 25 2001 - 13:57:49 CDT

Original text of this message

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