mirror of
https://github.com/postgres/postgres.git
synced 2025-08-19 23:22:23 +03:00
Make ecpg SQLSTATE-aware. Map existing SQLCODE assignments to SQLSTATEs,
rather than parsing the message. Add some documentation about embedded SQL.
This commit is contained in:
@@ -98,4 +98,30 @@ PGresult **
|
||||
bool ECPGstore_result(const PGresult *results, int act_field,
|
||||
const struct statement * stmt, struct variable * var);
|
||||
|
||||
/* SQLSTATE values generated or processed by ecpglib (intentionally
|
||||
* not exported -- users should refer to the codes directly) */
|
||||
|
||||
#define ECPG_SQLSTATE_NO_DATA "02000"
|
||||
#define ECPG_SQLSTATE_USING_CLAUSE_DOES_NOT_MATCH_PARAMETERS "07001"
|
||||
#define ECPG_SQLSTATE_USING_CLAUSE_DOES_NOT_MATCH_TARGETS "07002"
|
||||
#define ECPG_SQLSTATE_RESTRICTED_DATA_TYPE_ATTRIBUTE_VIOLATION "07006"
|
||||
#define ECPG_SQLSTATE_INVALID_DESCRIPTOR_INDEX "07009"
|
||||
#define ECPG_SQLSTATE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION "08001"
|
||||
#define ECPG_SQLSTATE_CONNECTION_DOES_NOT_EXIST "08003"
|
||||
#define ECPG_SQLSTATE_TRANSACTION_RESOLUTION_UNKNOWN "08007"
|
||||
#define ECPG_SQLSTATE_CARDINALITY_VIOLATION "21000"
|
||||
#define ECPG_SQLSTATE_NULL_VALUE_NO_INDICATOR_PARAMETER "22002"
|
||||
#define ECPG_SQLSTATE_ACTIVE_SQL_TRANSACTION "25001"
|
||||
#define ECPG_SQLSTATE_NO_ACTIVE_SQL_TRANSACTION "25P01"
|
||||
#define ECPG_SQLSTATE_INVALID_SQL_STATEMENT_NAME "26000"
|
||||
#define ECPG_SQLSTATE_INVALID_SQL_DESCRIPTOR_NAME "33000"
|
||||
#define ECPG_SQLSTATE_INVALID_CURSOR_NAME "34000"
|
||||
#define ECPG_SQLSTATE_SYNTAX_ERROR "42601"
|
||||
#define ECPG_SQLSTATE_DATATYPE_MISMATCH "42804"
|
||||
#define ECPG_SQLSTATE_DUPLICATE_CURSOR "42P03"
|
||||
|
||||
/* implementation-defined internal errors of ecpg */
|
||||
#define ECPG_SQLSTATE_ECPG_INTERNAL_ERROR "YE000"
|
||||
#define ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY "YE001"
|
||||
|
||||
#endif /* _ECPG_LIB_EXTERN_H */
|
||||
|
Reference in New Issue
Block a user