sedj
Programmer
- Aug 6, 2002
- 5,610
Hi,
I am having a nightmare using OCI to map to an object via a proc call.
Anyone ever had any joy ? On execution I get an OCI_ERROR, but the message just says "ORA-00000 :normal, successful completion", but I know the proc does not execute because an insert into a log table does not occur.
Would appreciate any help on this, or, of how to map onto a nested table object ...
As usual the OCI prog guide is bewildering !
--------------------------------------------------
Free Database Connection Pooling Software
I am having a nightmare using OCI to map to an object via a proc call.
Anyone ever had any joy ? On execution I get an OCI_ERROR, but the message just says "ORA-00000 :normal, successful completion", but I know the proc does not execute because an insert into a log table does not occur.
Would appreciate any help on this, or, of how to map onto a nested table object ...
As usual the OCI prog guide is bewildering !
Code:
struct masterMapData {
OCINumber code;
OCIString *coordinates;
};
typedef struct masterMapData masterMapData;
struct masterMapData_ind
{
OCIInd _atomic;
OCIInd code;
OCIInd coordinates;
};
typedef struct masterMapData_ind masterMapData_ind;
sword status;
int in_x = 292500;
int in_y = 92500;
int in_width = 200;
int in_height = 200;
int i, nrows = 0,
rows_fetched = 0,
rows_processed = 0,
rows_to_process = 0;
boolean has_more_data = TRUE;
/* parse query */
/* the stored procecdure call */
char * stmt =
"BEGIN\n"
" BEN.READ7(:in_x, :in_y, :in_width, :in_height, :mm_data);\n"
"END;\n";
prepareStatement(stmt);
bindByName(":in_x", &in_x, sizeof(in_x), SQLT_INT);
bindByName(":in_y", &in_y, sizeof(in_y), SQLT_INT);
bindByName(":in_width", &in_width, sizeof(in_width), SQLT_INT);
bindByName(":in_height", &in_height, sizeof(in_height), SQLT_INT);
masterMapData *mm_data_obj[ARRAY_SIZE];
masterMapData_ind *mm_data_ind[ARRAY_SIZE];
OCIDefine *defn1p = NULL;
bindByName(":mm_data", &mm_data_obj, 0, SQLT_NTY);
printf("OCIDefineByPos\n");
checkerr(errhp, OCIDefineByPos(stmthp, &defn1p, errhp, (ub4)2,
(dvoid *)0, (sb4)0, SQLT_NTY, (dvoid *)0,
(ub2 *)0, (ub2 *)0, (ub4)OCI_DEFAULT));
printf("OCIDefineObject\n");
OCIType* mm_tdo = get_tdo("t_mm_tab");
checkerr(errhp, OCIDefineObject(defn1p, errhp, mm_tdo,
(dvoid **)mm_data_obj, (ub4 *)0,
(dvoid **)mm_data_ind, (ub4 *)0));
// execute
printf("Executing ...");
status = OCIStmtExecute(svchp, stmthp, errhp, (ub4)1, (ub4)0,
(OCISnapshot *)NULL, (OCISnapshot *)NULL,
(ub4)OCI_DEFAULT);
--------------------------------------------------
Free Database Connection Pooling Software