Lines Matching refs:S

38 		S->last_err = name params;										\
39S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name, S->last_err, FALSE, __FILE__, __LINE__ TS…
40 if (S->last_err) { \
47 S->last_err = name params; \
48S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name ": " #msg, S->last_err, FALSE, __FILE__, _…
49 if (S->last_err) { \
58 pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; in oci_stmt_dtor() local
64 if (S->stmt) { in oci_stmt_dtor()
67 OCIStmtFetch(S->stmt, S->err, 0, OCI_FETCH_NEXT, OCI_DEFAULT); in oci_stmt_dtor()
70 OCIHandleFree(S->stmt, OCI_HTYPE_STMT); in oci_stmt_dtor()
71 S->stmt = NULL; in oci_stmt_dtor()
73 if (S->err) { in oci_stmt_dtor()
74 OCIHandleFree(S->err, OCI_HTYPE_ERROR); in oci_stmt_dtor()
75 S->err = NULL; in oci_stmt_dtor()
91 if (S->einfo.errmsg) { in oci_stmt_dtor()
92 pefree(S->einfo.errmsg, stmt->dbh->is_persistent); in oci_stmt_dtor()
93 S->einfo.errmsg = NULL; in oci_stmt_dtor()
96 if (S->cols) { in oci_stmt_dtor()
98 if (S->cols[i].data) { in oci_stmt_dtor()
99 switch (S->cols[i].dtype) { in oci_stmt_dtor()
102 OCIDescriptorFree(S->cols[i].data, OCI_DTYPE_LOB); in oci_stmt_dtor()
105 efree(S->cols[i].data); in oci_stmt_dtor()
109 efree(S->cols); in oci_stmt_dtor()
110 S->cols = NULL; in oci_stmt_dtor()
112 efree(S); in oci_stmt_dtor()
121 pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; in oci_stmt_execute() local
125 if (!S->stmt_type) { in oci_stmt_execute()
127 (S->stmt, OCI_HTYPE_STMT, &S->stmt_type, 0, OCI_ATTR_STMT_TYPE, S->err)); in oci_stmt_execute()
132 OCIStmtFetch(S->stmt, S->err, 0, OCI_FETCH_NEXT, OCI_DEFAULT); in oci_stmt_execute()
136 if (S->exec_type == OCI_STMT_SCROLLABLE_READONLY) { in oci_stmt_execute()
146 STMT_CALL(OCIStmtExecute, (S->H->svc, S->stmt, S->err, in oci_stmt_execute()
147 (S->stmt_type == OCI_STMT_SELECT && !S->have_blobs) ? 0 : 1, 0, NULL, NULL, in oci_stmt_execute()
156 (S->stmt, OCI_HTYPE_STMT, &colcount, 0, OCI_ATTR_PARAM_COUNT, S->err)); in oci_stmt_execute()
160 if (S->cols) { in oci_stmt_execute()
163 if (S->cols[i].data) { in oci_stmt_execute()
164 switch (S->cols[i].dtype) { in oci_stmt_execute()
170 efree(S->cols[i].data); in oci_stmt_execute()
174 efree(S->cols); in oci_stmt_execute()
177 S->cols = ecalloc(colcount, sizeof(pdo_oci_column)); in oci_stmt_execute()
181 (S->stmt, OCI_HTYPE_STMT, &rowcount, 0, OCI_ATTR_ROW_COUNT, S->err)); in oci_stmt_execute()
263 pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; in oci_stmt_param_hook() local
312 STMT_CALL(OCIBindByName, (S->stmt, in oci_stmt_param_hook()
313 &P->bind, S->err, (text*)param->name, in oci_stmt_param_hook()
318 STMT_CALL(OCIBindByPos, (S->stmt, in oci_stmt_param_hook()
319 &P->bind, S->err, param->paramno+1, in oci_stmt_param_hook()
326 S->err, in oci_stmt_param_hook()
337 STMT_CALL(OCIDescriptorAlloc, (S->H->env, &P->thing, OCI_DTYPE_LOB, 0, NULL)); in oci_stmt_param_hook()
338 STMT_CALL(OCIAttrSet, (P->thing, OCI_DTYPE_LOB, &empty, 0, OCI_ATTR_LOBEMPTY, S->err)); in oci_stmt_param_hook()
339 S->have_blobs = 1; in oci_stmt_param_hook()
377 OCILobOpen(S->H->svc, S->err, (OCILobLocator*)P->thing, OCI_LOB_READWRITE); in oci_stmt_param_hook()
389 OCILobOpen(S->H->svc, S->err, (OCILobLocator*)P->thing, OCI_LOB_READWRITE); in oci_stmt_param_hook()
399 OCILobWrite(S->H->svc, S->err, (OCILobLocator*)P->thing, in oci_stmt_param_hook()
408 OCILobClose(S->H->svc, S->err, (OCILobLocator*)P->thing); in oci_stmt_param_hook()
409 OCILobFlushBuffer(S->H->svc, S->err, (OCILobLocator*)P->thing, 0); in oci_stmt_param_hook()
415 OCILobOpen(S->H->svc, S->err, (OCILobLocator*)P->thing, OCI_LOB_READWRITE); in oci_stmt_param_hook()
418 OCILobWrite(S->H->svc, S->err, (OCILobLocator*)P->thing, in oci_stmt_param_hook()
425 OCILobClose(S->H->svc, S->err, (OCILobLocator*)P->thing); in oci_stmt_param_hook()
445 pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; in oci_stmt_fetch() local
456 S->last_err = OCIStmtFetch2(S->stmt, S->err, 1, ociori, offset, OCI_DEFAULT); in oci_stmt_fetch()
458 S->last_err = OCIStmtFetch(S->stmt, S->err, 1, OCI_FETCH_NEXT, OCI_DEFAULT); in oci_stmt_fetch()
461 if (S->last_err == OCI_NO_DATA) { in oci_stmt_fetch()
466 if (S->last_err == OCI_NEED_DATA) { in oci_stmt_fetch()
471 if (S->last_err == OCI_SUCCESS_WITH_INFO || S->last_err == OCI_SUCCESS) { in oci_stmt_fetch()
506 pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; in oci_stmt_describe() local
515 STMT_CALL(OCIParamGet, (S->stmt, OCI_HTYPE_STMT, S->err, (dvoid*)&param, colno+1)); in oci_stmt_describe()
519 (param, OCI_DTYPE_PARAM, &dtype, 0, OCI_ATTR_DATA_TYPE, S->err)); in oci_stmt_describe()
523 (param, OCI_DTYPE_PARAM, &data_size, 0, OCI_ATTR_DATA_SIZE, S->err)); in oci_stmt_describe()
527 (param, OCI_DTYPE_PARAM, &scale, 0, OCI_ATTR_SCALE, S->err)); in oci_stmt_describe()
531 (param, OCI_DTYPE_PARAM, &precis, 0, OCI_ATTR_PRECISION, S->err)); in oci_stmt_describe()
535 (param, OCI_DTYPE_PARAM, &colname, &namelen, OCI_ATTR_NAME, S->err)); in oci_stmt_describe()
542 S->cols[colno].dtype = dtype; in oci_stmt_describe()
553 S->cols[colno].datalen = 512; /* XXX should be INT_MAX and fetched by pieces */ in oci_stmt_describe()
554 S->cols[colno].data = emalloc(S->cols[colno].datalen + 1); in oci_stmt_describe()
561 … STMT_CALL(OCIDescriptorAlloc, (S->H->env, (dvoid**)&S->cols[colno].data, OCI_DTYPE_LOB, 0, NULL)); in oci_stmt_describe()
562 S->cols[colno].datalen = sizeof(OCILobLocator*); in oci_stmt_describe()
577 S->cols[colno].datalen = 512; in oci_stmt_describe()
580 S->cols[colno].datalen = 1024; in oci_stmt_describe()
583 S->cols[colno].datalen = col->maxlen; in oci_stmt_describe()
586 S->cols[colno].datalen *= 3; in oci_stmt_describe()
588 S->cols[colno].data = emalloc(S->cols[colno].datalen + 1); in oci_stmt_describe()
595 STMT_CALL(OCIDefineByPos, (S->stmt, &S->cols[colno].def, S->err, colno+1, in oci_stmt_describe()
596 S->cols[colno].data, S->cols[colno].datalen, dtype, &S->cols[colno].indicator, in oci_stmt_describe()
597 &S->cols[colno].fetched_len, &S->cols[colno].retcode, dyn ? OCI_DYNAMIC_FETCH : OCI_DEFAULT)); in oci_stmt_describe()
600 STMT_CALL(OCIDefineDynamic, (S->cols[colno].def, S->err, &S->cols[colno], in oci_stmt_describe()
609 pdo_oci_stmt *S; member
621 r = OCILobWrite(self->S->H->svc, self->S->err, self->lob, in oci_blob_write()
641 r = OCILobRead(self->S->H->svc, self->S->err, self->lob, in oci_blob_read()
662 OCILobClose(self->S->H->svc, self->S->err, self->lob); in oci_blob_close()
673 OCILobFlushBuffer(self->S->H->svc, self->S->err, self->lob, 0); in oci_blob_flush()
708 self->S = (pdo_oci_stmt*)stmt->driver_data; in oci_create_lob_stream()
723 pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; in oci_stmt_get_col() local
724 pdo_oci_column *C = &S->cols[colno]; in oci_stmt_get_col()
738 OCILobOpen(S->H->svc, S->err, (OCILobLocator*)C->data, OCI_LOB_READONLY); in oci_stmt_get_col()