From 3a5e5ca4d483a4862f974c11c1924b059978d18d Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Fri, 21 May 2004 16:17:22 +0000 Subject: [PATCH] Implement ODBC doer. --- ext/pdo_odbc/odbc_driver.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c index 3638e5e8015..8ab670ac7c9 100755 --- a/ext/pdo_odbc/odbc_driver.c +++ b/ext/pdo_odbc/odbc_driver.c @@ -97,8 +97,22 @@ static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, p static long odbc_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC) { pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; + RETCODE rc; + long row_count; - return 0; + rc = SQLExecDirect(H->dbc, (char *)sql, sql_len); + if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { + /* XXX error reporting needed */ + return 0; + } + + rc = SQLRowCount(H->dbc, &row_count); + if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { + /* XXX error reporting needed */ + return 0; + } + + return row_count; } static int odbc_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen TSRMLS_DC)