﻿# SQLOP\_GET\_ERRMSG

__

**xcall SQL, SQLOP\_GET\_ERRMSG, cmdhdr, msg**

The SQLOP\_GET\_ERRMSG function returns the text error message associated with error occurring in the previous operation. 

**Parameters**

_cmdhdr_ (ST\_SQL\_CMDHDR), \[in/out\]

The fields of interest to this opcode in the _cmdhdr_ structure (defined in [SQL.DEF](https://bitbucket.org/microsabio/exlib/src/master/909060/sql.def)) are listed below.

| **Field** | **Dir** | **Notes** |
|------|------|------|
| handle | in | connection handled returned from SQLOP\_INIT\_CONN |
| dbmsconid | in | [DBMS Connector ID](dbmsconnectorid.md) |
| opflags | n/a |  |
| cmdarg1,2 | n/a |  |
| rc | out | SQLERR\_DBMSERR (this is the one case where a successful operation returns an error code and is intended to make application coding easier). If there is no connection, SQLERR\_NOCONN is returned. |
| rcext | n/a |  |
| info1,2 | n/a |  |
| sqlstate | out | ANSI standard SQL state code |
| reshdl | n/a |  |
| psthdl | in | Prepared statement handle should be set as for the statement that caused the error. |




_msg _\[string, out\]

The error message text corresponding to the error occurring in the previous operation is returned here. Will be null if no error in previous operation. 