visual c++ - Oracle Stored Procedures with ADO NOT .net and VC++ -


i migrating vc++/sql server app using oracle. database access implemented using ado classes, , can't find way go through cursor returned oracle.

the sproc like:

create or replace procedure getsettings (   cv_1 out sys_refcursor ) begin    open  cv_1       select key ,              value          settings; end; 

the code like:

      _commandptr pcommand;       _parameterptr pparam1;        hresult hr = pcommand.createinstance (__uuidof (command));        if (failed (hr))            return;        pcommand->activeconnection = m_pconn;       pcommand->commandtext = "getsettings";       pcommand->commandtype = adcmdstoredproc;       _recordsetptr precordset;       hr = precordset.createinstance (__uuidof (recordset));       if (failed (hr))            return;        precordset = pcommand->execute(null,null,adcmdstoredproc); 

(in fact using ado classes http://www.codeproject.com/articles/1075/a-set-of-ado-classes-version-2-20#thesample02 )

the returned precordset in closed state , cannot it. imagine should pass parameter cursor, how create/use/access returned cursor using these ado functions? there no cursor parameter type can see

i stuck , appreciate help

thanks

finally found out how it, need specify special parameters in connection string tell return result set:

provider=oraoledb.oracle;user id=xxx;password=xxx;data source=tns_name;oledb.net=true;plsqlrset=true;


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -