db2_stmt_error

(PECL ibm_db2 >= 1.0.0)

db2_stmt_error Returns a string containing the SQLSTATE returned by an SQL statement

说明

db2_stmt_error ([ resource $stmt ] ) : string

Returns a string containing the SQLSTATE value returned by an SQL statement.

If you do not pass a statement resource as an argument to db2_stmt_error(), the driver returns the SQLSTATE value associated with the last attempt to return a statement resource, for example, from db2_prepare() or db2_exec().

To learn what the SQLSTATE value means, you can issue the following command at a DB2 Command Line Processor prompt: db2 '? sqlstate-value'. You can also call db2_stmt_errormsg() to retrieve an explicit error message and the associated SQLCODE value.

参数

stmt

A valid statement resource.

返回值

Returns a string containing an SQLSTATE value.

参见

  • db2_conn_error() - Returns a string containing the SQLSTATE returned by the last connection attempt
  • db2_conn_errormsg() - Returns the last connection error message and SQLCODE value
  • db2_stmt_errormsg() - Returns a string containing the last SQL statement error message

相关文章
php cubrid mysql 兼容性函数 escape special characters in a string for use in an sql statementphp ibm db2 函数 binds a php variable to an sql statement parameterphp ibm db2 函数 returns a string containing the sqlstate returned by the last connection attemptphp ibm db2 函数 returns the cursor type used by a statement resourcephp ibm db2 函数 executes an sql statement directlyphp ibm db2 函数 executes a prepared sql statementphp ibm db2 函数 returns an array indexed by column position representing a row in a result setphp ibm db2 函数 returns a result set listing the foreign keys for a tablephp ibm db2 函数 frees resources associated with the indicated statement resourcephp ibm db2 函数 retrieves an option value for a statement resource or a connection resourcephp ibm db2 函数 returns the auto generated id of the last insert query that successfully executed on this connectionphp ibm db2 函数 returns the number of rows affected by an sql statementphp ibm db2 函数 prepares an sql statement to be executedphp ibm db2 函数 returns an object with properties that describe the db2 database serverphp ibm db2 函数 set options for connection or statement resourcesphp ibm db2 函数 returns a result set listing the unique row identifier columns for a tablephp ibm db2 函数 returns a string containing the sqlstate returned by an sql statementphp ibm db2 函数 returns a string containing the last sql statement error messagephp maxdb 函数 escapes special characters in a string for use in an sql statement taking into account the current charset of the connectionphp maxdb 函数 returns sqlstate error from previous statement operation
关注编程学问公众号