Lines Matching refs:S
34 S->last_err = name params; \
35 …S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name, S->last_err, FALSE, __FILE__, __LINE__); \
36 if (S->last_err) { \
43 S->last_err = name params; \
44 …S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name ": " #msg, S->last_err, FALSE, __FILE__, _…
45 if (S->last_err) { \
63 pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; in oci_stmt_dtor() local
69 if (S->stmt) { in oci_stmt_dtor()
72 OCIStmtFetch(S->stmt, S->err, 0, OCI_FETCH_NEXT, OCI_DEFAULT); in oci_stmt_dtor()
75 OCIHandleFree(S->stmt, OCI_HTYPE_STMT); in oci_stmt_dtor()
76 S->stmt = NULL; in oci_stmt_dtor()
78 if (S->err) { in oci_stmt_dtor()
79 OCIHandleFree(S->err, OCI_HTYPE_ERROR); in oci_stmt_dtor()
80 S->err = NULL; in oci_stmt_dtor()
96 if (S->einfo.errmsg) { in oci_stmt_dtor()
97 pefree(S->einfo.errmsg, stmt->dbh->is_persistent); in oci_stmt_dtor()
98 S->einfo.errmsg = NULL; in oci_stmt_dtor()
101 if (S->cols) { in oci_stmt_dtor()
103 if (S->cols[i].data) { in oci_stmt_dtor()
104 switch (S->cols[i].dtype) { in oci_stmt_dtor()
107 OCI_TEMPLOB_CLOSE(S->H->env, S->H->svc, S->H->err, in oci_stmt_dtor()
108 (OCILobLocator *) S->cols[i].data); in oci_stmt_dtor()
109 OCIDescriptorFree(S->cols[i].data, OCI_DTYPE_LOB); in oci_stmt_dtor()
112 efree(S->cols[i].data); in oci_stmt_dtor()
116 efree(S->cols); in oci_stmt_dtor()
117 S->cols = NULL; in oci_stmt_dtor()
119 efree(S); in oci_stmt_dtor()
128 pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; in oci_stmt_execute() local
132 if (!S->stmt_type) { in oci_stmt_execute()
134 (S->stmt, OCI_HTYPE_STMT, &S->stmt_type, 0, OCI_ATTR_STMT_TYPE, S->err)); in oci_stmt_execute()
139 OCIStmtFetch(S->stmt, S->err, 0, OCI_FETCH_NEXT, OCI_DEFAULT); in oci_stmt_execute()
143 if (S->exec_type == OCI_STMT_SCROLLABLE_READONLY) { in oci_stmt_execute()
153 STMT_CALL(OCIStmtExecute, (S->H->svc, S->stmt, S->err, in oci_stmt_execute()
154 (S->stmt_type == OCI_STMT_SELECT && !S->have_blobs) ? 0 : 1, 0, NULL, NULL, in oci_stmt_execute()
163 (S->stmt, OCI_HTYPE_STMT, &colcount, 0, OCI_ATTR_PARAM_COUNT, S->err)); in oci_stmt_execute()
167 if (S->cols) { in oci_stmt_execute()
170 if (S->cols[i].data) { in oci_stmt_execute()
171 switch (S->cols[i].dtype) { in oci_stmt_execute()
177 efree(S->cols[i].data); in oci_stmt_execute()
181 efree(S->cols); in oci_stmt_execute()
184 S->cols = ecalloc(colcount, sizeof(pdo_oci_column)); in oci_stmt_execute()
188 (S->stmt, OCI_HTYPE_STMT, &rowcount, 0, OCI_ATTR_ROW_COUNT, S->err)); in oci_stmt_execute()
275 pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; in oci_stmt_param_hook() local
300 OCI_TEMPLOB_CLOSE(S->H->env, S->H->svc, S->H->err, P->thing); in oci_stmt_param_hook()
336 STMT_CALL(OCIBindByName, (S->stmt, in oci_stmt_param_hook()
337 &P->bind, S->err, (text*)param->name->val, in oci_stmt_param_hook()
342 STMT_CALL(OCIBindByPos, (S->stmt, in oci_stmt_param_hook()
343 &P->bind, S->err, ((ub4)param->paramno)+1, in oci_stmt_param_hook()
350 S->err, in oci_stmt_param_hook()
361 STMT_CALL(OCIDescriptorAlloc, (S->H->env, &P->thing, OCI_DTYPE_LOB, 0, NULL)); in oci_stmt_param_hook()
362 STMT_CALL(OCIAttrSet, (P->thing, OCI_DTYPE_LOB, &empty, 0, OCI_ATTR_LOBEMPTY, S->err)); in oci_stmt_param_hook()
363 S->have_blobs = 1; in oci_stmt_param_hook()
391 OCILobOpen(S->H->svc, S->err, (OCILobLocator*)P->thing, OCI_LOB_READWRITE); in oci_stmt_param_hook()
402 OCILobOpen(S->H->svc, S->err, (OCILobLocator*)P->thing, OCI_LOB_READWRITE); in oci_stmt_param_hook()
412 OCILobWrite(S->H->svc, S->err, (OCILobLocator*)P->thing, in oci_stmt_param_hook()
421 OCILobClose(S->H->svc, S->err, (OCILobLocator*)P->thing); in oci_stmt_param_hook()
422 OCILobFlushBuffer(S->H->svc, S->err, (OCILobLocator*)P->thing, 0); in oci_stmt_param_hook()
428 OCILobOpen(S->H->svc, S->err, (OCILobLocator*)P->thing, OCI_LOB_READWRITE); in oci_stmt_param_hook()
431 OCILobWrite(S->H->svc, S->err, (OCILobLocator*)P->thing, in oci_stmt_param_hook()
438 OCILobClose(S->H->svc, S->err, (OCILobLocator*)P->thing); in oci_stmt_param_hook()
441 OCI_TEMPLOB_CLOSE(S->H->env, S->H->svc, S->H->err, P->thing); in oci_stmt_param_hook()
459 pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; in oci_stmt_fetch() local
470 S->last_err = OCIStmtFetch2(S->stmt, S->err, 1, ociori, (sb4) offset, OCI_DEFAULT); in oci_stmt_fetch()
472 S->last_err = OCIStmtFetch(S->stmt, S->err, 1, OCI_FETCH_NEXT, OCI_DEFAULT); in oci_stmt_fetch()
475 if (S->last_err == OCI_NO_DATA) { in oci_stmt_fetch()
480 if (S->last_err == OCI_NEED_DATA) { in oci_stmt_fetch()
485 if (S->last_err == OCI_SUCCESS_WITH_INFO || S->last_err == OCI_SUCCESS) { in oci_stmt_fetch()
515 pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; in oci_stmt_describe() local
524 STMT_CALL(OCIParamGet, (S->stmt, OCI_HTYPE_STMT, S->err, (dvoid*)¶m, colno+1)); in oci_stmt_describe()
528 (param, OCI_DTYPE_PARAM, &dtype, 0, OCI_ATTR_DATA_TYPE, S->err)); in oci_stmt_describe()
532 (param, OCI_DTYPE_PARAM, &data_size, 0, OCI_ATTR_DATA_SIZE, S->err)); in oci_stmt_describe()
536 (param, OCI_DTYPE_PARAM, &precis, 0, OCI_ATTR_PRECISION, S->err)); in oci_stmt_describe()
540 (param, OCI_DTYPE_PARAM, &colname, &namelen, OCI_ATTR_NAME, S->err)); in oci_stmt_describe()
546 S->cols[colno].dtype = dtype; in oci_stmt_describe()
557 S->cols[colno].datalen = 512; /* XXX should be INT_MAX and fetched by pieces */ in oci_stmt_describe()
558 S->cols[colno].data = emalloc(S->cols[colno].datalen + 1); in oci_stmt_describe()
563 … STMT_CALL(OCIDescriptorAlloc, (S->H->env, (dvoid**)&S->cols[colno].data, OCI_DTYPE_LOB, 0, NULL)); in oci_stmt_describe()
564 S->cols[colno].datalen = sizeof(OCILobLocator*); in oci_stmt_describe()
579 S->cols[colno].datalen = 512; in oci_stmt_describe()
582 S->cols[colno].datalen = 1024; in oci_stmt_describe()
585 S->cols[colno].datalen = (ub4) col->maxlen * 2; /* raw characters to hex digits */ in oci_stmt_describe()
587 S->cols[colno].datalen = (ub4) (col->maxlen * S->H->max_char_width); in oci_stmt_describe()
590 S->cols[colno].data = emalloc(S->cols[colno].datalen + 1); in oci_stmt_describe()
594 STMT_CALL(OCIDefineByPos, (S->stmt, &S->cols[colno].def, S->err, colno+1, in oci_stmt_describe()
595 S->cols[colno].data, S->cols[colno].datalen, dtype, &S->cols[colno].indicator, in oci_stmt_describe()
596 &S->cols[colno].fetched_len, &S->cols[colno].retcode, dyn ? OCI_DYNAMIC_FETCH : OCI_DEFAULT)); in oci_stmt_describe()
599 STMT_CALL(OCIDefineDynamic, (S->cols[colno].def, S->err, &S->cols[colno], in oci_stmt_describe()
615 pdo_oci_stmt *S; member
734 self->S = (pdo_oci_stmt*)stmt->driver_data; in oci_create_lob_stream()
736 self->E->svc = self->S->H->svc; in oci_create_lob_stream()
737 self->E->err = self->S->err; in oci_create_lob_stream()
739 OCILobCharSetForm(self->S->H->env, self->S->err, self->lob, &self->csfrm); in oci_create_lob_stream()
757 pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; in oci_stmt_get_col() local
758 pdo_oci_column *C = &S->cols[colno]; in oci_stmt_get_col()
771 OCILobOpen(S->H->svc, S->err, (OCILobLocator*)C->data, OCI_LOB_READONLY); in oci_stmt_get_col()
791 pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; in oci_stmt_col_meta() local
797 if (!S->stmt) { in oci_stmt_col_meta()
809 STMT_CALL(OCIParamGet, (S->stmt, OCI_HTYPE_STMT, S->err, (dvoid*)¶m, colno+1)); in oci_stmt_col_meta()
813 (param, OCI_DTYPE_PARAM, &dtype, 0, OCI_ATTR_DATA_TYPE, S->err)); in oci_stmt_col_meta()
817 (param, OCI_DTYPE_PARAM, &precis, 0, OCI_ATTR_PRECISION, S->err)); in oci_stmt_col_meta()
821 (param, OCI_DTYPE_PARAM, &scale, 0, OCI_ATTR_SCALE, S->err)); in oci_stmt_col_meta()
826 (param, OCI_DTYPE_PARAM, &charset_form, 0, OCI_ATTR_CHARSET_FORM, S->err)); in oci_stmt_col_meta()
965 (param, OCI_DTYPE_PARAM, &isnull, 0, OCI_ATTR_IS_NULL, S->err)); in oci_stmt_col_meta()