-
September 1st, 2005, 09:21 AM
#1
ADO and Oracle- Trouble executing stored procedures
I'm using ADO against an Oracle 10g database.
2 problems:
1.) calling the following stored procedures throws an exception on the last line in the code below (DB_E_ERRORSINCOMMAND; IDispatch error #3092):
Code:
ADODB::_CommandPtr pCommand; // Stored Procs
ADODB::_RecordsetPtr recordSet;
pDBConn.CreateInstance( __uuidof( ADODB::Connection ) );
_bstr_t connectString = GetConnectString();
pDBConn->Open( connectString, "", "", 0);
pCommand.CreateInstance(__uuidof(ADODB::Command));
pCommand->ActiveConnection = pDBConn;
pCommand->CommandType = ADODB::adCmdStoredProc;
pCommand->CommandText = _bstr_t("sp_getcard");
VARIANT vCardNum;
vCardNum.vt = VT_BSTR;
vCardNum.bstrVal = _bstr_t( "100" );
pCommand->Parameters->Append(pCommand->CreateParameter(_bstr_t("CardNum"),ADODB::adVarChar,ADODB::adParamInput,50,vCardNum));
recordSet = pCommand->Execute( NULL, NULL,ADODB::adCmdStoredProc);
This procedure compiles within Oracle; the examples I've seen on the web lead me to believe that my approach should work. Can anyone help or direct me any ADO + Oracle (not ADO.NET) sites that may shed light on this.
Here's the actual Stored Proc:
( CardNum IN VARCHAR2, RC1 IN OUT Omwb_emulation.globalPkg.RCT1)AS BEGIN OPEN RC1 FOR SELECT LastName, FirstName, CardNumber, UserDate FROM Addresses WHERE CardNumber = CardNum; END sp_getcard;
-
September 1st, 2005, 11:48 AM
#2
Re: ADO and Oracle- Trouble executing stored procedures
-
September 1st, 2005, 02:44 PM
#3
Re: ADO and Oracle- Trouble executing stored procedures
OK, let me ask this then:
Has anyone every use ADO to retrieve data from an Oracle stored procedure?
-
September 2nd, 2005, 02:20 AM
#4
Re: ADO and Oracle- Trouble executing stored procedures
-
September 2nd, 2005, 12:25 PM
#5
Re: ADO and Oracle- Trouble executing stored procedures
thanks. The second link didn't work when I downloaded and ran the sample. I'm looking @ the second one ( I'm a VC++ guy, not VB, so will have to parse this one out ). Maybe it's the PL/SQL that is the problem ( even though the stored proc compiles in Oracle ).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|