iReturn = OCIExtProcGetEnv(this->pContext, &pEnvH, &pServiceH, &pErrorH);
if (iReturn == OCI_SUCCESS || iReturn == OCI_SUCCESS_WITH_INFO) {
/* set up return code */
stReturn = (OCINumber *)OCIExtProcAllocCallMemory(pContext, sizeof(OCINumber));
if (ProcessOCI_RC(pContext, pErrorH, OCINumberFromInt(pErrorH, (dvoid *)&iReturn, sizeof(iReturn), OCI_NUMBER_SIGNED, stReturn)))
return(stReturn);
/* allocate stmt handle */
if (ProcessOCI_RC(pContext, pErrorH, OCIHandleAlloc((dvoid *)pEnvH, (dvoid **)&pStmtH, (ub4)OCI_HTYPE_STMT, (size_t)0, (dvoid **)0)))
return(stReturn);
/* prepare the statement SELECT feature FROM OBJECTS_TEMP WHERE obj_id = :obj_id FOR UPDATE */
strcpy(cSQLStmt, SQL_SELECT_FEATURE_FOR_UPDATE);
if (ProcessOCI_RC(pContext, pErrorH, OCIStmtPrepare(pStmtH, pErrorH, (text *) cSQLStmt, (ub4)strlen(cSQLStmt), (ub4) OCI_NTV_SYNTAX, (ub4) (OCI_DEFAULT))))
return(stReturn);
/* Set up bind for obj_id */
if (ProcessOCI_RC(pContext, pErrorH, OCIBindByPos(pStmtH, &pBindH, pErrorH, (ub4)1, (dvoid *)this->iObj_ID, (sb4)(sizeof(this->iObj_ID)), (ub2)SQLT_INT, (dvoid *)0, (ub2 *)0, (ub2 *)0, (ub4)0, (ub4 *)0, (ub4)OCI_DEFAULT)))
return(stReturn);
/* allocate blob locator */
if (ProcessOCI_RC(pContext, pErrorH, OCIDescriptorAlloc((dvoid *) pEnvH, (dvoid **) &pBlob, (ub4) OCI_DTYPE_LOB, (size_t) 0, (dvoid **) 0)))
return(stReturn);
/* Set up define for blob locator */
if (ProcessOCI_RC(pContext, pErrorH, OCIDefineByPos(pStmtH, &pDefineH, pErrorH, (ub4)1, (dvoid *)&pBlob, 0, (ub2)SQLT_BLOB, (dvoid *)0, (ub2 *)0, (ub2 *)0, (ub4)OCI_DEFAULT)))
return(stReturn);
/* execute statement */
if (ProcessOCI_RC(pContext, pErrorH, OCIStmtExecute(pServiceH, pStmtH, pErrorH, (ub4)0, (ub4)0, 0, 0, (ub4)OCI_DEFAULT)))
return(stReturn);
}