diff options
author | Bernard Duggan <[email protected]> | 2012-07-25 17:36:40 +1000 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2012-12-04 10:49:39 +0100 |
commit | 66c6cede2b5039ca05ad57d3da3b76a5b8e9da47 (patch) | |
tree | 073042ea7f65bc7791445edecfa789deb80412cb /lib/odbc/c_src/odbcserver.h | |
parent | b563c7967185969e0607a4139a2132312581ff08 (diff) | |
download | otp-66c6cede2b5039ca05ad57d3da3b76a5b8e9da47.tar.gz otp-66c6cede2b5039ca05ad57d3da3b76a5b8e9da47.tar.bz2 otp-66c6cede2b5039ca05ad57d3da3b76a5b8e9da47.zip |
Add extended_errors option to ODBC
This patch adds the extended_errors option to odbc:connect/2. When
enabled, this option alters the return code of ODBC operations that
produce errors to include the ODBC error code as well as the native
error code, in addition to the ODBC reason field which is returned by
default. The extended error information can be used to produce more
sophisticated error handling than is possible with the standard ODBC
Reason alone.
Diffstat (limited to 'lib/odbc/c_src/odbcserver.h')
-rw-r--r-- | lib/odbc/c_src/odbcserver.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/odbc/c_src/odbcserver.h b/lib/odbc/c_src/odbcserver.h index a76cedf1af..71760189e7 100644 --- a/lib/odbc/c_src/odbcserver.h +++ b/lib/odbc/c_src/odbcserver.h @@ -145,6 +145,7 @@ typedef struct { typedef struct { SQLCHAR sqlState[SQL_STATE_SIZE]; + SQLINTEGER nativeError; byte error_msg[MAX_ERR_MSG]; } diagnos; @@ -179,6 +180,7 @@ typedef struct { Boolean exists_more_result_sets; Boolean param_query; Boolean out_params; + Boolean extended_errors; } db_state; typedef enum { @@ -198,3 +200,5 @@ typedef enum { #define exists_more_result_sets(db_state) (db_state -> exists_more_result_sets) #define param_query(db_state) (db_state -> param_query) #define out_params(db_state) (db_state -> out_params) +#define extended_errors(db_state) (db_state -> extended_errors) +#define extended_error(db_state, errorcode) ( extended_errors(state) ? errorcode : NULL ) |