ORAEXT OCIString *oraLoadFileToString (OCIExtProcContext *ctx, char *filename, short filename_indicator, short *return_indicator) { OCIString *result = 0; ORABLOCK_BEGIN { OracleEnv env(ctx, logger); *return_indicator = OCI_IND_NULL; if (filename_indicator != OCI_IND_NOTNULL) throw BingoError("Null filename given"); FileScanner scanner(filename); QS_DEF(Array<char>, buf); scanner.readAll(buf); env.callOCI(OCIStringAssignText(env.envhp(), env.errhp(), (text *)buf.ptr(), buf.size(), &result)); *return_indicator = OCI_IND_NOTNULL; } ORABLOCK_END return result; }
ORAEXT OCIString * oraConfigGetString (OCIExtProcContext *ctx, int context_id, char *key_name, short key_name_indicator, short *return_indicator) { OCIString *result = NULL; ORABLOCK_BEGIN { *return_indicator = OCI_IND_NULL; OracleEnv env(ctx, logger); if (key_name_indicator != OCI_IND_NOTNULL) throw BingoError("Null key is given"); QS_DEF(Array<char>, value); BingoOracleContext &context = BingoOracleContext::get(env, context_id, false, 0); if (!context.configGetString(env, key_name, value)) throw BingoError("Key wasn't found"); env.callOCI(OCIStringAssignText(env.envhp(), env.errhp(), (text *)value.ptr(), value.size() - 1, &result)); *return_indicator = OCI_IND_NOTNULL; } ORABLOCK_END return result; }
ORAEXT OCIString *oraBingoGetName (OCIExtProcContext *ctx, OCILobLocator *source_locator, short source_indicator, short *return_indicator) { OCIString *result = NULL; ORABLOCK_BEGIN { OracleEnv env(ctx, logger); if (source_indicator == OCI_IND_NULL) throw BingoError("null source given"); QS_DEF(Array<char>, source); QS_DEF(Array<char>, name); OracleLOB source_lob(env, source_locator); source_lob.readAll(source, false); BufferScanner scanner(source); bingoGetName(scanner, name); if (name.size() < 1) { // This is needed for Oracle 9. Returning NULL drops the extproc. OCIStringAssignText(env.envhp(), env.errhp(), (text *)"nil", 3, &result); *return_indicator = OCI_IND_NULL; } else { name.push(0); OCIStringAssignText(env.envhp(), env.errhp(), (text *)name.ptr(), strlen(name.ptr()), &result); *return_indicator = OCI_IND_NOTNULL; } } ORABLOCK_END return result; }
int bingoPopRowidsToArray (OracleEnv &env, List<OraRowidText> &matched, int maxrows, OCIArray *array) { OCIString *rid_string = 0; int count = 0; while (matched.size() > 0 && maxrows > 0) { const char *rid_text = matched.at(matched.begin()).ptr(); env.callOCI(OCIStringAssignText(env.envhp(), env.errhp(), (OraText *)rid_text, (ub4)strlen(rid_text), &rid_string)); env.callOCI(OCICollAppend(env.envhp(), env.errhp(), rid_string, 0, array)); maxrows--; count++; matched.remove(matched.begin()); } return count; }
ORAEXT OCIString *oraGetVersion (OCIExtProcContext *ctx, short *return_indicator) { OCIString *result = 0; ORABLOCK_BEGIN { OracleEnv env(ctx, logger); // env.callOCI(OCIStringAssignText(env.envhp(), env.errhp(), (const oratext *)bingo_version_string, // strlen(bingo_version_string), &result)); env.callOCI(OCIStringAssignText(env.envhp(), env.errhp(), (const oratext *)BINGO_VERSION, strlen(BINGO_VERSION), &result)); *return_indicator = OCI_IND_NOTNULL; } ORABLOCK_END return result; }
static OCIAnyData * to_return_value(plruby_context_t *ctx, VALUE val) { OCIAnyData *sdata = NULL; OCIInd ind = OCI_IND_NOTNULL; if (NIL_P(val)) { return NULL; } switch (ctx->rettype) { case OCI_TYPECODE_VARCHAR2: { OCIString *str = NULL; VALUE sval = rb_String(val); sval = rb_str_export_to_enc(sval, oracle_encoding); chk(OCIStringAssignText(ctx->envhp, ctx->errhp, (text*)RSTRING_PTR(sval), RSTRING_LEN(sval), &str)); chk(OCIAnyDataConvert(ctx->svchp, ctx->errhp, ctx->rettype, NULL, OCI_DURATION_SESSION, &ind, str, 0, &sdata)); chk(OCIStringResize(ctx->envhp, ctx->errhp, 0, &str)); return sdata; } case OCI_TYPECODE_NUMBER: { OCINumber num; double dval = rb_num2dbl(val); chk(OCINumberFromReal(ctx->errhp, &dval, sizeof(dval), &num)); chk(OCIAnyDataConvert(ctx->svchp, ctx->errhp, ctx->rettype, NULL, OCI_DURATION_SESSION, &ind, &num, 0, &sdata)); return sdata; } case OCI_TYPECODE_BDOUBLE: { double dval = rb_num2dbl(val); chk(OCIAnyDataConvert(ctx->svchp, ctx->errhp, ctx->rettype, NULL, OCI_DURATION_SESSION, &ind, &dval, 0, &sdata)); return sdata; } } rb_raise(rb_eRuntimeError, "Unsupported Typecode %d", ctx->rettype); }
/* ODCIIndexFetch function */ OCINumber *qxiqtbspf( OCIExtProcContext *ctx, qxiqtim *self, qxiqtin *self_ind, OCINumber *nrows, short nrows_ind, OCIArray **rids, short *rids_ind, ODCIEnv *env, ODCIEnv_ind *env_ind) { sword status; OCIEnv *envhp = (OCIEnv *) 0; /* env. handle */ OCISvcCtx *svchp = (OCISvcCtx *) 0; /* service handle */ OCIError *errhp = (OCIError *) 0; /* error handle */ OCISession *usrhp = (OCISession *) 0; /* user handle */ qxiqtcx *icx = (qxiqtcx *) 0; /* state to be saved for later calls */ int idx = 1; int nrowsval; OCIArray *ridarrp = *rids; /* rowid collection */ OCIString *ridstr = (OCIString *)0; int done = 0; int retval = (int)ODCI_SUCCESS; OCINumber *rval = (OCINumber *)0; ub1 *key; /* key to retrieve context */ ub4 keylen; /* length of key */ /*******************/ /* Get OCI handles */ /*******************/ if (qxiqtce(ctx, errhp, OCIExtProcGetEnv(ctx, &envhp, &svchp, &errhp))) return(rval); /* set up return code */ rval = (OCINumber *)OCIExtProcAllocCallMemory(ctx, sizeof(OCINumber)); if (qxiqtce(ctx, errhp, OCINumberFromInt(errhp, (dvoid *)&retval, sizeof(retval), OCI_NUMBER_SIGNED, rval))) return(rval); /* get the user handle */ if (qxiqtce(ctx, errhp, OCIAttrGet((dvoid *)svchp, (ub4)OCI_HTYPE_SVCCTX, (dvoid *)&usrhp, (ub4 *)0, (ub4)OCI_ATTR_SESSION, errhp))) return(rval); /********************************/ /* Retrieve context from key */ /********************************/ key = OCIRawPtr(envhp, self->sctx_qxiqtim); keylen = OCIRawSize(envhp, self->sctx_qxiqtim); if (qxiqtce(ctx, errhp, OCIContextGetValue((dvoid *)usrhp, errhp, key, (ub1)keylen, (dvoid **)&(icx)))) return(rval); /* get value of nrows */ if (qxiqtce(ctx, errhp, OCINumberToInt(errhp, nrows, sizeof(nrowsval), OCI_NUMBER_SIGNED, (dvoid *)&nrowsval))) return(rval); /****************/ /* Fetch rowids */ /****************/ while (!done) { if (idx > nrowsval) done = 1; else { status = OCIStmtFetch(icx->stmthp, errhp, (ub4)1, (ub2) 0, (ub4)OCI_DEFAULT); if (status == OCI_NO_DATA) { short col_ind = OCI_IND_NULL; /* have to create dummy oci string */ OCIStringAssignText(envhp, errhp, (text *)"dummy", (ub2)5, &ridstr); /* append null element to collection */ if (qxiqtce(ctx, errhp, OCICollAppend(envhp, errhp, (dvoid *)ridstr, (dvoid *)&col_ind, (OCIColl *)ridarrp))) return(rval); done = 1; } else if (status == OCI_SUCCESS) { OCIStringAssignText(envhp, errhp, (text *)icx->ridp, (ub2)18, (OCIString **)&ridstr); /* append rowid to collection */ if (qxiqtce(ctx, errhp, OCICollAppend(envhp, errhp, (dvoid *)ridstr, (dvoid *)0, (OCIColl *)ridarrp))) return(rval); idx++; } else if (qxiqtce(ctx, errhp, status)) return(rval); } } /* free ridstr finally */ if (ridstr && (qxiqtce(ctx, errhp, OCIStringResize(envhp, errhp, (ub4)0, &ridstr)))) return(rval); *rids_ind = OCI_IND_NOTNULL; return(rval); }
/* Function to modify the data of an inherited object */ static void modifyFunction () { OCIDefine *defhp = (OCIDefine *)0; OCIRef *sub_ref = (OCIRef *)0; i_residence elem; i_residence *elemptr = (i_residence *)0; i_manager *sub_obj = (i_manager *)0; ub4 subSize = 0; ub4 sizeUB4 = sizeof (ub4); OCIType *mtype = (OCIType *)0; text *name = (text*)"JENNY"; ub4 name_len=(ub4)strlen( (char * ) name); ub4 ssn = 808; /* Data for ssn */ ub4 addr_hno = 800; /*Data for hno of addr */ text *addr_street = (text *)"Laurel Road"; /*Data for street of addr */ ub4 addr_streetLen = (ub4)strlen( (char *)addr_street); ub4 altadrs_hno = 800; /*data for hno of altadrs */ text *altadrs_street = (text *)"Shoreline Street"; /*Data for street of altadrs */ ub4 altadrs_streetLen = (ub4)strlen( (char *)altadrs_street); ub4 empno = 8888; /* data for empno */ sb4 index1 = 0; /* Index for the starting point of the scan */ sb4 index2 = 0; /* Index of the next existing element */ boolean eoc = TRUE; /* For getting the status for the availability of the next index */ ub4 count = 0; /* Loop counter */ OCIHandleAlloc (envhp, (dvoid **)&stmthp, OCI_HTYPE_STMT, (size_t)0, (dvoid **)0); if ((status = OCIStmtPrepare (stmthp, errhp, (text *)updateSql, (ub4)strlen((char *)updateSql),OCI_NTV_SYNTAX, OCI_DEFAULT)) != OCI_SUCCESS) { printf ("OCIStmtPrepare - Fail\n"); } if (( status = OCIObjectNew(envhp, errhp, svchp, OCI_TYPECODE_REF, (OCIType *)0, (dvoid *)0, OCI_DURATION_DEFAULT, FALSE, (dvoid **) &sub_ref)) != OCI_SUCCESS) { printf ("OCIObjectNew - Failure\n"); } if ((status = OCIDefineByPos(stmthp, &defhp, errhp, (ub4) 1, (dvoid *) 0, (sb4) 0, SQLT_REF, (dvoid *) 0, (ub2 *)0, (ub2 *)0, (ub4) OCI_DEFAULT)) != OCI_SUCCESS) { printf ("OCIDefineByPos - Failure \n"); } if ((status = OCIDefineObject(defhp, errhp, (OCIType *)0, (dvoid **)&sub_ref, (ub4 *)&subSize, (dvoid **) 0, (ub4 *) 0)) != OCI_SUCCESS) { printf ("OCIDefineObject - Failure \n"); } printf ("\nExecuting the statement:%s\n", updateSql); if (OCIStmtExecute (svchp, stmthp, errhp, (ub4)1, (ub4)0, (OCISnapshot *)0, (OCISnapshot *)0, OCI_COMMIT_ON_SUCCESS ) != OCI_SUCCESS) { printf("OCIStmtExecute - Failure \n"); } else { printf("OCIStmtExecute - Success\n"); if ((status = OCIObjectPin(envhp, errhp, sub_ref, (OCIComplexObject *)0, OCI_PIN_ANY, OCI_DURATION_SESSION, OCI_LOCK_NONE, (dvoid **) &sub_obj)) != OCI_SUCCESS) { printf("OCIObjectPin - Failure \n"); } else { printf ("\nDisplaying the original data from the employee table \n"); display (sub_obj); printf ("\nModifying the data present in the object\n"); if ((status = OCIObjectMarkUpdate (envhp, errhp, (dvoid *)sub_obj)) != OCI_SUCCESS) { printf ("OCIObjectMarkUpdate - Fail\n"); } else { printf ("OCIObjectMarkUpdate - Success\n"); } OCINumberFromInt (errhp, (dvoid *)&ssn, sizeof(ssn), OCI_NUMBER_UNSIGNED, &(sub_obj->_super.ssn)); OCINumberFromInt (errhp, (dvoid *)&empno, sizeof(empno), OCI_NUMBER_UNSIGNED, &(sub_obj->empno)); OCINumberFromInt (errhp, (dvoid *)&addr_hno, sizeof(addr_hno), OCI_NUMBER_UNSIGNED, &(sub_obj->_super.addr.hno)); OCIStringAssignText (envhp, errhp, (text *)name, (ub2)name_len, &(sub_obj->_super.name)); OCIStringAssignText (envhp, errhp, (text *)addr_street, (ub2)addr_streetLen, &(sub_obj->_super.addr.street)); OCITableFirst(envhp, errhp, (CONST OCITable*)sub_obj->_super.altadrs, &index1); OCICollGetElem(envhp, errhp, (OCIColl *)sub_obj->_super.altadrs, index1, (boolean *)&eoc, (dvoid **)&elemptr, (dvoid **)0); OCINumberFromInt (errhp, (dvoid *)&altadrs_hno, sizeof(altadrs_hno), OCI_NUMBER_UNSIGNED, &(elemptr->hno)); OCIStringAssignText (envhp, errhp, (text *)altadrs_street, (ub2)altadrs_streetLen, &(elemptr->street)); for (count = 0; count < NUMREC-1; ++count) { altadrs_hno += count; OCITableNext(envhp, errhp, index1, (CONST OCITable*) sub_obj->_super.altadrs, &index2, &eoc); OCICollGetElem(envhp, errhp, (OCIColl *)sub_obj->_super.altadrs, index2, (boolean *)&eoc, (dvoid **)&elemptr, (dvoid **)0); OCINumberFromInt (errhp, (dvoid *)&altadrs_hno, sizeof(altadrs_hno), OCI_NUMBER_UNSIGNED, &(elemptr->hno)); OCIStringAssignText (envhp, errhp, (text *)altadrs_street, (ub2)altadrs_streetLen, &(elemptr->street)); index1 = index2; } index1 = 0; index2 = 0; OCITableFirst(envhp, errhp, (CONST OCITable*)sub_obj->workadd, &index1); OCICollAssignElem (envhp, errhp, index1, (dvoid *)workadd[count], (dvoid *)0, (OCIColl *)sub_obj->workadd); for (count = 0; count < NUMREC; ++count) { OCITableNext(envhp, errhp, index1,(CONST OCITable*) sub_obj->workadd, &index2, &eoc); OCICollAssignElem (envhp, errhp, index1, (dvoid *)workadd[count], (dvoid *)0, (OCIColl *)sub_obj->workadd); index1 = index2; } if ((status = OCIObjectFlush(envhp, errhp, sub_obj)) != OCI_SUCCESS) { printf ("OCIObjectFlush - Fail\n"); } else { printf ("OCIObjectFlush - Success\n"); } printf ("Refreshing the object\n"); if ((status = OCIObjectRefresh(envhp, errhp, (dvoid *)sub_obj)) != OCI_SUCCESS) { printf ("OCIObjectRefresh - Fail\n"); } else { printf ("OCIObjectRefresh - Success\n"); } printf ("\nDisplaying the data in the employee table after the refresh\n"); display (sub_obj); printf ("\nModifying the data present in the object once again\n"); ssn = 606; /* Data for ssn */ addr_hno = 200; /*Data for hno of addr */ addr_street = (text *)"Main Street"; /*Data for street of addr */ addr_streetLen = (ub4)strlen( (char *)addr_street); altadrs_hno = 600; /*data for hno of altadrs */ altadrs_street = (text *)"Shell Blvd";/*Data for street of altadrs*/ altadrs_streetLen = (ub4)strlen( (char *)altadrs_street); empno = 6666; /* data for empno */ if ((status = OCIObjectMarkUpdate (envhp, errhp, (dvoid *)sub_obj)) != OCI_SUCCESS) { printf ("OCIObjectMarkUpdate - Fail\n"); } else { printf ("OCIObjectMarkUpdate - Success\n"); } index1 = 0; index2 = 0; OCINumberFromInt (errhp, (dvoid *)&ssn, sizeof(ssn), OCI_NUMBER_UNSIGNED, &(sub_obj->_super.ssn)); OCINumberFromInt (errhp, (dvoid *)&empno, sizeof(empno), OCI_NUMBER_UNSIGNED, &(sub_obj->empno)); OCINumberFromInt (errhp, (dvoid *)&addr_hno, sizeof(addr_hno), OCI_NUMBER_UNSIGNED, &(sub_obj->_super.addr.hno)); OCIStringAssignText (envhp, errhp, (text *)addr_street, (ub2)addr_streetLen, &(sub_obj->_super.addr.street)); OCITableFirst(envhp, errhp,(CONST OCITable*)sub_obj->_super.altadrs, &index1); OCICollGetElem(envhp, errhp, (OCIColl *)sub_obj->_super.altadrs, index1, (boolean *)&eoc, (dvoid **)&elemptr, (dvoid **)0); OCINumberFromInt (errhp, (dvoid *)&altadrs_hno, sizeof(altadrs_hno), OCI_NUMBER_UNSIGNED, &(elemptr->hno)); OCIStringAssignText (envhp, errhp, (text *)altadrs_street, (ub2)altadrs_streetLen, &(elemptr->street)); for (count = 0; count < NUMREC-1; ++count) { altadrs_hno += count; OCITableNext(envhp, errhp, index1,(CONST OCITable*) sub_obj->_super.altadrs, &index2, &eoc); OCICollGetElem(envhp, errhp, (OCIColl *)sub_obj->_super.altadrs, index2, (boolean *)&eoc, (dvoid **)&elemptr, (dvoid **)0); OCINumberFromInt (errhp, (dvoid *)&altadrs_hno, sizeof(altadrs_hno), OCI_NUMBER_UNSIGNED, &(elemptr->hno)); OCIStringAssignText (envhp, errhp, (text *)altadrs_street, (ub2)altadrs_streetLen, &(elemptr->street)); index1 = index2; } index1 = 0; index2 = 0; OCITableFirst(envhp, errhp, (CONST OCITable*)sub_obj->workadd, &index1); OCICollAssignElem (envhp, errhp, index1, (dvoid *)workadd[count], (dvoid *)0, (OCIColl *)sub_obj->workadd); for (count = 0; count < NUMREC; ++count) { OCITableNext(envhp, errhp, index1, (CONST OCITable*)sub_obj->workadd, &index2, &eoc); OCICollAssignElem (envhp, errhp, index1, (dvoid *)workadd[count], (dvoid *)0, (OCIColl *)sub_obj->workadd); index1 = index2; } if ((status = OCICacheFlush (envhp, errhp, svchp, NULL, NULL, &sub_ref)) != OCI_SUCCESS) { printf ("OCICacheFlush - Fail\n"); } else { printf ("OCICacheFlush - Success\n"); } } if ((status = OCITransCommit (svchp, errhp, OCI_DEFAULT)) != OCI_SUCCESS) { printf ("OCITransCommit - Fail\n"); } else printf ("OCITransCommit - Success\n"); } OCIHandleFree((dvoid *) stmthp, OCI_HTYPE_STMT); } /* end of modifyFunction() */
/* Function to insert an instance of the subtype into a supertype table */ static void insertFunction() { OCIBind *bindhp = (OCIBind *)0; i_residence elem; i_residence *elemptr = &elem; i_manager *sub_obj = (i_manager *)0; i_manager_ind ind; OCIType *i_manager_tdo = (OCIType *)0; ub4 subSize = 0; ub4 sizeUB4 = sizeof (ub4); sb4 size = 0; text *name = (text*)"JENNY"; ub4 name_len =(ub4)( strlen( (char * ) name)); ub4 ssn = 303; /* Data for ssn */ ub4 addr_hno = 33; /*Data for hno of addr */ text *addr_street = (text *)"T33"; /*Data for street of addr */ ub4 addr_streetLen = (ub4)(strlen( (char *)addr_street)); ub4 altadrs_hno = 333; /*data for hno of altadrs */ text *altadrs_street = (text *)"T333"; /*Data for street of altadrs */ ub4 altadrs_streetLen = (ub4)(strlen( (char *)altadrs_street)); ub4 empno = 3333; /* data for empno */ sb4 index1 = 0; /* Index for the starting point of the scan */ sb4 index2 = 0; /* Index of the next existing element */ boolean eoc = TRUE; /* For getting the status for the availability of the next index */ ub4 count = 0; /* Loop counter */ memset(&ind, 0, sizeof(ind)); memset(elemptr, 0, sizeof(elem)); OCIHandleAlloc (envhp, (dvoid **)&stmthp, OCI_HTYPE_STMT, (size_t)0, (dvoid **)0); if ((status = OCIStmtPrepare (stmthp, errhp, (text *)insertSql, (ub4)strlen((char *)insertSql),OCI_NTV_SYNTAX, OCI_DEFAULT)) != OCI_SUCCESS) { printf ("OCIStmtPrepare - Fail\n"); } if ((status = OCIBindByName(stmthp, &bindhp, errhp, (text *)":v1", (sb4) -1, (dvoid *)0, (sb4)0, SQLT_NTY, (dvoid *)0, (ub2 *)0, (ub2 *)0, (ub4)0, (ub4 *)0, OCI_DEFAULT)) != OCI_SUCCESS) { printf ("OCIBindByName - Failure \n"); } if ((status = OCITypeByName (envhp, errhp, svchp, (CONST text *)0, (ub4)0, (CONST text *)"I_MANAGER", (ub4)strlen ((char *)"I_MANAGER"), (CONST text *)0, (ub4)0, OCI_DURATION_SESSION, OCI_TYPEGET_HEADER, &i_manager_tdo)) != OCI_SUCCESS) { printf ("OCITypeByName - Fail\n"); } if (( status = OCIObjectNew(envhp, errhp, svchp, OCI_TYPECODE_OBJECT, (OCIType *)i_manager_tdo, (dvoid *)0, OCI_DURATION_SESSION, TRUE, (dvoid **) &sub_obj)) != OCI_SUCCESS) { printf ("OCIObjectNew - Failure\n"); } OCINumberFromInt (errhp, (dvoid *)&ssn, sizeof(ssn), OCI_NUMBER_UNSIGNED, &(sub_obj->_super.ssn)); OCINumberFromInt (errhp, (dvoid *)&empno, sizeof(empno), OCI_NUMBER_UNSIGNED, &(sub_obj->empno)); OCINumberFromInt (errhp, (dvoid *)&addr_hno, sizeof(addr_hno),OCI_NUMBER_UNSIGNED, &(sub_obj->_super.addr.hno)); OCIStringAssignText (envhp, errhp, (text *)name, (ub2)name_len, &(sub_obj->_super.name)); OCIStringAssignText (envhp, errhp, (text *)addr_street, (ub2)addr_streetLen, &(sub_obj->_super.addr.street)); for (count = 0; count < NUMREC; ++count) { OCIStringAssignText (envhp, errhp, (text *)altadrs_street, (ub2)altadrs_streetLen, &(elemptr->street)); OCINumberFromInt (errhp, (dvoid *)&altadrs_hno, sizeof(altadrs_hno), OCI_NUMBER_UNSIGNED, &(elemptr->hno)); if (( status = OCICollAppend (envhp, errhp, (dvoid *)elemptr, (dvoid *)&ind, (OCIColl *)sub_obj->_super.altadrs)) != OCI_SUCCESS) { printf ("OCICollAppend - Fail\n"); } altadrs_hno ++; } for (count = 0; count < NUMREC; ++count) { if (( status = OCICollAppend (envhp, errhp, (dvoid *)workadd[count], (dvoid *)&ind, (OCIColl *)sub_obj->workadd)) != OCI_SUCCESS) { printf ("OCICollAppend - Fail\n"); } } OCITableSize(envhp, errhp,(CONST OCITable*) (sub_obj->_super.altadrs), &size); OCITableSize(envhp, errhp,(CONST OCITable*) (sub_obj->workadd), &size); if (OCIBindObject(bindhp, errhp, i_manager_tdo, (dvoid **) &sub_obj, (ub4 *)0, (dvoid **)&ind , (ub4 *) 0) != OCI_SUCCESS) { printf("OCIBindObject - Failure \n"); } printf ("\nExecuting the statement:%s\n", insertSql); if (OCIStmtExecute (svchp, stmthp, errhp, (ub4)1, (ub4)0, (OCISnapshot *)0, (OCISnapshot *)0, OCI_COMMIT_ON_SUCCESS ) != OCI_SUCCESS) { printf("OCIStmtExecute - Failure \n"); } else printf("OCIStmtExecute - Success\n"); OCIHandleFree((dvoid *) stmthp, OCI_HTYPE_STMT); }/* End on insertFunction() */