![]() | ![]() |
Home |
|
|
Open Client Client-Library/C Reference Manual |
|
| Chapter 2 Topics |
|
| Client-Library and SQL Structures |
|
| SQLCODE structure |
A SQLCODE structure is used in conjunction with ct_diag to retrieve Client-Library and server error and informational message codes.
An application must declare a SQLCODE structure as a long integer.
Client-Library always sets SQLCODE and the sqlcode field of the SQLCA structure identically.
Mapping server messages to SQLCODEA server message number is mapped to a SQLCODE of 0 if it has a severity of 0.
Other server messages may also be mapped to a SQLCODE of 0.
Server message numbers are inverted before being placed into SQLCODE. This ensures that SQLCODE is negative if an error has occurred.
For a list of server messages, execute the Transact-SQL statement:
select * from sysmessagesMapping Client-Library messages to SQLCODE
The Client-Library message "No rows affected" is mapped to a SQLCODE of 100.
Client-Library messages with CS_SV_INFORM severities are mapped to a SQLCODE of 0.
Other Client-Library messages may also be mapped to a SQLCODE of 0.
Client-Library message numbers are inverted before being placed into SQLCODE. This ensures that SQLCODE is negative if an error has occurred.
See "Client-Library message numbers".
|
|