/* ODCIIndexClose function */ OCINumber *qxiqtbspc( OCIExtProcContext *ctx, qxiqtim *self, qxiqtin *self_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 retval = (int) ODCI_SUCCESS; OCINumber *rval = (OCINumber *)0; ub1 *key; /* key to retrieve context */ ub4 keylen; /* length of key */ 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 using 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); /* Free handles and memory */ if (qxiqtce(ctx, errhp, OCIHandleFree((dvoid *)icx->stmthp, (ub4)OCI_HTYPE_STMT))) return(rval); if (qxiqtce(ctx, errhp, OCIMemoryFree((dvoid *)usrhp, errhp, (dvoid *)icx))) return(rval); return(rval); }
int GetHandles(OCIExtProcContext* extProcCtx, Handles_t* handles) { /* store the ext-proc context in the handles struct */ handles->extProcCtx=extProcCtx; /* Get OCI handles */ if (checkerr(handles, OCIExtProcGetEnv(extProcCtx, &handles->envhp, &handles->svchp, &handles->errhp))) return -1; /* get the user handle */ if (checkerr(handles, OCIAttrGet((dvoid*)handles->svchp, (ub4)OCI_HTYPE_SVCCTX, (dvoid*)&handles->usrhp, (ub4*)0, (ub4)OCI_ATTR_SESSION, handles->errhp))) return -1; return 0; }
/* 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); }
/* ODCIIndexInsert function */ OCINumber *qxiqtbspi( OCIExtProcContext *ctx, ODCIIndexInfo *ix, ODCIIndexInfo_ind *ix_ind, char *rid, short rid_ind, char *newval, short newval_ind, ODCIEnv *env, ODCIEnv_ind *env_ind) { OCIEnv *envhp = (OCIEnv *) 0; /* env. handle */ OCISvcCtx *svchp = (OCISvcCtx *) 0; /* service handle */ OCIError *errhp = (OCIError *) 0; /* error handle */ OCIStmt *stmthp = (OCIStmt *) 0; /* statement handle */ OCIBind *bndp = (OCIBind *) 0; /* bind handle */ int retval = (int)ODCI_SUCCESS; /* return from this function */ OCINumber *rval = (OCINumber *)0; char insstmt[2000]; /* sql insert statement */ ODCIColInfo *colinfo; /* column info */ ODCIColInfo_ind *colinfo_ind; boolean exists = TRUE; int partiden; /* table partition iden */ /* allocate memory for OCINumber first */ rval = (OCINumber *)OCIExtProcAllocCallMemory(ctx, sizeof(OCINumber)); /* Get oci handles */ if (qxiqtce(ctx, errhp, OCIExtProcGetEnv(ctx, &envhp, &svchp, &errhp))) return(rval); /* set up return code */ if (qxiqtce(ctx, errhp, OCINumberFromInt(errhp, (dvoid *)&retval, sizeof(retval), OCI_NUMBER_SIGNED, rval))) return(rval); /****************************** * Construct insert Statement * ******************************/ if ( ix_ind->IndexPartitionIden == OCI_IND_NULL ) (void)sprintf(insstmt, "INSERT into %s.%s_sbtree values (:newval, :mrid)", OCIStringPtr(envhp, ix->IndexSchema), OCIStringPtr(envhp, ix->IndexName)); else { if (qxiqtce(ctx, errhp, OCICollGetElem(envhp, errhp, (OCIColl *)ix->IndexCols, (sb4)0, &exists, (void **) &colinfo, (void **) &colinfo_ind))) return(rval); (void)sprintf(insstmt, "INSERT into %s.%s_sbtree partition (DATAOBJ_TO_PARTITION(%s, :partiden)) values (:newval, :mrid)", OCIStringPtr(envhp, ix->IndexSchema), OCIStringPtr(envhp, ix->IndexName), OCIStringPtr(envhp, colinfo->TableName)); } /**************************************** * Parse and Execute Create Statement * ****************************************/ /* allocate stmt handle */ if (qxiqtce(ctx, errhp, OCIHandleAlloc((dvoid *)envhp, (dvoid **)&stmthp, (ub4)OCI_HTYPE_STMT, (size_t)0, (dvoid **)0))) return(rval); /* prepare the statement */ if (qxiqtce(ctx, errhp, OCIStmtPrepare(stmthp, errhp, (text *)insstmt, (ub4)strlen(insstmt), OCI_NTV_SYNTAX, OCI_DEFAULT))) return(rval); if (ix_ind->IndexPartitionIden != OCI_IND_NULL) { /* Convert partiden to integer from OCINumber */ if (qxiqtce(ctx, errhp, OCINumberToInt(errhp, &(colinfo->TablePartitionIden), sizeof(partiden), OCI_NUMBER_SIGNED, ( void *)&partiden))) return(rval); /* Set up bind for partiden */ if (qxiqtce(ctx, errhp, OCIBindByName(stmthp, &bndp, errhp, (text *)":partiden", sizeof(":partiden")-1, (dvoid *)&partiden, (sb4)(sizeof(partiden)), (ub2)SQLT_INT, (dvoid *)0, (ub2 *)0, (ub2 *)0, (ub4)0, (ub4 *)0, (ub4)OCI_DEFAULT))) return(rval); } /* Set up bind for newval */ if (qxiqtce(ctx, errhp, OCIBindByName(stmthp, &bndp, errhp, (text *)":newval", sizeof(":newval")-1, (dvoid *)newval, (sb4)(strlen(newval)+1), (ub2)SQLT_STR, (dvoid *)0, (ub2 *)0, (ub2 *)0, (ub4)0, (ub4 *)0, (ub4)OCI_DEFAULT))) return(rval); /* Set up bind for rid */ if (qxiqtce(ctx, errhp, OCIBindByName(stmthp, &bndp, errhp, (text *)":mrid", sizeof(":mrid")-1, (dvoid *)rid, (sb4)(strlen(rid)+1), (ub2)SQLT_STR, (dvoid *)0, (ub2 *)0, (ub2 *)0, (ub4)0, (ub4 *)0, (ub4)OCI_DEFAULT))) return(rval); /* Execute statement */ if (qxiqtce(ctx, errhp, OCIStmtExecute(svchp, stmthp, errhp, (ub4)1, (ub4)0, (OCISnapshot *)NULL, (OCISnapshot *)NULL, (ub4)OCI_DEFAULT))) return(rval); /* free stmt handle */ if (qxiqtce(ctx, errhp, OCIHandleFree((dvoid *)stmthp, (ub4)OCI_HTYPE_STMT))) return(rval); return(rval); }
/* ODCIIndexStart function */ OCINumber *qxiqtbsps( OCIExtProcContext *ctx, qxiqtim *sctx, qxiqtin *sctx_ind, ODCIIndexInfo *ix, ODCIIndexInfo_ind *ix_ind, ODCIPredInfo *pr, ODCIPredInfo_ind *pr_ind, ODCIQueryInfo *qy, ODCIQueryInfo_ind *qy_ind, OCINumber *strt, short strt_ind, OCINumber *stop, short stop_ind, char *cmpval, short cmpval_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 strtval; /* start bound */ int stopval; /* stop bound */ int errnum = 29400; /* choose some oracle error number */ char errmsg[512]; /* error message buffer */ size_t errmsglen; /* Length of error message */ char relop[3]; /* relational operator used in sql stmt */ char selstmt[2000]; /* sql select statement */ int retval = (int)ODCI_SUCCESS; /* return from this function */ OCINumber *rval = (OCINumber *)0; ub4 key; /* key value set in "sctx" */ ub1 *rkey; /* key to retrieve context */ ub4 rkeylen; /* length of key */ ODCIColInfo *colinfo; /* column info */ ODCIColInfo_ind *colinfo_ind; boolean exists = TRUE; int partiden; /* table partition iden */ /* 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); /**********************************************/ /* Allocate memory to hold index scan context */ /**********************************************/ if (sctx_ind ->atomic_qxiqtin == OCI_IND_NULL || sctx_ind ->scind_qxiqtin == OCI_IND_NULL) { if (qxiqtce(ctx, errhp, OCIMemoryAlloc((dvoid *)usrhp, errhp, (dvoid **)&icx, OCI_DURATION_STATEMENT, (ub4)(sizeof(qxiqtcx)), OCI_MEMORY_CLEARED))) return(rval); icx->stmthp = (OCIStmt *)0; icx->defnp = (OCIDefine *)0; icx->bndp = (OCIBind *)0; } else { /*************************/ /* Retrieve scan context */ /*************************/ rkey = OCIRawPtr(envhp, sctx->sctx_qxiqtim); rkeylen = OCIRawSize(envhp, sctx->sctx_qxiqtim); if (qxiqtce(ctx, errhp, OCIContextGetValue((dvoid *)usrhp, errhp, rkey, (ub1)rkeylen, (dvoid **)&(icx)))) return(rval); } /***********************************/ /* Check that the bounds are valid */ /***********************************/ /* convert from oci numbers to native numbers */ if (qxiqtce(ctx, errhp, OCINumberToInt(errhp, strt, sizeof(strtval), OCI_NUMBER_SIGNED, (dvoid *)&strtval))) return(rval); if (qxiqtce(ctx, errhp, OCINumberToInt(errhp, stop, sizeof(stopval), OCI_NUMBER_SIGNED, (dvoid *)&stopval))) return(rval); /* verify that strtval/stopval are both either 0 or 1 */ if (!(((strtval == 0) && (stopval == 0)) || ((strtval == 1) && (stopval == 1)))) { strcpy(errmsg, (char *)"Incorrect predicate for sbtree operator"); errmsglen = (size_t)strlen(errmsg); if (OCIExtProcRaiseExcpWithMsg(ctx, errnum, (text *)errmsg, errmsglen) != OCIEXTPROC_SUCCESS) /* Use cartridge error services here */; return(rval); } /*********************************************/ /* Generate the SQL statement to be executed */ /*********************************************/ if (memcmp((dvoid *)OCIStringPtr(envhp, pr->ObjectName), (dvoid *)"EQ", 2) == 0) if (strtval == 1) strcpy(relop, (char *)"="); else strcpy(relop, (char *)"!="); else if (memcmp((dvoid *)OCIStringPtr(envhp, pr->ObjectName), (dvoid *)"LT", 2) == 0) if (strtval == 1) strcpy(relop, (char *)"<"); else strcpy(relop, (char *)">="); else if (strtval == 1) strcpy(relop, (char *)">"); else strcpy(relop, (char *)"<="); if (ix_ind->IndexPartitionIden == OCI_IND_NULL) (void)sprintf(selstmt, "select f2 from %s.%s_sbtree where f1 %s :val", OCIStringPtr(envhp, ix->IndexSchema), OCIStringPtr(envhp, ix->IndexName), relop); else { if (qxiqtce(ctx, errhp, OCICollGetElem(envhp, errhp, (OCIColl *)ix->IndexCols, (sb4)0, &exists, (void **) &colinfo, (void **) &colinfo_ind))) return(rval); (void)sprintf(selstmt, "select f2 from %s.%s_sbtree partition (DATAOBJ_TO_PARTITION(%s, :partiden)) where f1 %s :val", OCIStringPtr(envhp, ix->IndexSchema), OCIStringPtr(envhp, ix->IndexName), OCIStringPtr(envhp, colinfo->TableName), relop); } /***********************************/ /* Parse, bind, define and execute */ /***********************************/ if (sctx_ind ->atomic_qxiqtin == OCI_IND_NULL || sctx_ind ->scind_qxiqtin == OCI_IND_NULL) { /* allocate stmt handle */ if (qxiqtce(ctx, errhp, OCIHandleAlloc((dvoid *)envhp, (dvoid **)&(icx->stmthp), (ub4)OCI_HTYPE_STMT, (size_t)0, (dvoid **)0))) return(rval); } /* prepare the statement */ if (qxiqtce(ctx, errhp, OCIStmtPrepare(icx->stmthp, errhp, (text *)selstmt, (ub4)strlen(selstmt), OCI_NTV_SYNTAX, OCI_DEFAULT))) return(rval); if (ix_ind->IndexPartitionIden != OCI_IND_NULL) { /* Convert partiden to integer from OCINumber */ if (qxiqtce(ctx, errhp, OCINumberToInt(errhp, &(colinfo->TablePartitionIden), sizeof(partiden), OCI_NUMBER_SIGNED, ( void *)&partiden))) return(rval); /* Set up bind for partiden */ if (qxiqtce(ctx, errhp, OCIBindByName(icx->stmthp, &(icx->bndp), errhp, (text *)":partiden", sizeof(":partiden")-1, (dvoid *)&partiden, (sb4)(sizeof(partiden)), (ub2)SQLT_INT, (dvoid *)0, (ub2 *)0, (ub2 *)0, (ub4)0, (ub4 *)0, (ub4)OCI_DEFAULT))) return(rval); } /* Set up bind for compare value */ if (qxiqtce(ctx, errhp, OCIBindByName(icx->stmthp, &(icx->bndp),errhp, (text *)":val", sizeof(":val")-1, (dvoid *)cmpval, (sb4)(strlen(cmpval)+1), (ub2)SQLT_STR, (dvoid *)0, (ub2 *)0, (ub2 *)0, (ub4)0, (ub4 *)0, (ub4)OCI_DEFAULT))) return(rval); /* Set up define */ if (qxiqtce(ctx, errhp, OCIDefineByPos(icx->stmthp, &(icx->defnp), errhp, (ub4)1, (dvoid *)(icx->ridp), (sb4) sizeof(icx->ridp), (ub2)SQLT_STR, (dvoid *)0, (ub2 *)0, (ub2 *)0, (ub4)OCI_DEFAULT))) return(rval); /* execute */ if (qxiqtce(ctx, errhp, OCIStmtExecute(svchp, icx->stmthp, errhp, (ub4)0, (ub4)0, (OCISnapshot *)NULL, (OCISnapshot *)NULL, (ub4)OCI_DEFAULT))) return(rval); /************************************/ /* Set index context to be returned */ /************************************/ if (sctx_ind ->atomic_qxiqtin == OCI_IND_NULL || sctx_ind ->scind_qxiqtin == OCI_IND_NULL) { /* generate a key */ if (qxiqtce(ctx, errhp, OCIContextGenerateKey((dvoid *)usrhp, errhp, &key))) return(rval); /* set the memory address of the struct to be saved in the context */ if (qxiqtce(ctx, errhp, OCIContextSetValue((dvoid *)usrhp, errhp, OCI_DURATION_STATEMENT, (ub1 *)&key, (ub1)sizeof(key), (dvoid *)icx))) return(rval); /* set the key as the member of "sctx" */ if (qxiqtce(ctx, errhp, OCIRawAssignBytes(envhp, errhp, (ub1 *)&key, (ub4)sizeof(key), &(sctx->sctx_qxiqtim)))) return(rval); sctx_ind->atomic_qxiqtin = OCI_IND_NOTNULL; sctx_ind->scind_qxiqtin = OCI_IND_NOTNULL; return(rval); } return(rval); }
PLRUBY_EXPORT OCIAnyData * extproc_ruby(OCIExtProcContext *with_context, short *ret_ind, int rettype, const char *obj, short obj_ind, const char *meth, short meth_ind, const char *argtype, int argtype_len, OCIString *v1, short v1_ind, OCIString *v2, short v2_ind, OCIString *v3, short v3_ind, OCIString *v4, short v4_ind, OCIString *v5, short v5_ind, OCIString *v6, short v6_ind, OCIString *v7, short v7_ind, OCIString *v8, short v8_ind, OCIString *v9, short v9_ind, OCIString *v10, short v10_ind, OCINumber *n1, short n1_ind, OCINumber *n2, short n2_ind, OCINumber *n3, short n3_ind, OCINumber *n4, short n4_ind, OCINumber *n5, short n5_ind, OCINumber *n6, short n6_ind, OCINumber *n7, short n7_ind, OCINumber *n8, short n8_ind, OCINumber *n9, short n9_ind, OCINumber *n10, short n10_ind, double d1, short d1_ind, double d2, short d2_ind, double d3, short d3_ind, double d4, short d4_ind, double d5, short d5_ind, double d6, short d6_ind, double d7, short d7_ind, double d8, short d8_ind, double d9, short d9_ind, double d10, short d10_ind) { plruby_context_t ctx; OCIAnyData *sdata = NULL; static int ruby_initialized = 0; OCIExtProcGetEnv(with_context, &ctx.envhp, &ctx.svchp, &ctx.errhp); ctx.obj = obj_ind ? NULL : obj; ctx.meth = meth_ind ? NULL : meth; ctx.rettype = rettype; ctx.argtype = argtype; ctx.args[0] = argtype_len >= 1 ? checkarg(argtype[0], v1, n1, &d1) : EMPTY; ctx.args[1] = argtype_len >= 2 ? checkarg(argtype[1], v2, n2, &d2) : EMPTY; ctx.args[2] = argtype_len >= 3 ? checkarg(argtype[2], v3, n3, &d3) : EMPTY; ctx.args[3] = argtype_len >= 4 ? checkarg(argtype[3], v4, n4, &d4) : EMPTY; ctx.args[4] = argtype_len >= 5 ? checkarg(argtype[4], v5, n5, &d5) : EMPTY; ctx.args[5] = argtype_len >= 6 ? checkarg(argtype[5], v6, n6, &d6) : EMPTY; ctx.args[6] = argtype_len >= 7 ? checkarg(argtype[6], v7, n7, &d7) : EMPTY; ctx.args[7] = argtype_len >= 8 ? checkarg(argtype[7], v8, n8, &d8) : EMPTY; ctx.args[8] = argtype_len >= 9 ? checkarg(argtype[8], v9, n9, &d9) : EMPTY; ctx.args[9] = argtype_len >= 10 ? checkarg(argtype[9], v10, n10, &d10) : EMPTY; if (!ruby_initialized) { ruby_init(); ruby_init_loadpath(); ruby_script("extproc_ruby"); ruby_initialized = 1; } { int state = 0; int plruby_initialized = 0; RUBY_INIT_STACK; if (!plruby_initialized) { rb_protect((VALUE(*)(VALUE))setup_plruby_oracle, (VALUE)&ctx, &state); if (state == 0) { plruby_initialized = 1; } } if (state == 0) { sdata = (OCIAnyData*)rb_protect((VALUE(*)(VALUE))call_ruby, (VALUE)&ctx, &state); } if (state) { int errnum = 20999; /* The last value of user-defined error number */ const char *errmsg = (const char *)rb_protect((VALUE(*)(VALUE))get_error_msg, (VALUE)&errnum, &state); if (state) { errmsg = "Failed to get an error in extproc_ruby"; } OCIExtProcRaiseExcpWithMsg(with_context, errnum, (OraText*)errmsg, 0); } } *ret_ind = (sdata != NULL) ? OCI_IND_NOTNULL : OCI_IND_NULL; return sdata; }