SQLSTATE Constants

From MidrangeWiki
Revision as of 16:29, 7 June 2005 by TomHolden (talk | contribs)
Jump to: navigation, search

Here is a work-in-progress list of constant names for the SQLSTATE codes in RPG.

     D*? General Constants
     D SQL_FALSE       C                   0
     D SQL_TRUE        C                   1
     D SQL_NTS         C                   -3
     D SQL_STATE_SIZE  C                   5
     D SQL_MAX_MESSAGE_LENGTH...
     D                 C                   512
     D*?
     D*? Return Code Values
     D SQL_SUCCESS     C                   0
     D SQL_SUCCESS_WITH_INFO...
     D                 C                   1
     D SQL_NO_DATA_FOUND...
     D                 C                   100
     D SQL_NEED_DATA   C                   99
     D SQL_NO_DATA     C                   100
     D SQL_ERROR       C                   -1
     D SQL_INVALID_HANDLE...
     D                 C                   -2
     D*?
     D*? Standard SQL data types
     D SQL_ALL_TYPES   C                   0
     D SQL_CHAR        C                   1
     D SQL_NUMERIC     C                   2
     D SQL_DECIMAL     C                   3
     D SQL_INTEGER     C                   4
     D SQL_SMALLINT    C                   5
     D SQL_FLOAT       C                   6
     D SQL_REAL        C                   7
     D SQL_DOUBLE      C                   8
     D SQL_DATETIME    C                   9
     D SQL_VARCHAR     C                   12
     D SQL_LONGVARCHAR...
     D                 C                   12
     D SQL_BLOB        C                   13
     D SQL_CLOB        C                   14
     D SQL_DBCLOB      C                   15
     D SQL_DATALINK    C                   16
     D SQL_WCHAR       C                   17
     D SQL_WVARCHAR    C                   18
     D SQL_WLONGVARCHAR...
     D                 C                   18
     D SQL_BIGINT      C                   19
     D SQL_BLOB_LOCATOR...
     D                 C                   20
     D SQL_CLOB_LOCATOR...
     D                 C                   21
     D SQL_DBCLOB_LOCATOR...
     D                 C                   22
     D SQL_DATE        C                   91
     D SQL_TYPE_DATE   C                   91
     D SQL_CODE_DATE   C                   1
     D SQL_TIME        C                   92
     D SQL_TYPE_TIME   C                   92
     D SQL_CODE_TIME   C                   2
     D SQL_TIMESTAMP   C                   93
     D SQL_TYPE_TIMESTAMP...
     D                 C                   93
     D SQL_CODE_TIMESTAMP...
     D                 C                   3
     D SQL_GRAPHIC     C                   95
     D SQL_VARGRAPHIC  C                   96
     D SQL_LONGVARGRAPHIC...
     D                 C                   96
     D SQL_BINARY      C                   97
     D SQL_VARBINARY   C                   98
     D SQL_LONGVARBINARY...
     D                 C                   98
     D*?
     D*? Valid values for type in GetCol and BindToCol
     D SQL_DEFAULT     C                   99
     D SQL_ARD_TYPE    C                   -99
     D*?
     D*? Null status defines
     D SQL_UNUSED      C                   0
     D SQL_HANDLE_ENV  C                   1
     D SQL_HANDLE_DBC  C                   2
     D SQL_HANDLE_STMT...
     D                 C                   3
     D SQL_HANDLE_DESC...
     D                 C                   4
     D SQL_NULL_HANDLE...
     D                 C                   0
     D SQL_NO_NULLS    C                   0
     D SQL_NULLABLE    C                   1
     D SQL_NULLABLE_UNKNOWN...
     D                 C                   2
     D*?
     D*? Special length values
     D SQL_NULL_DATA   C                   -1
     D SQL_DATA_AT_EXEC...
     D                 C                   -2
     D SQL_BIGINT_PREC...
     D                 C                   19
     D SQL_INTEGER_PREC...
     D                 C                   10
     D SQL_SMALLINT_PREC...
     D                 C                   5
     D*?
     D*? Valid environment attributes
     D SQL_ATTR_OUTPUT_NTS...
     D                 C                   10001
     D SQL_ATTR_SYS_NAMING...
     D                 C                   10002
     D SQL_ATTR_DEFAULT_LIB...
     D                 C                   10003
     D SQL_ATTR_SERVER_MODE...
     D                 C                   10004
     D SQL_ATTR_JOB_SORT_SEQUENCE...
     D                 C                   10005
     D SQL_ATTR_ENVHNDL_COUNTER...
     D                 C                   10009
     D SQL_ATTR_ESCAPE_CHAR...
     D                 C                   10010
     D*?
     D*? Valid environment/connection attributes
     D SQL_ATTR_DATE_FMT...
     D                 C                   10020
     D SQL_ATTR_DATE_SEP...
     D                 C                   10021
     D SQL_ATTR_TIME_FMT...
     D                 C                   10022
     D SQL_ATTR_TIME_SEP...
     D                 C                   10023
     D SQL_ATTR_DECIMAL_SEP...
     D                 C                   10024
     D*?
     D*? Valid environment/connection attributes
     D SQL_FMT_ISO     C                   1
     D SQL_FMT_USA     C                   2
     D SQL_FMT_EUR     C                   3
     D SQL_FMT_JIS     C                   4
     D SQL_FMT_MDY     C                   5
     D SQL_FMT_DMY     C                   6
     D SQL_FMT_YMD     C                   7
     D SQL_FMT_JUL     C                   8
     D SQL_FMT_HMS     C                   9
     D SQL_FMT_JOB     C                   10
     D SQL_SEP_SLASH   C                   1
     D SQL_SEP_DASH    C                   2
     D SQL_SEP_PERIOD  C                   3
     D SQL_SEP_COMMA   C                   4
     D SQL_SEP_BLANK   C                   5
     D SQL_SEP_COLON   C                   6
     D SQL_SEP_JOB     C                   7
     D*?
     D*? Connection attributes
     D SQL_ATTR_AUTO_IPD...
     D                 C                   10001
     D SQL_ATTR_ACCESS_MODE...
     D                 C                   10002
     D SQL_ACCESS_MODE...
     D                 C                   10002
     D SQL_ATTR_AUTOCOMMIT...
     D                 C                   10003
     D SQL_AUTOCOMMIT...
     D                 C                   10003
     D SQL_ATTR_DBC_SYS_NAMING...
     D                 C                   10004
     D SQL_ATTR_DBC_DEFAULT_LIBRARY...
     D                 C                   10005
     D SQL_ATTR_COMMIT...
     D                 C                   0
     D SQL_MODE_READ_ONLY...
     D                 C                   0
     D SQL_AUTOCOMMIT_OFF...
     D                 C                   0
     D SQL_TXN_ISOLATION...
     D                 C                   0
     D SQL_MODE_READ_WRITE...
     D                 C                   1
     D SQL_MODE_DEFAULT...
     D                 C                   1
     D SQL_AUTOCOMMIT_ON...
     D                 C                   1
     D SQL_COMMIT_NONE...
     D                 C                   1
     D SQL_TXN_NO_COMMIT...
     D                 C                   1
     D SQL_TXN_NOCOMMIT...
     D                 C                   1
     D SQL_COMMIT_CHG...
     D                 C                   2
     D SQL_COMMIT_UR...
     D                 C                   2
     D SQL_TXN_READ_UNCOMMITED...
     D                 C                   2
     D SQL_COMMIT_CS...
     D                 C                   3
     D SQL_TXN_READ_COMMITED...
     D                 C                   3
     D SQL_COMMIT_ALL...
     D                 C                   4
     D SQL_COMMIT_RS...
     D                 C                   4
     D SQL_TXN_REPEATABLE_READ...
     D                 C                   4
     D SQL_COMMIT_RR...
     D                 C                   5
     D SQL_TXN_SERIALIZABLE...
     D                 C                   5
     D*?
     D*? Statement attributes
     D SQL_ATTR_APP_ROW_DESC...
     D                 C                   10010
     D SQL_ATTR_APP_PARAM_DESC...
     D                 C                   10011
     D SQL_ATTR_IMP_ROW_DESC...
     D                 C                   10012
     D SQL_ATTR_IMP_PARAM_DESC...
     D                 C                   10013
     D SQL_ATTR_FOR_FETCH_ONLY...
     D                 C                   10014
     D SQL_ATTR_CONCURRENCY...
     D                 C                   10014
     D SQL_CONCURRENCY...
     D                 C                   10014
     D SQL_ATTR_CURSOR_SCROLLABLE...
     D                 C                   10015
     D SQL_ATTR_ROWSET_SIZE...
     D                 C                   10016
     D SQL_ROWSET_SIZE...
     D                 C                   10016
     D*?
     D*? Null handles
     D SQL_NULL_HENV   C                   0
     D SQL_NULL_HDBC   C                   0
     D SQL_NULL_HSTMT  C                   0