Interested in improving this site? Please check the To Do page.

Back to MySQL Verbs

mysql.getSQLSTATE

Get industry-standard SQLSTATE error code

Syntax

mysql.getSQLState(dbid)

Params

A database connection id

Returns

A string containing the SQLSTATE error code for the most recently executed SQL statement.

Examples

dialog.alert("SQLSTATE: " + mysql.getSQLSTATE(id))
	 ยป SQLSTATE: 00000

Notes

From the MySQL documentation page:

Returns a null-terminated string containing the SQLSTATE error code for the most recently executed SQL statement. The error code consists of five characters. ‘00000’ means “no error”. The values are specified by ANSI SQL and ODBC.

See Also


Personal Tools