#define SAFE_STRING(s) ((s)?(s):"")
+
+/* dirty marcos to make sure we _never_ call oracle-functions recursivly
+ *
+ * i'm well aware that we should _never_ call exit directly - this core is for
+ * pure testing and commented out - as you can see;-)
+ * thies@thieso.net 20010723
+ */
+
+#define CALL_OCI(call) \
+{ \
+ if (OCI(in_call)) { \
+ php_error(E_WARNING, "OCI8 Recursive call!\n"); \
+ exit(-1); \
+ } else { \
+ OCI(in_call)=1; \
+ call; \
+ OCI(in_call)=0; \
+ } \
+}
+
+#define CALL_OCI_RETURN(retcode,call) \
+{ \
+ if (OCI(in_call)) { \
+ retcode=-1; \
+ php_error(E_WARNING, "OCI8 Recursive call!\n"); \
+ exit(-1); \
+ } else { \
+ OCI(in_call)=1; \
+ retcode=call; \
+ OCI(in_call)=0; \
+ } \
+}
+
#ifndef PHP_WIN32
#include "build-defs.h"
#endif
static void php_oci_init_globals(php_oci_globals *oci_globals_p TSRMLS_DC)
{
OCI(shutdown) = 0;
+ OCI(in_call) = 0;
OCI(user) = malloc(sizeof(HashTable));
zend_hash_init(OCI(user), 13, NULL, NULL, 1);
OCI(server) = malloc(sizeof(HashTable));
zend_hash_init(OCI(server), 13, NULL, NULL, 1);
- OCIEnvInit(&OCI(pEnv), OCI_DEFAULT, 0, NULL);
- OCIHandleAlloc(OCI(pEnv),
- (dvoid **)&OCI(pError),
- OCI_HTYPE_ERROR,
- 0,
- NULL);
+ CALL_OCI(OCIEnvInit(
+ &OCI(pEnv),
+ OCI_DEFAULT,
+ 0,
+ NULL));
+
+ CALL_OCI(OCIHandleAlloc(
+ OCI(pEnv),
+ (dvoid **)&OCI(pError),
+ OCI_HTYPE_ERROR,
+ 0,
+ NULL));
}
PHP_MINIT_FUNCTION(oci)
#endif
#if OCI_USE_EMALLOC
- OCIInitialize(PHP_OCI_INIT_MODE, NULL, ocimalloc, ocirealloc, ocifree);
+ OCIInitialize(PHP_OCI_INIT_MODE, NULL, ocimalloc, ocirealloc, ocifree);
#else
- OCIInitialize(PHP_OCI_INIT_MODE, NULL, NULL, NULL, NULL);
+ OCIInitialize(PHP_OCI_INIT_MODE, NULL, NULL, NULL, NULL);
#endif
#ifdef ZTS
*/
OCI(debug_mode) = 0; /* start "fresh" */
+/* OCI(in_call) = 0; i don't think we want this! */
oci_debug("php_rinit_oci");
free(OCI(user));
free(OCI(server));
- OCIHandleFree((dvoid *)OCI(pEnv), OCI_HTYPE_ENV);
+ CALL_OCI(OCIHandleFree(
+ (dvoid *)OCI(pEnv),
+ OCI_HTYPE_ENV));
oci_debug("END php_mshutdown_oci");
oci_debug("START _oci_stmt_list_dtor: id=%d last_query=\"%s\"",statement->id,SAFE_STRING(statement->last_query));
if (statement->pStmt) {
- OCIHandleFree(statement->pStmt, OCI_HTYPE_STMT);
+ CALL_OCI(OCIHandleFree(
+ statement->pStmt,
+ OCI_HTYPE_STMT));
+
statement->pStmt = 0;
}
if (statement->pError) {
- OCIHandleFree(statement->pError, OCI_HTYPE_ERROR);
+ CALL_OCI(OCIHandleFree(
+ statement->pError,
+ OCI_HTYPE_ERROR));
+
statement->pError = 0;
}
oci_debug("START _oci_conn_list_dtor: id=%d",connection->id);
if (connection->pServiceContext) {
- connection->error =
- OCITransRollback(connection->pServiceContext,
- connection->pError,
- (ub4)0);
+ CALL_OCI_RETURN(connection->error,OCITransRollback(
+ connection->pServiceContext,
+ connection->pError,
+ (ub4)0));
if (connection->error) {
oci_error(connection->pError, "failed to rollback outstanding transactions!", connection->error);
}
- OCIHandleFree((dvoid *) connection->pServiceContext, (ub4) OCI_HTYPE_SVCCTX);
+ CALL_OCI(OCIHandleFree(
+ (dvoid *) connection->pServiceContext,
+ (ub4) OCI_HTYPE_SVCCTX));
}
if (connection->session && connection->session->exclusive) {
}
if (connection->pError) {
- OCIHandleFree((dvoid *) connection->pError, (ub4) OCI_HTYPE_ERROR);
+ CALL_OCI(OCIHandleFree(
+ (dvoid *) connection->pError,
+ (ub4) OCI_HTYPE_ERROR));
}
oci_debug("END _oci_conn_list_dtor: id=%d",connection->id);
zend_list_delete(descr->conn->id);
- OCIDescriptorFree(descr->ocidescr, descr->type);
+ CALL_OCI(OCIDescriptorFree(
+ descr->ocidescr,
+ descr->type));
oci_debug("END _oci_descriptor_list_dtor: %d",descr->id);
case OCI_NO_DATA:
php_error(E_WARNING, "%s: OCI_NO_DATA", what);
break;
- case OCI_ERROR:
- OCIErrorGet(err_p, (ub4)1, NULL, &errcode, errbuf,
- (ub4)sizeof(errbuf), (ub4)OCI_HTYPE_ERROR);
- php_error(E_WARNING, "%s: %s", what, errbuf);
- break;
+ case OCI_ERROR: {
+ TSRMLS_FETCH();
+ CALL_OCI(OCIErrorGet(
+ err_p,
+ (ub4)1,
+ NULL,
+ &errcode,
+ errbuf,
+ (ub4)sizeof(errbuf),
+ (ub4)OCI_HTYPE_ERROR));
+
+ php_error(E_WARNING, "%s: %s", what, errbuf);
+ break;
+ }
case OCI_INVALID_HANDLE:
php_error(E_WARNING, "%s: OCI_INVALID_HANDLE", what);
break;
{
char version[256];
TSRMLS_FETCH();
+
+ CALL_OCI_RETURN(OCI(error), OCIServerVersion(
+ server->pServer,
+ OCI(pError),
+ (text*)version,
+ sizeof(version),
+ OCI_HTYPE_SERVER));
- OCI(error) =
- OCIServerVersion(server->pServer,
- OCI(pError),
- (text*)version,
- sizeof(version),
- OCI_HTYPE_SERVER);
if (OCI(error) == OCI_SUCCESS) {
return 1;
}
php_error(E_WARNING, "Unknown descriptor type %d.",descr->type);
return 0;
}
-
- OCI(error) =
- OCIDescriptorAlloc(OCI(pEnv),
- (dvoid*)&(descr->ocidescr),
- descr->type,
- (size_t) 0,
- (dvoid **) 0);
+
+ CALL_OCI_RETURN(OCI(error), OCIDescriptorAlloc(
+ OCI(pEnv),
+ (dvoid*)&(descr->ocidescr),
+ descr->type,
+ (size_t) 0,
+ (dvoid **) 0));
if (OCI(error)) {
ub4 error;
oci_setprefetch(oci_statement *statement,int size)
{
ub4 prefetch;
+ sword error;
+ TSRMLS_FETCH();
prefetch = size * 1024;
- statement->error =
- oci_error(statement->pError,
- "OCIAttrSet OCI_ATTR_PREFETCH_MEMORY",
- OCIAttrSet(statement->pStmt,
- OCI_HTYPE_STMT,
- &prefetch,
- 0,
- OCI_ATTR_PREFETCH_MEMORY,
- statement->pError));
+
+ CALL_OCI_RETURN(error, OCIAttrSet(
+ statement->pStmt,
+ OCI_HTYPE_STMT,
+ &prefetch,
+ 0,
+ OCI_ATTR_PREFETCH_MEMORY,
+ statement->pError));
+
+ statement->error = oci_error(statement->pError, "OCIAttrSet OCI_ATTR_PREFETCH_MEMORY", error);
+
if (statement->error) {
oci_handle_error(statement->conn, statement->error);
}
+
prefetch = size;
- statement->error =
- oci_error(statement->pError,
- "OCIAttrSet OCI_ATTR_PREFETCH_MEMORY",
- OCIAttrSet(statement->pStmt,
- OCI_HTYPE_STMT,
- &prefetch,
- 0,
- OCI_ATTR_PREFETCH_ROWS,
- statement->pError));
+ CALL_OCI_RETURN(error, OCIAttrSet(
+ statement->pStmt,
+ OCI_HTYPE_STMT,
+ &prefetch,
+ 0,
+ OCI_ATTR_PREFETCH_ROWS,
+ statement->pError));
+
+ statement->error = oci_error(statement->pError, "OCIAttrSet OCI_ATTR_PREFETCH_MEMORY", error);
if (statement->error) {
oci_handle_error(statement->conn, statement->error);
}
static oci_statement *oci_parse(oci_connection *connection, char *query, int len)
{
oci_statement *statement;
+ sword error;
TSRMLS_FETCH();
statement = ecalloc(1,sizeof(oci_statement));
- OCIHandleAlloc(OCI(pEnv),
- (dvoid **)&statement->pStmt,
- OCI_HTYPE_STMT,
- 0,
- NULL);
- OCIHandleAlloc(OCI(pEnv),
- (dvoid **)&statement->pError,
- OCI_HTYPE_ERROR,
- 0,
- NULL);
+ CALL_OCI(OCIHandleAlloc(
+ OCI(pEnv),
+ (dvoid **)&statement->pStmt,
+ OCI_HTYPE_STMT,
+ 0,
+ NULL));
+
+ CALL_OCI(OCIHandleAlloc(
+ OCI(pEnv),
+ (dvoid **)&statement->pError,
+ OCI_HTYPE_ERROR,
+ 0,
+ NULL));
if (len > 0) {
- connection->error =
- oci_error(connection->pError,
- "OCIParse",
- OCIStmtPrepare(statement->pStmt,
- connection->pError,
- (text*)query,
- len,
- OCI_NTV_SYNTAX,
- OCI_DEFAULT));
+ CALL_OCI_RETURN(error, OCIStmtPrepare(
+ statement->pStmt,
+ connection->pError,
+ (text*)query,
+ len,
+ OCI_NTV_SYNTAX,
+ OCI_DEFAULT));
+
+ connection->error = oci_error(connection->pError, "OCIParse", error);
if (connection->error) {
- OCIHandleFree(statement->pStmt, OCI_HTYPE_STMT);
- OCIHandleFree(statement->pError, OCI_HTYPE_ERROR);
+ CALL_OCI(OCIHandleFree(
+ statement->pStmt,
+ OCI_HTYPE_STMT));
+
+ CALL_OCI(OCIHandleFree(
+ statement->pError,
+ OCI_HTYPE_ERROR));
+
efree(statement);
oci_handle_error(connection, connection->error);
return 0;
int dtype;
dvoid *buf;
oci_descriptor *descr;
+ sword error;
TSRMLS_FETCH();
- statement->error =
- oci_error(statement->pError,
- "OCIAttrGet OCI_HTYPE_STMT/OCI_ATTR_STMT_TYPE",
- OCIAttrGet((dvoid *)statement->pStmt,
- OCI_HTYPE_STMT,
- (ub2 *)&stmttype,
- (ub4 *)0,
- OCI_ATTR_STMT_TYPE,
- statement->pError));
+ CALL_OCI_RETURN(error, OCIAttrGet(
+ (dvoid *)statement->pStmt,
+ OCI_HTYPE_STMT,
+ (ub2 *)&stmttype,
+ (ub4 *)0,
+ OCI_ATTR_STMT_TYPE,
+ statement->pError));
+ statement->error = oci_error(statement->pError, "OCIAttrGet OCI_HTYPE_STMT/OCI_ATTR_STMT_TYPE", error);
if (statement->error) {
oci_handle_error(statement->conn, statement->error);
return 0;
zend_hash_apply(statement->binds, (apply_func_t) _oci_bind_pre_exec TSRMLS_CC);
}
- statement->error =
- oci_error(statement->pError,
- "OCIStmtExecute",
- OCIStmtExecute(statement->conn->pServiceContext,
- statement->pStmt,
- statement->pError,
- iters,
- 0,
- NULL,
- NULL,
- mode));
+ CALL_OCI_RETURN(error, OCIStmtExecute(
+ statement->conn->pServiceContext,
+ statement->pStmt,
+ statement->pError,
+ iters,
+ 0,
+ NULL,
+ NULL,
+ mode));
+
+ statement->error = oci_error(statement->pError, "OCIStmtExecute", error);
if (statement->binds) {
zend_hash_apply(statement->binds, (apply_func_t) _oci_bind_post_exec TSRMLS_CC);
}
counter = 1;
- statement->error =
- oci_error(statement->pError,
- "OCIAttrGet OCI_HTYPE_STMT/OCI_ATTR_PARAM_COUNT",
- OCIAttrGet((dvoid *)statement->pStmt,
- OCI_HTYPE_STMT,
- (dvoid *)&colcount,
- (ub4 *)0,
- OCI_ATTR_PARAM_COUNT,
- statement->pError));
+ CALL_OCI_RETURN(error, OCIAttrGet(
+ (dvoid *)statement->pStmt,
+ OCI_HTYPE_STMT,
+ (dvoid *)&colcount,
+ (ub4 *)0,
+ OCI_ATTR_PARAM_COUNT,
+ statement->pError));
+
+ statement->error = oci_error(statement->pError, "OCIAttrGet OCI_HTYPE_STMT/OCI_ATTR_PARAM_COUNT", error);
if (statement->error) {
oci_handle_error(statement->conn, statement->error);
return 0; /* XXX we loose memory!!! */
outcol->statement = statement;
- statement->error =
- oci_error(statement->pError,
- "OCIParamGet OCI_HTYPE_STMT",
- OCIParamGet(
- (dvoid *)statement->pStmt,
- OCI_HTYPE_STMT,
- statement->pError,
- (dvoid**)¶m,
- counter));
+ CALL_OCI_RETURN(error, OCIParamGet(
+ (dvoid *)statement->pStmt,
+ OCI_HTYPE_STMT,
+ statement->pError,
+ (dvoid**)¶m,
+ counter));
+
+ statement->error = oci_error(statement->pError, "OCIParamGet OCI_HTYPE_STMT", error);
if (statement->error) {
oci_handle_error(statement->conn, statement->error);
return 0; /* XXX we loose memory!!! */
}
- statement->error =
- oci_error(statement->pError,
- "OCIAttrGet OCI_DTYPE_PARAM/OCI_ATTR_DATA_TYPE",
- OCIAttrGet((dvoid *)param,
- OCI_DTYPE_PARAM,
- (dvoid *)&outcol->data_type,
- (ub4 *)0,
- OCI_ATTR_DATA_TYPE,
- statement->pError));
+ CALL_OCI_RETURN(error, OCIAttrGet(
+ (dvoid *)param,
+ OCI_DTYPE_PARAM,
+ (dvoid *)&outcol->data_type,
+ (ub4 *)0,
+ OCI_ATTR_DATA_TYPE,
+ statement->pError));
+
+ statement->error = oci_error(statement->pError, "OCIAttrGet OCI_DTYPE_PARAM/OCI_ATTR_DATA_TYPE", error);
if (statement->error) {
oci_handle_error(statement->conn, statement->error);
return 0; /* XXX we loose memory!!! */
}
+ CALL_OCI_RETURN(error, OCIAttrGet(
+ (dvoid *)param,
+ OCI_DTYPE_PARAM,
+ (dvoid *)&outcol->data_size,
+ (dvoid *)0,
+ OCI_ATTR_DATA_SIZE,
+ statement->pError));
- statement->error =
- oci_error(statement->pError,
- "OCIAttrGet OCI_DTYPE_PARAM/OCI_ATTR_DATA_SIZE",
- OCIAttrGet((dvoid *)param,
- OCI_DTYPE_PARAM,
- (dvoid *)&outcol->data_size,
- (dvoid *)0,
- OCI_ATTR_DATA_SIZE,
- statement->pError));
+ statement->error = oci_error(statement->pError, "OCIAttrGet OCI_DTYPE_PARAM/OCI_ATTR_DATA_SIZE", error);
if (statement->error) {
oci_handle_error(statement->conn, statement->error);
return 0; /* XXX we loose memory!!! */
outcol->storage_size4 = outcol->data_size;
outcol->retlen = outcol->data_size;
-
- statement->error =
- oci_error(statement->pError,
- "OCIAttrGet OCI_DTYPE_PARAM/OCI_ATTR_SCALE",
- OCIAttrGet((dvoid *)param,
- OCI_DTYPE_PARAM,
- (dvoid *)&outcol->scale,
- (dvoid *)0,
- OCI_ATTR_SCALE,
- statement->pError));
+
+ CALL_OCI_RETURN(error, OCIAttrGet(
+ (dvoid *)param,
+ OCI_DTYPE_PARAM,
+ (dvoid *)&outcol->scale,
+ (dvoid *)0,
+ OCI_ATTR_SCALE,
+ statement->pError));
+
+ statement->error = oci_error(statement->pError, "OCIAttrGet OCI_DTYPE_PARAM/OCI_ATTR_SCALE", error);
if (statement->error) {
oci_handle_error(statement->conn, statement->error);
return 0; /* XXX we lose memory!!! */
}
- statement->error =
- oci_error(statement->pError,
- "OCIAttrGet OCI_DTYPE_PARAM/OCI_ATTR_PRECISION",
- OCIAttrGet((dvoid *)param,
- OCI_DTYPE_PARAM,
- (dvoid *)&outcol->precision,
- (dvoid *)0,
- OCI_ATTR_PRECISION,
- statement->pError));
+ CALL_OCI_RETURN(error, OCIAttrGet(
+ (dvoid *)param,
+ OCI_DTYPE_PARAM,
+ (dvoid *)&outcol->precision,
+ (dvoid *)0,
+ OCI_ATTR_PRECISION,
+ statement->pError));
+
+ statement->error = oci_error(statement->pError, "OCIAttrGet OCI_DTYPE_PARAM/OCI_ATTR_PRECISION", error);
if (statement->error) {
oci_handle_error(statement->conn, statement->error);
return 0; /* XXX we lose memory!!! */
}
-
- statement->error =
- oci_error(statement->pError,
- "OCIAttrGet OCI_DTYPE_PARAM/OCI_ATTR_NAME",
- OCIAttrGet((dvoid *)param,
- OCI_DTYPE_PARAM,
- (dvoid **)&colname, /* XXX this string is NOT zero terminated!!!! */
- (ub4 *)&outcol->name_len,
- (ub4)OCI_ATTR_NAME,
- statement->pError));
+
+ CALL_OCI_RETURN(error, OCIAttrGet(
+ (dvoid *)param,
+ OCI_DTYPE_PARAM,
+ (dvoid **)&colname, /* XXX this string is NOT zero terminated!!!! */
+ (ub4 *)&outcol->name_len,
+ (ub4)OCI_ATTR_NAME,
+ statement->pError));
+
+ statement->error = oci_error(statement->pError, "OCIAttrGet OCI_DTYPE_PARAM/OCI_ATTR_NAME", error);
if (statement->error) {
oci_handle_error(statement->conn, statement->error);
return 0; /* XXX we loose memory!!! */
}
if (dynamic == OCI_DYNAMIC_FETCH) {
- statement->error =
- oci_error(statement->pError,
- "OCIDefineByPos",
- OCIDefineByPos(statement->pStmt, /* IN/OUT handle to the requested SQL query */
- (OCIDefine **)&outcol->pDefine,/* IN/OUT pointer to a pointer to a define handle */
- statement->pError, /* IN/OUT An error handle */
- counter, /* IN position in the select list */
- (dvoid *)NULL, /* IN/OUT pointer to a buffer */
- outcol->storage_size4, /* IN The size of each valuep buffer in bytes */
- define_type, /* IN The data type */
- (dvoid *)&outcol->indicator, /* IN pointer to an indicator variable or arr */
- (ub2 *)NULL, /* IN/OUT Pointer to array of length of data fetched */
- (ub2 *)NULL, /* OUT Pointer to array of column-level return codes */
- OCI_DYNAMIC_FETCH)); /* IN mode (OCI_DEFAULT, OCI_DYNAMIC_FETCH) */
+ CALL_OCI_RETURN(error, OCIDefineByPos(
+ statement->pStmt, /* IN/OUT handle to the requested SQL query */
+ (OCIDefine **)&outcol->pDefine, /* IN/OUT pointer to a pointer to a define handle */
+ statement->pError, /* IN/OUT An error handle */
+ counter, /* IN position in the select list */
+ (dvoid *)NULL, /* IN/OUT pointer to a buffer */
+ outcol->storage_size4, /* IN The size of each valuep buffer in bytes */
+ define_type, /* IN The data type */
+ (dvoid *)&outcol->indicator, /* IN pointer to an indicator variable or arr */
+ (ub2 *)NULL, /* IN/OUT Pointer to array of length of data fetched */
+ (ub2 *)NULL, /* OUT Pointer to array of column-level return codes */
+ OCI_DYNAMIC_FETCH)); /* IN mode (OCI_DEFAULT, OCI_DYNAMIC_FETCH) */
+
+ statement->error = oci_error(statement->pError, "OCIDefineByPos", error);
} else {
- statement->error =
- oci_error(statement->pError,
- "OCIDefineByPos",
- OCIDefineByPos(statement->pStmt, /* IN/OUT handle to the requested SQL query */
- (OCIDefine **)&outcol->pDefine,/* IN/OUT pointer to a pointer to a define handle */
- statement->pError, /* IN/OUT An error handle */
- counter, /* IN position in the select list */
- (dvoid *)buf, /* IN/OUT pointer to a buffer */
- outcol->storage_size4, /* IN The size of each valuep buffer in bytes */
- define_type, /* IN The data type */
- (dvoid *)&outcol->indicator, /* IN pointer to an indicator variable or arr */
- (ub2 *)&outcol->retlen, /* IN/OUT Pointer to array of length of data fetched */
- (ub2 *)&outcol->retcode, /* OUT Pointer to array of column-level return codes */
- OCI_DEFAULT)); /* IN mode (OCI_DEFAULT, OCI_DYNAMIC_FETCH) */
+ CALL_OCI_RETURN(error, OCIDefineByPos(
+ statement->pStmt, /* IN/OUT handle to the requested SQL query */
+ (OCIDefine **)&outcol->pDefine, /* IN/OUT pointer to a pointer to a define handle */
+ statement->pError, /* IN/OUT An error handle */
+ counter, /* IN position in the select list */
+ (dvoid *)buf, /* IN/OUT pointer to a buffer */
+ outcol->storage_size4, /* IN The size of each valuep buffer in bytes */
+ define_type, /* IN The data type */
+ (dvoid *)&outcol->indicator, /* IN pointer to an indicator variable or arr */
+ (ub2 *)&outcol->retlen, /* IN/OUT Pointer to array of length of data fetched */
+ (ub2 *)&outcol->retcode, /* OUT Pointer to array of column-level return codes */
+ OCI_DEFAULT)); /* IN mode (OCI_DEFAULT, OCI_DYNAMIC_FETCH) */
+
+ statement->error = oci_error(statement->pError, "OCIDefineByPos", error);
}
if (statement->error) {
oci_handle_error(statement->conn, statement->error);
zend_hash_apply(statement->columns, (apply_func_t) _oci_column_pre_fetch TSRMLS_CC);
}
- statement->error =
- OCIStmtFetch(statement->pStmt,
- statement->pError, nrows,
- OCI_FETCH_NEXT,
- OCI_DEFAULT);
+ CALL_OCI_RETURN(statement->error, OCIStmtFetch(
+ statement->pStmt,
+ statement->pError,
+ nrows,
+ OCI_FETCH_NEXT,
+ OCI_DEFAULT));
if ((statement->error == OCI_NO_DATA) || (nrows == 0)) {
/* XXX this is needed for REFCURSORS! */
column->cb_retlen = OCI_PIECE_SIZE;
- OCIStmtSetPieceInfo((void *) column->pDefine,
- OCI_HTYPE_DEFINE,
- statement->pError,
- ((char*)column->data) + column->retlen4,
- &(column->cb_retlen),
- OCI_NEXT_PIECE,
- &column->indicator,
- &column->retcode);
+ CALL_OCI(OCIStmtSetPieceInfo(
+ (void *) column->pDefine,
+ OCI_HTYPE_DEFINE,
+ statement->pError,
+ ((char*)column->data) + column->retlen4,
+ &(column->cb_retlen),
+ OCI_NEXT_PIECE,
+ &column->indicator,
+ &column->retcode));
}
}
- statement->error =
- OCIStmtFetch(statement->pStmt,
- statement->pError, nrows,
- OCI_FETCH_NEXT,
- OCI_DEFAULT);
+ CALL_OCI_RETURN(statement->error, OCIStmtFetch(
+ statement->pStmt,
+ statement->pError,
+ nrows,
+ OCI_FETCH_NEXT,
+ OCI_DEFAULT));
for (i = 0; i < statement->ncolumns; i++) {
column = oci_get_col(statement, i + 1, 0);
ub4 siz = 0;
ub4 readlen = 0;
char *buf;
+ TSRMLS_FETCH();
*loblen = 0;
if (mydescr->type == OCI_DTYPE_FILE) {
- connection->error =
- OCILobFileOpen(connection->pServiceContext,
- connection->pError,
- mydescr->ocidescr,
- OCI_FILE_READONLY);
+ CALL_OCI_RETURN(connection->error, OCILobFileOpen(
+ connection->pServiceContext,
+ connection->pError,
+ mydescr->ocidescr,
+ OCI_FILE_READONLY));
+
if (connection->error) {
oci_error(connection->pError, "OCILobFileOpen",connection->error);
oci_handle_error(connection, connection->error);
return -1;
}
}
-
- connection->error =
- OCILobGetLength(connection->pServiceContext,
- connection->pError,
- mydescr->ocidescr,
- &readlen);
+
+ CALL_OCI_RETURN(connection->error, OCILobGetLength(
+ connection->pServiceContext,
+ connection->pError,
+ mydescr->ocidescr,
+ &readlen));
if (connection->error) {
oci_error(connection->pError, "OCILobGetLength",connection->error);
buf = emalloc(readlen + 1);
while (readlen > 0) { /* thies loop should not be entered on readlen == 0 */
- connection->error =
- OCILobRead(connection->pServiceContext,
- connection->pError,
- mydescr->ocidescr,
- &readlen, /* IN/OUT bytes toread/read */
- siz + 1, /* offset (starts with 1) */
- (dvoid *) ((char *) buf + siz),
- readlen, /* size of buffer */
- (dvoid *)0,
- (OCICallbackLobRead) 0, /* callback... */
- (ub2) 0, /* The character set ID of the buffer data. */
- (ub1) SQLCS_IMPLICIT); /* The character set form of the buffer data. */
+ CALL_OCI_RETURN(connection->error, OCILobRead(
+ connection->pServiceContext,
+ connection->pError,
+ mydescr->ocidescr,
+ &readlen, /* IN/OUT bytes toread/read */
+ siz + 1, /* offset (starts with 1) */
+ (dvoid *) ((char *) buf + siz),
+ readlen, /* size of buffer */
+ (dvoid *)0,
+ (OCICallbackLobRead) 0, /* callback... */
+ (ub2) 0, /* The character set ID of the buffer data. */
+ (ub1) SQLCS_IMPLICIT)); /* The character set form of the buffer data. */
siz += readlen;
readlen = LOBREADSIZE;
}
if (mydescr->type == OCI_DTYPE_FILE) {
- connection->error =
- OCILobFileClose(connection->pServiceContext,
- connection->pError,
- mydescr->ocidescr);
+ CALL_OCI_RETURN(connection->error, OCILobFileClose(
+ connection->pServiceContext,
+ connection->pError,
+ mydescr->ocidescr));
+
if (connection->error) {
oci_error(connection->pError, "OCILobFileClose", connection->error);
oci_handle_error(connection, connection->error);
session->exclusive = exclusive;
/* allocate temporary Service Context */
- OCI(error) =
- OCIHandleAlloc(OCI(pEnv),
- (dvoid **)&svchp,
- OCI_HTYPE_SVCCTX,
- 0,
- NULL);
+ CALL_OCI_RETURN(OCI(error), OCIHandleAlloc(
+ OCI(pEnv),
+ (dvoid **)&svchp,
+ OCI_HTYPE_SVCCTX,
+ 0,
+ NULL));
+
if (OCI(error) != OCI_SUCCESS) {
oci_error(OCI(pError), "_oci_open_session: OCIHandleAlloc OCI_HTYPE_SVCCTX", OCI(error));
goto CLEANUP;
}
/* allocate private session-handle */
- OCI(error) =
- OCIHandleAlloc(OCI(pEnv),
- (dvoid **)&session->pSession,
- OCI_HTYPE_SESSION,
- 0,
- NULL);
+ CALL_OCI_RETURN(OCI(error), OCIHandleAlloc(
+ OCI(pEnv),
+ (dvoid **)&session->pSession,
+ OCI_HTYPE_SESSION,
+ 0,
+ NULL));
+
if (OCI(error) != OCI_SUCCESS) {
oci_error(OCI(pError), "_oci_open_session: OCIHandleAlloc OCI_HTYPE_SESSION", OCI(error));
goto CLEANUP;
}
/* Set the server handle in service handle */
- OCI(error) =
- OCIAttrSet(svchp,
- OCI_HTYPE_SVCCTX,
- server->pServer,
- 0,
- OCI_ATTR_SERVER,
- OCI(pError));
+ CALL_OCI_RETURN(OCI(error), OCIAttrSet(
+ svchp,
+ OCI_HTYPE_SVCCTX,
+ server->pServer,
+ 0,
+ OCI_ATTR_SERVER,
+ OCI(pError)));
+
if (OCI(error) != OCI_SUCCESS) {
oci_error(OCI(pError), "_oci_open_session: OCIAttrSet OCI_ATTR_SERVER", OCI(error));
goto CLEANUP;
}
/* set the username in user handle */
- OCI(error) =
- OCIAttrSet((dvoid *) session->pSession,
- (ub4) OCI_HTYPE_SESSION,
- (dvoid *) username,
- (ub4) strlen(username),
- (ub4) OCI_ATTR_USERNAME,
- OCI(pError));
+ CALL_OCI_RETURN(OCI(error), OCIAttrSet(
+ (dvoid *) session->pSession,
+ (ub4) OCI_HTYPE_SESSION,
+ (dvoid *) username,
+ (ub4) strlen(username),
+ (ub4) OCI_ATTR_USERNAME,
+ OCI(pError)));
+
if (OCI(error) != OCI_SUCCESS) {
oci_error(OCI(pError), "OCIAttrSet OCI_ATTR_USERNAME", OCI(error));
goto CLEANUP;
}
/* set the password in user handle */
- OCI(error) =
- OCIAttrSet((dvoid *) session->pSession,
- (ub4) OCI_HTYPE_SESSION,
- (dvoid *) password,
- (ub4) strlen(password),
- (ub4) OCI_ATTR_PASSWORD,
- OCI(pError));
+ CALL_OCI_RETURN(OCI(error), OCIAttrSet(
+ (dvoid *) session->pSession,
+ (ub4) OCI_HTYPE_SESSION,
+ (dvoid *) password,
+ (ub4) strlen(password),
+ (ub4) OCI_ATTR_PASSWORD,
+ OCI(pError)));
+
if (OCI(error) != OCI_SUCCESS) {
oci_error(OCI(pError), "OCIAttrSet OCI_ATTR_PASSWORD", OCI(error));
goto CLEANUP;
}
- OCI(error) =
- OCISessionBegin(svchp,
- OCI(pError),
- session->pSession,
- (ub4) OCI_CRED_RDBMS,
- (ub4) OCI_DEFAULT);
+ CALL_OCI_RETURN(OCI(error), OCISessionBegin(
+ svchp,
+ OCI(pError),
+ session->pSession,
+ (ub4) OCI_CRED_RDBMS,
+ (ub4) OCI_DEFAULT));
+
if (OCI(error) != OCI_SUCCESS) {
oci_error(OCI(pError), "OCISessionBegin", OCI(error));
goto CLEANUP;
}
/* Free Temporary Service Context */
- OCIHandleFree((dvoid *) svchp, (ub4) OCI_HTYPE_SVCCTX);
+ CALL_OCI(OCIHandleFree(
+ (dvoid *) svchp,
+ (ub4) OCI_HTYPE_SVCCTX));
if (exclusive) {
psession = session;
if (session->is_open) {
/* Temporary Service Context */
- OCI(error) =
- OCIHandleAlloc(OCI(pEnv),
- (dvoid **) &svchp,
- (ub4) OCI_HTYPE_SVCCTX,
- (size_t) 0,
- (dvoid **) 0);
+ CALL_OCI_RETURN(OCI(error), OCIHandleAlloc(
+ OCI(pEnv),
+ (dvoid **) &svchp,
+ (ub4) OCI_HTYPE_SVCCTX,
+ (size_t) 0,
+ (dvoid **) 0));
if (OCI(error) != OCI_SUCCESS) {
oci_error(OCI(pError), "_oci_close_session OCIHandleAlloc OCI_HTYPE_SVCCTX", OCI(error));
}
/* Set the server handle in service handle */
- OCI(error) =
- OCIAttrSet(svchp,
- OCI_HTYPE_SVCCTX,
- session->server->pServer,
- 0,
- OCI_ATTR_SERVER,
- OCI(pError));
+ CALL_OCI_RETURN(OCI(error), OCIAttrSet(
+ svchp,
+ OCI_HTYPE_SVCCTX,
+ session->server->pServer,
+ 0,
+ OCI_ATTR_SERVER,
+ OCI(pError)));
+
if (OCI(error) != OCI_SUCCESS) {
oci_error(OCI(pError), "_oci_close_session: OCIAttrSet OCI_ATTR_SERVER", OCI(error));
}
/* Set the Authentication handle in the service handle */
- OCI(error) =
- OCIAttrSet(svchp,
- OCI_HTYPE_SVCCTX,
- session->pSession,
- 0,
- OCI_ATTR_SESSION,
- OCI(pError));
+ CALL_OCI_RETURN(OCI(error), OCIAttrSet(
+ svchp,
+ OCI_HTYPE_SVCCTX,
+ session->pSession,
+ 0,
+ OCI_ATTR_SESSION,
+ OCI(pError)));
+
if (OCI(error) != OCI_SUCCESS) {
oci_error(OCI(pError), "_oci_close_session: OCIAttrSet OCI_ATTR_SESSION", OCI(error));
}
-
- OCI(error) =
- OCISessionEnd(svchp,
- OCI(pError),
- session->pSession,
- (ub4) 0);
+
+ CALL_OCI_RETURN(OCI(error), OCISessionEnd(
+ svchp,
+ OCI(pError),
+ session->pSession,
+ (ub4) 0));
+
if (OCI(error) != OCI_SUCCESS) {
oci_error(OCI(pError), "_oci_close_session: OCISessionEnd", OCI(error));
}
- OCIHandleFree((dvoid *) svchp, (ub4) OCI_HTYPE_SVCCTX);
+ CALL_OCI(OCIHandleFree(
+ (dvoid *) svchp,
+ (ub4) OCI_HTYPE_SVCCTX));
} else {
oci_debug("_oci_close_session: logging-off DEAD session");
}
if (session->pSession) {
- OCIHandleFree((dvoid *) session->pSession, (ub4) OCI_HTYPE_SESSION);
+ CALL_OCI(OCIHandleFree(
+ (dvoid *) session->pSession,
+ (ub4) OCI_HTYPE_SESSION));
}
hashed_details = session->hashed_details;
server->persistent = persistent;
server->dbname = strdup(SAFE_STRING(dbname));
+
+ CALL_OCI(OCIHandleAlloc(
+ OCI(pEnv),
+ (dvoid **)&server->pServer,
+ OCI_HTYPE_SERVER,
+ 0,
+ NULL));
- OCIHandleAlloc(OCI(pEnv),
- (dvoid **)&server->pServer,
- OCI_HTYPE_SERVER,
- 0,
- NULL);
-
- OCI(error) =
- OCIServerAttach(server->pServer,
- OCI(pError),
- (text*)server->dbname,
- strlen(server->dbname),
- (ub4) OCI_DEFAULT);
+ CALL_OCI_RETURN(OCI(error), OCIServerAttach(
+ server->pServer,
+ OCI(pError),
+ (text*)server->dbname,
+ strlen(server->dbname),
+ (ub4) OCI_DEFAULT));
if (OCI(error)) {
oci_error(OCI(pError), "_oci_open_server", OCI(error));
if (server->is_open) {
if (server->pServer && OCI(pError)) {
- OCI(error) =
- OCIServerDetach(server->pServer,
- OCI(pError),
- OCI_DEFAULT);
+ CALL_OCI_RETURN(
+ OCI(error),
+ OCIServerDetach(server->pServer,
+ OCI(pError),
+ OCI_DEFAULT));
if (OCI(error)) {
oci_error(OCI(pError), "oci_close_server OCIServerDetach", OCI(error));
}
if (server->pServer) {
- OCIHandleFree((dvoid *) server->pServer, (ub4) OCI_HTYPE_SERVER);
+ CALL_OCI(OCIHandleFree(
+ (dvoid *) server->pServer,
+ (ub4) OCI_HTYPE_SERVER));
}
dbname = server->dbname;
connection->session = session;
/* allocate our private error-handle */
- OCI(error) =
- OCIHandleAlloc(OCI(pEnv),
- (dvoid **)&connection->pError,
- OCI_HTYPE_ERROR,
- 0,
- NULL);
+ CALL_OCI_RETURN(OCI(error), OCIHandleAlloc(
+ OCI(pEnv),
+ (dvoid **)&connection->pError,
+ OCI_HTYPE_ERROR,
+ 0,
+ NULL));
+
if (OCI(error) != OCI_SUCCESS) {
oci_error(OCI(pError), "oci_do_connect: OCIHandleAlloc OCI_HTYPE_ERROR",OCI(error));
goto CLEANUP;
}
/* allocate our service-context */
- OCI(error) =
- OCIHandleAlloc(OCI(pEnv),
- (dvoid **)&connection->pServiceContext,
- OCI_HTYPE_SVCCTX,
- 0,
- NULL);
+ CALL_OCI_RETURN(OCI(error), OCIHandleAlloc(
+ OCI(pEnv),
+ (dvoid **)&connection->pServiceContext,
+ OCI_HTYPE_SVCCTX,
+ 0,
+ NULL));
+
if (OCI(error) != OCI_SUCCESS) {
oci_error(OCI(pError), "oci_do_connect: OCIHandleAlloc OCI_HTYPE_SVCCTX",OCI(error));
goto CLEANUP;
}
/* Set the server handle in service handle */
- connection->error =
- OCIAttrSet(connection->pServiceContext,
- OCI_HTYPE_SVCCTX,
- server->pServer,
- 0,
- OCI_ATTR_SERVER,
- connection->pError);
+ CALL_OCI_RETURN(connection->error, OCIAttrSet(
+ connection->pServiceContext,
+ OCI_HTYPE_SVCCTX,
+ server->pServer,
+ 0,
+ OCI_ATTR_SERVER,
+ connection->pError));
+
if (connection->error != OCI_SUCCESS) {
oci_error(connection->pError, "oci_do_connect: OCIAttrSet OCI_ATTR_SERVER", connection->error);
goto CLEANUP;
}
/* Set the Authentication handle in the service handle */
- connection->error =
- OCIAttrSet(connection->pServiceContext,
- OCI_HTYPE_SVCCTX,
- session->pSession,
- 0,
- OCI_ATTR_SESSION,
- connection->pError);
+ CALL_OCI_RETURN(connection->error, OCIAttrSet(
+ connection->pServiceContext,
+ OCI_HTYPE_SVCCTX,
+ session->pSession,
+ 0,
+ OCI_ATTR_SESSION,
+ connection->pError));
+
if (connection->error != OCI_SUCCESS) {
oci_error(connection->pError, "oci_do_connect: OCIAttrSet OCI_ATTR_SESSION", connection->error);
goto CLEANUP;
oci_descriptor *descr;
#ifdef WITH_COLLECTIONS
oci_collection *coll;
- int mode = OCI_DATA_AT_EXEC;
dvoid *mycoll = 0;
#endif
+ int mode = OCI_DATA_AT_EXEC;
ub2 ocitype = SQLT_CHR; /* unterminated string */
OCIStmt *mystmt = 0;
dvoid *mydescr = 0;
bindp->pStmt = mystmt;
bindp->zval = *var;
zval_add_ref(var);
-
- statement->error =
- OCIBindByName(statement->pStmt, /* statement handle */
- (OCIBind **)&bindp->pBind, /* bind hdl (will alloc) */
- statement->pError, /* error handle */
- (text*) (*name)->value.str.val, /* placeholder name */
- (*name)->value.str.len, /* placeholder length */
- (dvoid *)0, /* in/out data */
- value_sz, /* OCI_MAX_DATA_SIZE, */ /* max size of input/output data */
- (ub2)ocitype, /* in/out data type */
- (dvoid *)&bindp->indicator, /* indicator (ignored) */
- (ub2 *)0, /* size array (ignored) */
- (ub2 *)&bindp->retcode, /* return code (ignored) */
- (ub4)0, /* maxarr_len (PL/SQL only?) */
- (ub4 *)0, /* actual array size (PL/SQL only?) */
-#ifdef WITH_COLLECTIONS
- mode /* mode */);
-#else
- OCI_DATA_AT_EXEC /* mode */);
-#endif
+
+ CALL_OCI_RETURN(statement->error, OCIBindByName(
+ statement->pStmt, /* statement handle */
+ (OCIBind **)&bindp->pBind, /* bind hdl (will alloc) */
+ statement->pError, /* error handle */
+ (text*) (*name)->value.str.val, /* placeholder name */
+ (*name)->value.str.len, /* placeholder length */
+ (dvoid *)0, /* in/out data */
+ value_sz, /* OCI_MAX_DATA_SIZE, */ /* max size of input/output data */
+ (ub2)ocitype, /* in/out data type */
+ (dvoid *)&bindp->indicator, /* indicator (ignored) */
+ (ub2 *)0, /* size array (ignored) */
+ (ub2 *)&bindp->retcode, /* return code (ignored) */
+ (ub4)0, /* maxarr_len (PL/SQL only?) */
+ (ub4 *)0, /* actual array size (PL/SQL only?) */
+ mode /* mode */
+ ));
if (statement->error != OCI_SUCCESS) {
oci_error(statement->pError, "OCIBindByName", statement->error);
RETURN_FALSE;
}
-#ifdef WITH_COLLECTIONS
- if(mode == OCI_DATA_AT_EXEC) {
-#endif
- statement->error =
- OCIBindDynamic(bindp->pBind,
- statement->pError,
- (dvoid *)bindp,
- oci_bind_in_callback,
- (dvoid *)bindp,
- oci_bind_out_callback);
+ if (mode == OCI_DATA_AT_EXEC) {
+ CALL_OCI_RETURN(statement->error, OCIBindDynamic(
+ bindp->pBind,
+ statement->pError,
+ (dvoid *)bindp,
+ oci_bind_in_callback,
+ (dvoid *)bindp,
+ oci_bind_out_callback));
- if (statement->error != OCI_SUCCESS) {
- oci_error(statement->pError, "OCIBindDynamic", statement->error);
- oci_handle_error(statement->conn, statement->error);
- RETURN_FALSE;
- }
-#ifdef WITH_COLLECTIONS
+ if (statement->error != OCI_SUCCESS) {
+ oci_error(statement->pError, "OCIBindDynamic", statement->error);
+ oci_handle_error(statement->conn, statement->error);
+ RETURN_FALSE;
+ }
}
-#endif
#ifdef WITH_COLLECTIONS
- if(ocitype == SQLT_NTY) {
+ if (ocitype == SQLT_NTY) {
/* Bind object */
- statement->error = OCIBindObject(bindp->pBind,
- statement->pError,
- coll->tdo,
- (dvoid **) &(coll->coll),
- (ub4 *) 0, (dvoid **) 0, (ub4 *) 0);
+ CALL_OCI_RETURN(statement->error, OCIBindObject(
+ bindp->pBind,
+ statement->pError,
+ coll->tdo,
+ (dvoid **) &(coll->coll),
+ (ub4 *) 0,
+ (dvoid **) 0,
+ (ub4 *) 0));
+
if (statement->error) {
oci_error(statement->pError, "OCIBindObject", statement->error);
RETURN_FALSE;
convert_to_long_ex(oarg);
offparam = (*oarg)->value.lval;
- connection->error =
- OCILobGetLength(connection->pServiceContext,
- connection->pError,
- mylob,
- &curloblen);
+ CALL_OCI_RETURN(connection->error, OCILobGetLength(
+ connection->pServiceContext,
+ connection->pError,
+ mylob,
+ &curloblen));
oci_debug("OCIsavedesc: curloblen=%d",curloblen);
RETURN_FALSE;
}
- connection->error =
- OCILobWrite(connection->pServiceContext,
+ CALL_OCI_RETURN(connection->error, OCILobWrite(
+ connection->pServiceContext,
connection->pError,
mylob,
&loblen,
(dvoid *)0,
(OCICallbackLobWrite) 0,
(ub2) 0,
- (ub1) SQLCS_IMPLICIT );
+ (ub1) SQLCS_IMPLICIT));
oci_debug("OCIsavedesc: size=%d offset=%d",loblen,offset);
}
while ((loblen = read(fp, &buf, sizeof(buf))) > 0) {
- connection->error =
- OCILobWrite(connection->pServiceContext,
- connection->pError,
- mylob,
- &loblen,
- (ub4) offset,
- (dvoid *) &buf,
- (ub4) loblen,
- OCI_ONE_PIECE,
- (dvoid *)0,
- (OCICallbackLobWrite) 0,
- (ub2) 0,
- (ub1) SQLCS_IMPLICIT);
+ CALL_OCI_RETURN(connection->error, OCILobWrite(
+ connection->pServiceContext,
+ connection->pError,
+ mylob,
+ &loblen,
+ (ub4) offset,
+ (dvoid *) &buf,
+ (ub4) loblen,
+ OCI_ONE_PIECE,
+ (dvoid *)0,
+ (OCICallbackLobWrite) 0,
+ (ub2) 0,
+ (ub1) SQLCS_IMPLICIT));
oci_debug("OCIsavelob: size=%d",loblen);
goto bail;
}
}
-
- connection->error =
- OCILobGetLength(connection->pServiceContext,
- connection->pError,
- descr->ocidescr,
- &loblen);
+
+ CALL_OCI_RETURN(connection->error, OCILobGetLength(
+ connection->pServiceContext,
+ connection->pError,
+ descr->ocidescr,
+ &loblen));
if (connection->error) {
oci_error(connection->pError, "OCILobGetLength", connection->error);
}
if (descr->type == OCI_DTYPE_FILE) {
- connection->error =
- OCILobFileOpen(connection->pServiceContext,
- connection->pError,
- descr->ocidescr,
- OCI_FILE_READONLY);
+ CALL_OCI_RETURN(connection->error, OCILobFileOpen(
+ connection->pServiceContext,
+ connection->pError,
+ descr->ocidescr,
+ OCI_FILE_READONLY));
+
if (connection->error) {
oci_error(connection->pError, "OCILobFileOpen",connection->error);
oci_handle_error(connection, connection->error);
oci_debug("OCILobRead(coffs = %d, toread = %d",coffs,toread);
- connection->error =
- OCILobRead(connection->pServiceContext,
- connection->pError,
- descr->ocidescr,
- &toread, /* IN/OUT bytes toread/read */
- coffs+1, /* offset (starts with 1) */
- (dvoid *) buffer,
- toread, /* size of buffer */
- (dvoid *)0,
- (OCICallbackLobRead) 0, /* callback... */
- (ub2) 0, /* The character set ID of the buffer data. */
- (ub1) SQLCS_IMPLICIT); /* The character set form of the buffer data. */
+ CALL_OCI_RETURN(connection->error, OCILobRead(
+ connection->pServiceContext,
+ connection->pError,
+ descr->ocidescr,
+ &toread, /* IN/OUT bytes toread/read */
+ coffs+1, /* offset (starts with 1) */
+ (dvoid *) buffer,
+ toread, /* size of buffer */
+ (dvoid *)0,
+ (OCICallbackLobRead) 0, /* callback... */
+ (ub2) 0, /* The character set ID of the buffer data. */
+ (ub1) SQLCS_IMPLICIT)); /* The character set form of the buffer data. */
oci_debug("OCILobRead(read - %d",toread);
}
if (descr->type == OCI_DTYPE_FILE) {
- connection->error =
- OCILobFileClose(connection->pServiceContext,
- connection->pError,
- descr->ocidescr);
+ CALL_OCI_RETURN(connection->error,OCILobFileClose(
+ connection->pServiceContext,
+ connection->pError,
+ descr->ocidescr));
+
if (connection->error) {
oci_error(connection->pError, "OCILobFileClose", connection->error);
oci_handle_error(connection, connection->error);
}
convert_to_string_ex(var);
-
- connection->error =
- OCILobCreateTemporary(connection->pServiceContext,
- connection->pError,
- mylob,
- OCI_DEFAULT,
- OCI_DEFAULT,
- OCI_TEMP_CLOB,
- TRUE,
- OCI_DURATION_SESSION);
+
+ CALL_OCI_RETURN(connection->error, OCILobCreateTemporary(
+ connection->pServiceContext,
+ connection->pError,
+ mylob,
+ OCI_DEFAULT,
+ OCI_DEFAULT,
+ OCI_TEMP_CLOB,
+ TRUE,
+ OCI_DURATION_SESSION));
if (connection->error) {
oci_error(connection->pError, "OCILobCreateTemporary", connection->error);
RETURN_FALSE;
}
- connection->error =
- OCILobOpen(connection->pServiceContext,
- connection->pError,
- mylob,
- OCI_LOB_READWRITE);
+ CALL_OCI_RETURN(connection->error, OCILobOpen(
+ connection->pServiceContext,
+ connection->pError,
+ mylob,
+ OCI_LOB_READWRITE));
if (connection->error) {
oci_error(connection->pError, "OCILobOpen", connection->error);
RETURN_FALSE;
}
- connection->error =
- OCILobWrite(connection->pServiceContext,
- connection->pError,
- mylob,
- (ub4 *) &loblen,
- (ub4) offset,
- (dvoid *) (*var)->value.str.val,
- (ub4) loblen,
- OCI_ONE_PIECE,
- (dvoid *)0,
- (sb4 (*)(dvoid *, dvoid *, ub4 *, ub1 *)) 0,
- (ub2) 0,
- (ub1) SQLCS_IMPLICIT );
+ CALL_OCI_RETURN(connection->error, OCILobWrite(
+ connection->pServiceContext,
+ connection->pError,
+ mylob,
+ (ub4 *) &loblen,
+ (ub4) offset,
+ (dvoid *) (*var)->value.str.val,
+ (ub4) loblen,
+ OCI_ONE_PIECE,
+ (dvoid *)0,
+ (sb4 (*)(dvoid *, dvoid *, ub4 *, ub1 *)) 0,
+ (ub2) 0,
+ (ub1) SQLCS_IMPLICIT));
if (connection->error) {
oci_error(connection->pError, "OCILobWrite", connection->error);
connection = descriptor->conn;
- connection->error = OCILobClose (connection->pServiceContext,
- connection->pError,
- mylob);
+ CALL_OCI_RETURN(connection->error, OCILobClose(
+ connection->pServiceContext,
+ connection->pError,
+ mylob));
if (connection->error) {
oci_error(connection->pError, "OCILobClose", connection->error);
OCI_GET_CONN(connection,conn);
- connection->error =
- OCITransRollback(connection->pServiceContext,
- connection->pError,
- (ub4)0);
+ CALL_OCI_RETURN(connection->error, OCITransRollback(
+ connection->pServiceContext,
+ connection->pError,
+ (ub4) 0));
if (connection->error) {
oci_error(connection->pError, "OCIRollback", connection->error);
oci_debug("<OCITransCommit");
- connection->error =
- OCITransCommit(connection->pServiceContext,
- connection->pError,
- (ub4)0);
+ CALL_OCI_RETURN(connection->error, OCITransCommit(
+ connection->pServiceContext,
+ connection->pError,
+ (ub4) 0));
oci_debug(">OCITransCommit");
outcol->name,outcol->retlen,outcol->retlen4,outcol->data_size,outcol->storage_size4,outcol->indicator,outcol->retcode);
/* Handle data type of LONG */
- if(outcol->data_type == SQLT_LNG){
+ if (outcol->data_type == SQLT_LNG){
RETURN_LONG(outcol->storage_size4);
- }else{
+ } else {
RETURN_LONG(outcol->data_size);
}
}
RETURN_FALSE;
}
- OCIErrorGet(errh,1,NULL,&errcode,errbuf,(ub4)sizeof(errbuf),(ub4)OCI_HTYPE_ERROR);
+ CALL_OCI(OCIErrorGet(
+ errh,
+ 1,
+ NULL,
+ &errcode,
+ errbuf,
+ (ub4) sizeof(errbuf),
+ (ub4) OCI_HTYPE_ERROR));
if (errcode) {
array_init(return_value);
OCI_GET_CONN(connection,conn);
- connection->error =
- OCIServerVersion(connection->pServiceContext,
- connection->pError,
- (text*)version,
- sizeof(version),
- OCI_HTYPE_SVCCTX);
+ CALL_OCI_RETURN(connection->error, OCIServerVersion(
+ connection->pServiceContext,
+ connection->pError,
+ (text*)version,
+ sizeof(version),
+ OCI_HTYPE_SVCCTX));
if (connection->error != OCI_SUCCESS) {
oci_error(connection->pError, "OCIServerVersion", connection->error);
OCI_GET_STMT(statement,stmt);
- statement->error =
- OCIAttrGet((dvoid *)statement->pStmt,
- OCI_HTYPE_STMT,
- (ub2 *)&stmttype,
- (ub4 *)0,
- OCI_ATTR_STMT_TYPE,
- statement->pError);
+ CALL_OCI_RETURN(statement->error, OCIAttrGet(
+ (dvoid *)statement->pStmt,
+ OCI_HTYPE_STMT,
+ (ub2 *)&stmttype,
+ (ub4 *)0,
+ OCI_ATTR_STMT_TYPE,
+ statement->pError));
+
if (statement->error != OCI_SUCCESS) {
oci_error(statement->pError, "OCIStatementType", statement->error);
oci_handle_error(statement->conn, statement->error);
OCI_GET_STMT(statement,stmt);
- statement->error =
- OCIAttrGet((dvoid *)statement->pStmt,
- OCI_HTYPE_STMT,
- (ub2 *)&rowcount,
- (ub4 *)0,
- OCI_ATTR_ROW_COUNT,
- statement->pError);
+ CALL_OCI_RETURN(statement->error, OCIAttrGet(
+ (dvoid *)statement->pStmt,
+ OCI_HTYPE_STMT,
+ (ub2 *)&rowcount,
+ (ub4 *)0,
+ OCI_ATTR_ROW_COUNT,
+ statement->pError));
if (statement->error != OCI_SUCCESS) {
oci_error(statement->pError, "OCIRowCount", statement->error);
*/
connection = coll->conn;
oci_debug("OCIfreecollection: coll=%d",inx);
- connection->error = OCIObjectFree(OCI(pEnv),
- connection->pError,
- (dvoid *)coll->coll,
- (ub2)(OCI_OBJECTFREE_FORCE));
+
+ CALL_OCI_RETURN(connection->error, OCIObjectFree(
+ OCI(pEnv),
+ connection->pError,
+ (dvoid *)coll->coll,
+ (ub2)(OCI_OBJECTFREE_FORCE)));
+
if (connection->error) {
oci_error(connection->pError, "OCIObjectFree", connection->error);
RETURN_FALSE;
switch(coll->element_typecode) {
case OCI_TYPECODE_DATE:
convert_to_string_ex(arg);
- connection->error = OCIDateFromText(connection->pError,
- (*arg)->value.str.val,
- (*arg)->value.str.len,
- 0,0,0,0,&dt);
+
+ CALL_OCI_RETURN(connection->error, OCIDateFromText(
+ connection->pError,
+ (*arg)->value.str.val,
+ (*arg)->value.str.len,
+ 0,
+ 0,
+ 0,
+ 0,
+ &dt));
+
if (connection->error) {
oci_error(connection->pError, "OCIDateFromText", connection->error);
RETURN_FALSE;
}
- connection->error = OCICollAppend(OCI(pEnv),
- connection->pError,
- (dvoid *) &dt,
- (dvoid *) &new_ind,
- (OCIColl *) coll->coll);
+
+ CALL_OCI_RETURN(connection->error, OCICollAppend(
+ OCI(pEnv),
+ connection->pError,
+ (dvoid *) &dt,
+ (dvoid *) &new_ind,
+ (OCIColl *) coll->coll));
+
if (connection->error) {
oci_error(connection->pError, "OCICollAppend", connection->error);
RETURN_FALSE;
break;
case OCI_TYPECODE_VARCHAR2 :
convert_to_string_ex(arg);
- connection->error = OCIStringAssignText(OCI(pEnv),
- connection->pError,
- (*arg)->value.str.val,
- (*arg)->value.str.len,
- &ocistr);
+
+ CALL_OCI_RETURN(connection->error, OCIStringAssignText(
+ OCI(pEnv),
+ connection->pError,
+ (*arg)->value.str.val,
+ (*arg)->value.str.len,
+ &ocistr));
+
if (connection->error) {
oci_error(connection->pError, "OCIStringAssignText", connection->error);
RETURN_FALSE;
}
- connection->error = OCICollAppend(OCI(pEnv),
- connection->pError,
- (dvoid *) ocistr,
- (dvoid *) &new_ind,
- (OCIColl *) coll->coll);
+
+ CALL_OCI_RETURN(connection->error, OCICollAppend(
+ OCI(pEnv),
+ connection->pError,
+ (dvoid *) ocistr,
+ (dvoid *) &new_ind,
+ (OCIColl *) coll->coll));
+
if (connection->error) {
oci_error(connection->pError, "OCICollAppend", connection->error);
RETURN_FALSE;
case OCI_TYPECODE_SMALLINT : /* SMALLINT */
convert_to_double_ex(arg);
ndx = (double)(*arg)->value.dval;
- connection->error = OCINumberFromReal(connection->pError,&ndx,
- sizeof(double),&num);
+
+ CALL_OCI_RETURN(connection->error, OCINumberFromReal(
+ connection->pError,
+ &ndx,
+ sizeof(double),&num));
+
if (connection->error) {
oci_error(connection->pError, "OCINumberFromReal", connection->error);
RETURN_FALSE;
}
- connection->error = OCICollAppend(OCI(pEnv),
- connection->pError,
- (dvoid *) &num,
- (dvoid *) &new_ind,
- (OCIColl *) coll->coll);
+ CALL_OCI_RETURN(connection->error, OCICollAppend(
+ OCI(pEnv),
+ connection->pError,
+ (dvoid *) &num,
+ (dvoid *) &new_ind,
+ (OCIColl *) coll->coll));
+
RETURN_TRUE;
break;
}
connection = coll->conn;
- connection->error = OCICollGetElem(OCI(pEnv),
- connection->pError,
- coll->coll,
- ndx,
- &exists,
- &elem,
- &elemind);
+ CALL_OCI_RETURN(connection->error, OCICollGetElem(
+ OCI(pEnv),
+ connection->pError,
+ coll->coll,
+ ndx,
+ &exists,
+ &elem,
+ &elemind));
+
if (connection->error) {
oci_error(connection->pError, "OCICollGetElem", connection->error);
RETURN_FALSE;
}
- switch(coll->element_typecode) {
+
+ switch (coll->element_typecode) {
case OCI_TYPECODE_DATE:
len = 1024;
- OCIDateToText(connection->pError,
- elem,
- 0, /* fmt */
- 0, /* fmt_length */
- 0, /* lang_name */
- 0, /* lang_length */
- &len,buff);
+ CALL_OCI(OCIDateToText(
+ connection->pError,
+ elem,
+ 0, /* fmt */
+ 0, /* fmt_length */
+ 0, /* lang_name */
+ 0, /* lang_length */
+ &len,
+ buff));
+
RETURN_STRINGL(buff,len,1);
case OCI_TYPECODE_VARCHAR2 :
ocistr = *(OCIString **)elem;
- str = OCIStringPtr(OCI(pEnv),ocistr);
+ str = OCIStringPtr(OCI(pEnv),ocistr); /* XXX not protected against recursion! */
RETURN_STRINGL(str,strlen(str),1);
break;
case OCI_TYPECODE_UNSIGNED16 : /* UNSIGNED SHORT */
case OCI_TYPECODE_FLOAT : /* FLOAT */
case OCI_TYPECODE_NUMBER : /* NUMBER */
case OCI_TYPECODE_SMALLINT : /* SMALLINT */
- connection->error = OCINumberToReal(connection->pError,
- (CONST OCINumber *) elem,
- (uword) sizeof(dnum), (dvoid *) &dnum);
+ CALL_OCI_RETURN(connection->error, OCINumberToReal(
+ connection->pError,
+ (CONST OCINumber *) elem,
+ (uword) sizeof(dnum),
+ (dvoid *) &dnum));
+
if (connection->error) {
oci_error(connection->pError, "OCINumberToReal", connection->error);
RETURN_FALSE;
}
connection = coll->conn;
+
+ CALL_OCI_RETURN(connection->error, OCICollAssign(
+ OCI(pEnv),
+ connection->pError,
+ from_coll->coll,
+ coll->coll));
- connection->error = OCICollAssign(OCI(pEnv),connection->pError,
- from_coll->coll,coll->coll);
if (connection->error) {
oci_error(connection->pError, "OCICollAssignElem", connection->error);
RETURN_FALSE;
switch(coll->element_typecode) {
case OCI_TYPECODE_DATE:
convert_to_string_ex(val);
- connection->error = OCIDateFromText(connection->pError,
- (*val)->value.str.val,
- (*val)->value.str.len,
- 0,0,0,0,&dt);
+ CALL_OCI_RETURN(connection->error, OCIDateFromText(
+ connection->pError,
+ (*val)->value.str.val,
+ (*val)->value.str.len,
+ 0,
+ 0,
+ 0,
+ 0,
+ &dt));
+
if (connection->error) {
oci_error(connection->pError, "OCIDateFromText", connection->error);
RETURN_FALSE;
}
- connection->error = OCICollAssignElem(OCI(pEnv),
- connection->pError,
- ndx,
- (dword *)&dt,
- &new_ind,
- coll->coll);
+
+ CALL_OCI_RETURN(connection->error, OCICollAssignElem(
+ OCI(pEnv),
+ connection->pError,
+ ndx,
+ (dword *)&dt,
+ &new_ind,
+ coll->coll));
+
if (connection->error) {
oci_error(connection->pError, "OCICollAssignElem", connection->error);
RETURN_FALSE;
break;
case OCI_TYPECODE_VARCHAR2 :
convert_to_string_ex(val);
- connection->error = OCIStringAssignText(OCI(pEnv),
- connection->pError,
- (*val)->value.str.val,
- (*val)->value.str.len,
- &ocistr);
+
+ CALL_OCI_RETURN(connection->error, OCIStringAssignText(
+ OCI(pEnv),
+ connection->pError,
+ (*val)->value.str.val,
+ (*val)->value.str.len,
+ &ocistr));
+
if (connection->error) {
oci_error(connection->pError, "OCIStringAssignText", connection->error);
RETURN_FALSE;
}
- connection->error = OCICollAssignElem(OCI(pEnv),
- connection->pError,
- ndx,
- (dword *)ocistr,
- &new_ind,
- coll->coll);
+
+ CALL_OCI_RETURN(connection->error, OCICollAssignElem(
+ OCI(pEnv),
+ connection->pError,
+ ndx,
+ (dword *)ocistr,
+ &new_ind,
+ coll->coll));
+
if (connection->error) {
oci_error(connection->pError, "OCICollAssignElem", connection->error);
RETURN_FALSE;
case OCI_TYPECODE_SMALLINT : /* SMALLINT */
convert_to_double_ex(val);
dnum = (double)(*val)->value.dval;
- connection->error = OCINumberFromReal(connection->pError,&dnum,
- sizeof(double),&num);
+
+ CALL_OCI_RETURN(connection->error, OCINumberFromReal(
+ connection->pError,
+ &dnum,
+ sizeof(double),
+ &num));
+
if (connection->error) {
oci_error(connection->pError, "OCINumberFromReal", connection->error);
RETURN_FALSE;
}
- connection->error = OCICollAssignElem(OCI(pEnv),
- connection->pError,
- ndx,
- (dword *)&num,
- &new_ind,
- coll->coll);
+
+ CALL_OCI_RETURN(connection->error, OCICollAssignElem(
+ OCI(pEnv),
+ connection->pError,
+ ndx,
+ (dword *)&num,
+ &new_ind,
+ coll->coll));
+
if (connection->error) {
oci_error(connection->pError, "OCICollAssignElem", connection->error);
RETURN_FALSE;
RETURN_FALSE;
}
connection = coll->conn;
- connection->error = OCICollSize(OCI(pEnv),coll->conn->pError,coll->coll,&sz);
+
+ CALL_OCI_RETURN(connection->error, OCICollSize(
+ OCI(pEnv),
+ coll->conn->pError,
+ coll->coll,
+ &sz));
+
if (connection->error) {
oci_error(connection->pError, "OCICollSize", connection->error);
RETURN_FALSE;
if ((inx = _oci_get_ocicoll(id,&coll TSRMLS_CC)) == 0) {
RETURN_FALSE;
}
- sz = OCICollMax(OCI(pEnv),coll->coll);
+ sz = OCICollMax(OCI(pEnv),coll->coll); /* XXX not protected against recursion */
+
RETURN_LONG(sz);
}
RETURN_FALSE;
WRONG_PARAM_COUNT;
}
convert_to_long_ex(arg);
- coll->conn->error = OCICollTrim(OCI(pEnv),coll->conn->pError,(*arg)->value.lval,coll->coll);
+
+ CALL_OCI_RETURN(coll->conn->error, OCICollTrim(
+ OCI(pEnv),
+ coll->conn->pError,
+ (*arg)->value.lval,
+ coll->coll));
+
if (coll->conn->error) {
oci_error(coll->conn->pError, "OCICollTrim", coll->conn->error);
RETURN_FALSE;
coll->id = zend_list_insert(coll,le_coll);
zend_list_addref(connection->id);
- connection->error = OCITypeByName(OCI(pEnv),
- connection->pError,
- connection->pServiceContext,
- ac==3?(text *)(*schema)->value.str.val:(text *)0,
- ac==3?(ub4)(*schema)->value.str.len: (ub4)0,
- (text *) (*tdo)->value.str.val,
- (ub4) (*tdo)->value.str.len,
- (CONST text *) 0, (ub4) 0,
- OCI_DURATION_SESSION,
- OCI_TYPEGET_ALL,
- &(coll->tdo));
+ CALL_OCI_RETURN(connection->error, OCITypeByName(
+ OCI(pEnv),
+ connection->pError,
+ connection->pServiceContext,
+ ac==3?(text *)(*schema)->value.str.val:(text *)0,
+ ac==3?(ub4)(*schema)->value.str.len: (ub4)0,
+ (text *) (*tdo)->value.str.val,
+ (ub4) (*tdo)->value.str.len,
+ (CONST text *) 0,
+ (ub4) 0,
+ OCI_DURATION_SESSION,
+ OCI_TYPEGET_ALL,
+ &(coll->tdo)));
+
if (connection->error) {
oci_error(connection->pError, "OCITypeByName", connection->error);
RETURN_FALSE;
}
- connection->error = OCIHandleAlloc(OCI(pEnv), (dvoid **) &dschp1,
- (ub4) OCI_HTYPE_DESCRIBE,
- (size_t) 0, (dvoid **) 0);
+ CALL_OCI_RETURN(connection->error, OCIHandleAlloc(
+ OCI(pEnv),
+ (dvoid **) &dschp1,
+ (ub4) OCI_HTYPE_DESCRIBE,
+ (size_t) 0,
+ (dvoid **) 0));
if (connection->error) {
oci_error(connection->pError, "OCI_HTYPE_DESCRIBE", connection->error);
RETURN_FALSE;
}
- connection->error = OCIDescribeAny(connection->pServiceContext, connection->pError, (dvoid *) coll->tdo,
- (ub4) 0, OCI_OTYPE_PTR, (ub1)1,
- (ub1) OCI_PTYPE_TYPE, dschp1);
+
+ CALL_OCI_RETURN(connection->error, OCIDescribeAny(
+ connection->pServiceContext,
+ connection->pError,
+ (dvoid *) coll->tdo,
+ (ub4) 0,
+ OCI_OTYPE_PTR,
+ (ub1)1,
+ (ub1) OCI_PTYPE_TYPE,
+ dschp1));
+
if (connection->error) {
oci_error(connection->pError, "OCI_OTYPE_PTR", connection->error);
RETURN_FALSE;
}
- connection->error = OCIAttrGet((dvoid *) dschp1,
- (ub4) OCI_HTYPE_DESCRIBE,
- (dvoid *)&parmp1, (ub4 *)0, (ub4)OCI_ATTR_PARAM,connection->pError);
+ CALL_OCI_RETURN(connection->error, OCIAttrGet(
+ (dvoid *) dschp1,
+ (ub4) OCI_HTYPE_DESCRIBE,
+ (dvoid *)&parmp1,
+ (ub4 *)0,
+ (ub4)OCI_ATTR_PARAM,
+ connection->pError));
+
if (connection->error) {
oci_error(connection->pError, "OCI_ATTR_PARAM", connection->error);
RETURN_FALSE;
}
/* get the collection type code of the attribute */
- connection->error = OCIAttrGet((dvoid*) parmp1, (ub4) OCI_DTYPE_PARAM,
- (dvoid*) &(coll->coll_typecode), (ub4 *) 0,
- (ub4) OCI_ATTR_COLLECTION_TYPECODE,
- connection->pError);
+
+ CALL_OCI_RETURN(connection->error, OCIAttrGet(
+ (dvoid*) parmp1,
+ (ub4) OCI_DTYPE_PARAM,
+ (dvoid*) &(coll->coll_typecode),
+ (ub4 *) 0,
+ (ub4) OCI_ATTR_COLLECTION_TYPECODE,
+ connection->pError));
+
if (connection->error) {
oci_error(connection->pError, "OCI_ATTR_COLLECTION_TYPECODE", connection->error);
RETURN_FALSE;
switch(coll->coll_typecode) {
case OCI_TYPECODE_VARRAY:
case OCI_TYPECODE_TABLE:
- connection->error = OCIAttrGet((dvoid*) parmp1,
- (ub4) OCI_DTYPE_PARAM,
- (dvoid*) &parmp2, (ub4 *) 0,
- (ub4) OCI_ATTR_COLLECTION_ELEMENT,
- connection->pError);
+ CALL_OCI_RETURN(connection->error, OCIAttrGet(
+ (dvoid*) parmp1,
+ (ub4) OCI_DTYPE_PARAM,
+ (dvoid*) &parmp2,
+ (ub4 *) 0,
+ (ub4) OCI_ATTR_COLLECTION_ELEMENT,
+ connection->pError));
+
if (connection->error) {
oci_error(connection->pError, "OCI_ATTR_COLLECTION_ELEMENT", connection->error);
RETURN_FALSE;
}
- connection->error = OCIAttrGet((dvoid*) parmp2,
- (ub4) OCI_DTYPE_PARAM,
- (dvoid*) &(coll->elem_ref), (ub4 *) 0,
- (ub4) OCI_ATTR_REF_TDO,
- connection->pError);
+
+ CALL_OCI_RETURN(connection->error, OCIAttrGet(
+ (dvoid*) parmp2,
+ (ub4) OCI_DTYPE_PARAM,
+ (dvoid*) &(coll->elem_ref),
+ (ub4 *) 0,
+ (ub4) OCI_ATTR_REF_TDO,
+ connection->pError));
+
if (connection->error) {
oci_error(connection->pError, "OCI_ATTR_REF_TDO", connection->error);
RETURN_FALSE;
}
- connection->error = OCITypeByRef(OCI(pEnv), connection->pError, coll->elem_ref,
- OCI_DURATION_SESSION,
- OCI_TYPEGET_HEADER, &(coll->element_type));
+
+ CALL_OCI_RETURN(connection->error, OCITypeByRef(
+ OCI(pEnv),
+ connection->pError,
+ coll->elem_ref,
+ OCI_DURATION_SESSION,
+ OCI_TYPEGET_HEADER,
+ &(coll->element_type)));
+
if (connection->error) {
oci_error(connection->pError, "OCI_TYPEGET_HEADER", connection->error);
RETURN_FALSE;
}
- connection->error = OCIAttrGet((dvoid*) parmp2,
- (ub4) OCI_DTYPE_PARAM,
- (dvoid*) &(coll->element_typecode), (ub4 *) 0,
- (ub4) OCI_ATTR_TYPECODE,
- connection->pError);
+ CALL_OCI_RETURN(connection->error, OCIAttrGet(
+ (dvoid*) parmp2,
+ (ub4) OCI_DTYPE_PARAM,
+ (dvoid*) &(coll->element_typecode),
+ (ub4 *) 0,
+ (ub4) OCI_ATTR_TYPECODE,
+ connection->pError));
+
if (connection->error) {
oci_error(connection->pError, "OCI_ATTR_TYPECODE", connection->error);
RETURN_FALSE;
break;
default:
php_error(E_WARNING, "OCINewCollection - Unknown Type %d", coll->coll_typecode);
+ break;
}
/* Create object to hold return table */
- connection->error = OCIObjectNew(OCI(pEnv),
- connection->pError,
- connection->pServiceContext,
- OCI_TYPECODE_TABLE,
- coll->tdo,
- (dvoid *)0,
- OCI_DURATION_DEFAULT,
- TRUE,
- (dvoid **) &(coll->coll));
+ CALL_OCI_RETURN(connection->error, OCIObjectNew(
+ OCI(pEnv),
+ connection->pError,
+ connection->pServiceContext,
+ OCI_TYPECODE_TABLE,
+ coll->tdo,
+ (dvoid *)0,
+ OCI_DURATION_DEFAULT,
+ TRUE,
+ (dvoid **) &(coll->coll)));
+
if (connection->error) {
oci_error(connection->pError, "OCIObjectNew", connection->error);
RETURN_FALSE;