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

Home -> Community -> Usenet -> c.d.o.tools -> MSDAORA and stored procedure

MSDAORA and stored procedure

From: <ileyfer_at_my-deja.com>
Date: Tue, 19 Sep 2000 21:54:52 GMT
Message-ID: <8q8nb2$km9$1@nnrp1.deja.com>

I'm having a problem trying to reuse OLE DB consumer code that works with SQLOLEDB

provider and MsSql7. I was able to call a stored procedure there was no error returned,

however I couldn't read the data from rowset. Am I doing anything wrong?

I'm using VC++, Oracle 8.1.6 ( server and client ), Windows 2000(sp1),

CDynamicAccessor ATL consumer class and MSDAORA provider. Code for both stored procedure and client is below.

Thank you.


oracle SP code:


create or replace package atp_test

as

type generic_cursor is ref cursor ;

procedure procedure1( result in out generic_cursor ) ;

end atp_test

;

/

create or replace package body atp_test

as

procedure procedure1( result in out generic_cursor )

is

begin

open result for select * from table1 ;

end procedure1;

end atp_test

;

/


client code:


CCommand<CDynamicAccessor> cmd ;

m_dbinit.AddProperty(DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO, false);

m_dbinit.AddProperty(DBPROP_AUTH_USERID, bstrUserName );

m_dbinit.AddProperty(DBPROP_AUTH_PASSWORD, bstrPassword ) ;

m_dbinit.AddProperty(DBPROP_INIT_DATASOURCE, bstrServerName );

m_dbinit.AddProperty(DBPROP_INIT_LCID, (long)1033);

m_dbinit.AddProperty(DBPROP_INIT_PROMPT, (short)4);

if ( FAILED( hr = m_db.OpenWithServiceComponents( m_bstrProvider,&m_dbinit ) ) )



m_session.Close() ;

hr = m_session.Open( m_db ) ;

if( FAILED( hr = cmd.Create( m_database.GetCurrentSession(), L"{ CALL atp_test.procedure1 }" ) ) )



if( FAILED( hr = cmd.Prepare() ) )

if( FAILED( hr = cmd.Open( NULL, NULL, true ) ) )

m_database.CloseConnection( contextId ) ;

for( hr = cmd.MoveFirst(); hr == S_OK ; hr = cmd.MoveNext() )

{

int column1 = *(int *)cmd.GetValue(1L) ;

int column2 = *(int *)cmd.GetValue(2L) ;

CComBSTR column3 = (char *)cmd.GetValue(3L) ;


}

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Sep 19 2000 - 16:54:52 CDT

Original text of this message

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