Lines Matching refs:stmt

60 static int pdo_odbc_utf82ucs2(pdo_stmt_t *stmt, int is_unicode, const char *buf,   in pdo_odbc_utf82ucs2()  argument
65 pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; in pdo_odbc_utf82ucs2()
95 static int pdo_odbc_ucs22utf8(pdo_stmt_t *stmt, int is_unicode, const char *buf, in pdo_odbc_ucs22utf8() argument
100 pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; in pdo_odbc_ucs22utf8()
126 static void free_cols(pdo_stmt_t *stmt, pdo_odbc_stmt *S TSRMLS_DC) in free_cols() argument
131 for (i = 0; i < stmt->column_count; i++) { in free_cols()
141 static int odbc_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) in odbc_stmt_dtor()
143 pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; in odbc_stmt_dtor()
145 if (S->stmt != SQL_NULL_HANDLE) { in odbc_stmt_dtor()
146 if (stmt->executed) { in odbc_stmt_dtor()
147 SQLCloseCursor(S->stmt); in odbc_stmt_dtor()
149 SQLFreeHandle(SQL_HANDLE_STMT, S->stmt); in odbc_stmt_dtor()
150 S->stmt = SQL_NULL_HANDLE; in odbc_stmt_dtor()
153 free_cols(stmt, S TSRMLS_CC); in odbc_stmt_dtor()
162 static int odbc_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) in odbc_stmt_execute()
165 pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; in odbc_stmt_execute()
169 if (stmt->executed) { in odbc_stmt_execute()
170 SQLCloseCursor(S->stmt); in odbc_stmt_execute()
173 rc = SQLExecute(S->stmt); in odbc_stmt_execute()
178 rc = SQLParamData(S->stmt, (SQLPOINTER*)&param); in odbc_stmt_execute()
190 switch (pdo_odbc_utf82ucs2(stmt, P->is_unicode, in odbc_stmt_execute()
195 SQLPutData(S->stmt, Z_STRVAL_P(param->parameter), in odbc_stmt_execute()
199 SQLPutData(S->stmt, S->convbuf, ulen); in odbc_stmt_execute()
203 SQLCloseCursor(S->stmt); in odbc_stmt_execute()
219 SQLCloseCursor(S->stmt); in odbc_stmt_execute()
236 SQLPutData(S->stmt, buf, len); in odbc_stmt_execute()
258 SQLRowCount(S->stmt, &row_count); in odbc_stmt_execute()
259 stmt->row_count = row_count; in odbc_stmt_execute()
261 if (!stmt->executed) { in odbc_stmt_execute()
266 SQLNumResultCols(S->stmt, &colcount); in odbc_stmt_execute()
268 stmt->column_count = (int)colcount; in odbc_stmt_execute()
276 static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, in odbc_stmt_param_hook() argument
279 pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; in odbc_stmt_param_hook()
316 …rc = SQLDescribeParam(S->stmt, (SQLUSMALLINT) param->paramno+1, &sqltype, &precision, &scale, &nul… in odbc_stmt_param_hook()
373 rc = SQLBindParameter(S->stmt, (SQLUSMALLINT) param->paramno+1, in odbc_stmt_param_hook()
449 switch (pdo_odbc_utf82ucs2(stmt, P->is_unicode, in odbc_stmt_param_hook()
484 switch (pdo_odbc_ucs22utf8(stmt, P->is_unicode, P->outbuf, P->len, &ulen)) { in odbc_stmt_param_hook()
510 static int odbc_stmt_fetch(pdo_stmt_t *stmt, in odbc_stmt_fetch() argument
515 pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; in odbc_stmt_fetch()
525 strcpy(stmt->error_code, "HY106"); in odbc_stmt_fetch()
528 rc = SQLFetchScroll(S->stmt, odbcori, offset); in odbc_stmt_fetch()
548 static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) in odbc_stmt_describe() argument
550 pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; in odbc_stmt_describe()
551 struct pdo_column_data *col = &stmt->columns[colno]; in odbc_stmt_describe()
557 rc = SQLDescribeCol(S->stmt, colno+1, S->cols[colno].colname, in odbc_stmt_describe()
568 rc = SQLColAttribute(S->stmt, colno+1, in odbc_stmt_describe()
595 rc = SQLBindCol(S->stmt, colno+1, in odbc_stmt_describe()
615 static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *call… in odbc_stmt_get_col() argument
617 pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; in odbc_stmt_get_col()
631 rc = SQLGetData(S->stmt, colno+1, C->is_unicode ? SQL_C_BINARY : SQL_C_CHAR, C->data, in odbc_stmt_get_col()
658 rc = SQLGetData(S->stmt, colno+1, SQL_C_CHAR, buf2, 256, &C->fetched_len); in odbc_stmt_get_col()
722 switch (pdo_odbc_ucs22utf8(stmt, C->is_unicode, *ptr, *len, &ulen)) { in odbc_stmt_get_col()
742 static int odbc_stmt_set_param(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC) in odbc_stmt_set_param() argument
745 pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; in odbc_stmt_set_param()
750 rc = SQLSetCursorName(S->stmt, Z_STRVAL_P(val), Z_STRLEN_P(val)); in odbc_stmt_set_param()
769 static int odbc_stmt_get_attr(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC) in odbc_stmt_get_attr() argument
772 pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; in odbc_stmt_get_attr()
779 rc = SQLGetCursorName(S->stmt, buf, sizeof(buf), &len); in odbc_stmt_get_attr()
801 static int odbc_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) in odbc_stmt_next_rowset()
805 pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; in odbc_stmt_next_rowset()
810 rc = SQLMoreResults(S->stmt); in odbc_stmt_next_rowset()
816 free_cols(stmt, S TSRMLS_CC); in odbc_stmt_next_rowset()
818 SQLNumResultCols(S->stmt, &colcount); in odbc_stmt_next_rowset()
819 stmt->column_count = (int)colcount; in odbc_stmt_next_rowset()