ID: 13628 Updated by: kalowsky Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: ODBC related Operating System: PHP Version: 4.0.6 New Comment:
Fixed in CVS. Thanks for your report! Previous Comments: ------------------------------------------------------------------------ [2001-10-10 10:42:20] [EMAIL PROTECTED] After odbc_execute() call odbc_error doesn't return SQLSTATE (returns last occured SQLSTATE). The cause is that SQL_ERROR return code of SQLExecute() is not processed. Please change php_odbc.c near ------------------------- /* * Execute prepared SQL statement. Supports only input parameters. */ /* {{{ proto int odbc_execute(int result_id [, array parameters_array]) Execute a prepared statement */ PHP_FUNCTION(odbc_execute) ------------------------- ------------------------- rc = SQLExecute(result->stmt); result->fetched = 0; if (rc == SQL_NEED_DATA) { char buf[4096]; int fp, nbytes; while(rc == SQL_NEED_DATA) { rc = SQLParamData(result->stmt, (void*)&fp); if (rc == SQL_NEED_DATA) { while((nbytes = read(fp, &buf, 4096)) > 0) SQLPutData(result->stmt, (void*)&buf, nbytes); } } } else { switch (rc) { case SQL_SUCCESS: break; case SQL_NO_DATA_FOUND: case SQL_SUCCESS_WITH_INFO: odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); break; default: RETVAL_FALSE; } } ------------------------- ==========> ------------------------- rc = SQLExecute(result->stmt); result->fetched = 0; if (rc == SQL_NEED_DATA) { char buf[4096]; int fp, nbytes; while(rc == SQL_NEED_DATA) { rc = SQLParamData(result->stmt, (void*)&fp); if (rc == SQL_NEED_DATA) { while((nbytes = read(fp, &buf, 4096)) > 0) SQLPutData(result->stmt, (void*)&buf, nbytes); } } } else { switch (rc) { case SQL_SUCCESS: break; case SQL_NO_DATA_FOUND: case SQL_SUCCESS_WITH_INFO: odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); break; default: odbc_sql_error(result->conn_ptr, result->stmt, "SQLExecute"); RETVAL_FALSE; } } ------------------------- With best regards, Alexander Veremyev. ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13628&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]