Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> ADO and Stored functions
VC++6, Ora 8.0.5
Hello,
I'm using ADO as middleware to access an Oracle DB from my VC app. Executing a stored procedure is quite easy and works fine. However when I want to execute a stored function my call always fails. I get following exception:
Exception thrown for classes generated by #import
Code = 80040e14 Code meaning = IDispatch error #3092 Source = Microsoft OLE DB Provider for Oracle Description = ORA-06550: line 1, column 7: PLS-00221: 'FTEST' is not a procedure or is undefined
I execute the function with:
pCommand.CreateInstance(__uuidof( Command ));
pCommand->ActiveConnection = pDoc->m_pConnection;
pCommand->CommandText = _bstr_t("FTEST");
long i =69;
pCommand->Parameters->Append( pCommand->CreateParameter
("param1",adInteger,adParamInput,0, COleVariant(i)));
pCommand->Execute(COleVariant(DISP_E_PARAMNOTFOUND,
VT_ERROR),COleVariant(DISP_E_PARAMNOTFOUND, VT_ERROR), adCmdStoredProc);
pCommand->Parameters->GetItem("RETURN_VALUE")->Value;
and the function itself is
CREATE OR REPLACE
Function FTEST
( param1 IN number)
RETURN NUMBER IS
BEGIN
INSERT INTO AAATEST VALUES(1,'koekoek') ;
RETURN 666 ;
END;
/
What am I missing? Any help, sample (both VC and VB) would be welcome.
Thanks,
Bart
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Dec 20 1999 - 05:03:52 CST
![]() |
![]() |