dbGetLastErrorText#
Purpose#
Returns information about the last error that occurred on the database.
Format#
- last_error = dbGetLastErrorText(db_id)#
- Parameters:
db_id (scalar) – database connection index number.
- Returns:
last_error (string) – details of last error on the specified database.
Examples#
// Add MySQL to the list of database connections
db_id = dbAddDatabase("MYSQL");
dbSetDatabaseName(db_id, "mydb");
// Attempt to open the connection
ret = dbOpen(db_id);
// Check for errors if the open failed
if ret == 0;
err_text = dbGetLastErrorText(db_id);
print err_text;
endif;