Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> oo4o.23 AddTable problem
I am trying to create a Table array in oracle Objects For OLE. The array
creation is fine, no errors there. Then when I try to execute the SQL
statement I get an 8197 error (error during commit.) What is the
problem? The code is an exact copy of an example on oracle's site.
Thank you in advance.
Here is the code:
// C++ file
#include <stdlib.h>
#include <stdio.h>
#include "d:\orant\oo4o23\cpp\include\oracl.h"
#pragma comment(lib, "d:\\orant\\oo4o23\\cpp\\lib\\oraclm.lib")
ODatabase odb;
ODynaset ody;
OParameterCollection opc;
OParamArray opa;
void main()
{
OStartup();
odb.Open("Database","scott","tiger");
if (!odb.IsOpen())
{
printf("%s",odb.GetErrorText()); exit(1);
opc = odb.GetParameters();
//Define the parameters
opa = opc.AddTable("IT_DATA", OPARAMETER_INOUTVAR, OTYPE_NUMBER, 2);
//Call the procedure in an anonymous PL/SQL block if ( odb.ExecuteSQL("Begin oo4otst.proc1(:IT_DATA); End;") != OSUCCESS ) // This is where I get the error
{
printf("%s",odb.GetServerErrorText()); exit(1);
//Display the returned values
int val;
opa.GetValue( (int*)&val, 0);
printf("%i\n", val);
opa.GetValue( (int*)&val, 1);
printf("%i\n", val);
//Remove the parameters from the parameter list opc.Remove("IT_DATA");
OShutdown();
return;
}
// end C++ file
// The stored procedure is
procedure proc1(data in out array) is
begin
![]() |
![]() |