Lines Matching refs:stmt
33 #define RECORD_ERROR(stmt) _firebird_error(NULL, stmt, __FILE__, __LINE__ TSRMLS_CC) argument
51 static int firebird_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ in firebird_stmt_dtor()
53 pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; in firebird_stmt_dtor()
57 if (isc_dsql_free_statement(S->H->isc_status, &S->stmt, DSQL_drop)) { in firebird_stmt_dtor()
58 RECORD_ERROR(stmt); in firebird_stmt_dtor()
87 static int firebird_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ in firebird_stmt_execute()
89 pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; in firebird_stmt_execute()
97 …if ((*S->name || S->cursor_open) && isc_dsql_free_statement(H->isc_status, &S->stmt, DSQL_close)) { in firebird_stmt_execute()
103 if (isc_dsql_execute(H->isc_status, &H->tr, &S->stmt, PDO_FB_SQLDA_VERSION, S->in_sqlda)) { in firebird_stmt_execute()
110 stmt->row_count = affected_rows; in firebird_stmt_execute()
117 if (isc_dsql_sql_info(H->isc_status, &S->stmt, sizeof ( info_count), in firebird_stmt_execute()
130 stmt->row_count = affected_rows; in firebird_stmt_execute()
137 if (stmt->dbh->auto_commit && isc_commit_retaining(H->isc_status, &H->tr)) { in firebird_stmt_execute()
148 RECORD_ERROR(stmt); in firebird_stmt_execute()
155 static int firebird_stmt_fetch(pdo_stmt_t *stmt, /* {{{ */ in firebird_stmt_fetch() argument
158 pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; in firebird_stmt_fetch()
161 if (!stmt->executed) { in firebird_stmt_fetch()
162 strcpy(stmt->error_code, "HY000"); in firebird_stmt_fetch()
165 if (isc_dsql_fetch(H->isc_status, &S->stmt, PDO_FB_SQLDA_VERSION, &S->out_sqlda)) { in firebird_stmt_fetch()
167 RECORD_ERROR(stmt); in firebird_stmt_fetch()
175 stmt->row_count++; in firebird_stmt_fetch()
183 static int firebird_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{ */ in firebird_stmt_describe() argument
185 pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; in firebird_stmt_describe()
186 struct pdo_column_data *col = &stmt->columns[colno]; in firebird_stmt_describe()
221 static int firebird_fetch_blob(pdo_stmt_t *stmt, int colno, char **ptr, /* {{{ */ in firebird_fetch_blob() argument
224 pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; in firebird_fetch_blob()
233 RECORD_ERROR(stmt); in firebird_fetch_blob()
239 RECORD_ERROR(stmt); in firebird_fetch_blob()
291 RECORD_ERROR(stmt); in firebird_fetch_blob()
298 static int firebird_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, /* {{{ */ in firebird_stmt_get_col() argument
301 pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; in firebird_stmt_get_col()
402 return firebird_fetch_blob(stmt,colno,ptr,len, in firebird_stmt_get_col()
411 static int firebird_bind_blob(pdo_stmt_t *stmt, ISC_QUAD *blob_id, zval *param TSRMLS_DC) in firebird_bind_blob() argument
413 pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; in firebird_bind_blob()
421 RECORD_ERROR(stmt); in firebird_bind_blob()
434 RECORD_ERROR(stmt); in firebird_bind_blob()
444 RECORD_ERROR(stmt); in firebird_bind_blob()
450 static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, /* {{{ */ in firebird_stmt_param_hook() argument
453 pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; in firebird_stmt_param_hook()
462 strcpy(stmt->error_code, "HY093"); in firebird_stmt_param_hook()
488 strcpy(stmt->error_code, "HY093"); in firebird_stmt_param_hook()
522 strcpy(stmt->error_code, "HY000"); in firebird_stmt_param_hook()
527 return firebird_bind_blob(stmt, (ISC_QUAD*)var->sqldata, in firebird_stmt_param_hook()
572 strcpy(stmt->error_code, "HY105"); in firebird_stmt_param_hook()
579 strcpy(stmt->error_code, "HY105"); in firebird_stmt_param_hook()
596 if (firebird_stmt_get_col(stmt, param->paramno, &value, &value_len, &caller_frees TSRMLS_CC)) { in firebird_stmt_param_hook()
633 static int firebird_stmt_set_attribute(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC) /* {{{ */ in firebird_stmt_set_attribute() argument
635 pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; in firebird_stmt_set_attribute()
643 if (isc_dsql_set_cursor_name(S->H->isc_status, &S->stmt, Z_STRVAL_P(val),0)) { in firebird_stmt_set_attribute()
644 RECORD_ERROR(stmt); in firebird_stmt_set_attribute()
654 static int firebird_stmt_get_attribute(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC) /* {{{ */ in firebird_stmt_get_attribute() argument
656 pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; in firebird_stmt_get_attribute()
673 static int firebird_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ in firebird_stmt_cursor_closer()
675 pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; in firebird_stmt_cursor_closer()
678 …if ((*S->name || S->cursor_open) && isc_dsql_free_statement(S->H->isc_status, &S->stmt, DSQL_close… in firebird_stmt_cursor_closer()
679 RECORD_ERROR(stmt); in firebird_stmt_cursor_closer()