diff --git a/c/odbc-constants.c b/c/odbc-constants.c index 081c704..9fe300a 100644 --- a/c/odbc-constants.c +++ b/c/odbc-constants.c @@ -1,12 +1,2608 @@ +c#include "sql.h" +#include "sqlext.h" +#include #include -#include -#include -int main(void) -{ +/* constants for scheme-const and scheme-module files */ +#define scm_out "odbc_const.scm" +#define module_out "packages.scm" - /* do the trick */ -#include "constants.c" +FILE *scm_output; +FILE *module_output; + +/* write define-"intro" to scheme-const output (scm_out) */ +void open_enumerated_type(char* typ_name) { + + /* scheme-const output */ + fprintf(scm_output, "(define-finite-type %s :%s\n", typ_name, typ_name); + fprintf(scm_output, " (id)\n"); + fprintf(scm_output, " %s?\n",typ_name); + fprintf(scm_output, " %s-elements\n",typ_name); + fprintf(scm_output, " %s-name\n",typ_name); + fprintf(scm_output, " %s-index\n",typ_name); + fprintf(scm_output, " (id c-value)\n"); + fprintf(scm_output, " ("); + + /* scheme-module output */ + fprintf(module_output, "%s?\n ", typ_name); + fprintf(module_output, "(%s :syntax)\n ", typ_name); + + return; +} + + +#define enumerated_type_value(X,Y) \ + enumerated_type_fun(X, Y, #Y); + +/* mainpart: value definition for enumerated type */ +void enumerated_type_fun(char* scheme_name, long val, + char* const_name) { + + /* output */ + printf("."); + fprintf(scm_output, "(%-35s%12i)\t; %s\n",scheme_name,val,const_name); + fprintf(scm_output, " "); + + return; +} + + +/* getting that enumerated type to an end... */ +void close_enumerated_type() { + + /* scheme-const output */ + fprintf(scm_output, "))\n\n"); + + /* scheme-module output */ + fprintf(module_output, "\n "); + + return; +} + + +#define single_value(X) \ + single_value_fun(#X, X); + +/* if there's just a one-and-only odbc-const */ +void single_value_fun(char const_name[], long val) { + + /* extract typ_name (applying Scheme-conventions) */ + char *typ_name; + + if ((typ_name = (char *) calloc(sizeof(char), strlen(const_name)+sizeof(char))) == NULL) + + /* exit from c-code + user feedback */ + printf('\nError: Could not allocate enough memory.\n'); + exit(0); + + + strcpy(typ_name, const_name); + + /* create scheme-like typ_name */ + int i=0; + while (i!=strlen(typ_name)) { + if (isupper(const_name[i])) + typ_name[i] = tolower(const_name[i]); + if (const_name[i]=='_') + typ_name[i] = '-'; + i = i+1; + } + + /* output */ + fprintf(scm_output, "(define %-30s %12i)\t; %s\n", typ_name, val, const_name); + fprintf(module_output, "%s\n ",typ_name); + + /* free the allocated memory for typ_name */ + free(typ_name); + + return; +} + + +/* write empty line to scheme output file */ +void next_block() { + + /* scheme-const output */ + fprintf(scm_output, "\n"); + + /* scheme-module output */ + fprintf(module_output, "\n "); + + return; +} + + +/* create define-"header" in scheme-module */ +void prepare_module() { + + /* output */ + fprintf(module_output, "(define-interface odbc-const-interface\n"); + fprintf(module_output, " (export "); + + return; +} + + +/* create define-"outro" in scheme-module */ +void close_module() { + + /* output */ + fprintf(module_output, "))\n"); + + return; +} + + +/* create info box */ +void info_box(char info[]) { + + /* scheme-const output */ + fprintf(scm_output, "\n--------------------------------------------------------------------------\n"); + fprintf(scm_output, " %s\n",info); + fprintf(scm_output, "--------------------------------------------------------------------------\n\n\n"); + + return; +} + + + + + +int main() { + + /* open scm_out and module_out for write-access */ + scm_output = fopen(scm_out, "w"); + module_output = fopen(module_out, "w"); + + + + /* ------------------------------------------------------------------------ + * ODBC-Constants from 'sql.h' + * ------------------------------------------------------------------------ + */ + + /* prepare scheme-module file (module_out) */ + prepare_module(); + + /* insert info-box in scheme-output file (scm_out) */ + info_box("ODBC-Constants from 'sql.h'"); + + + /**************************** + * some ret values + ****************************/ + open_enumerated_type("return-value"); + enumerated_type_value("null-data", SQL_NULL_DATA); + enumerated_type_value("data-at-exec", SQL_DATA_AT_EXEC); + enumerated_type_value("success", SQL_SUCCESS); + enumerated_type_value("success-with-info", SQL_SUCCESS_WITH_INFO); +#if (ODBCVER >= 0x0300) + enumerated_type_value("no-data", SQL_NO_DATA); +#endif + enumerated_type_value("error", SQL_ERROR); + enumerated_type_value("invalid-handle", SQL_INVALID_HANDLE); + enumerated_type_value("still-executing", SQL_STILL_EXECUTING); + enumerated_type_value("need-data", SQL_NEED_DATA); + + /* FIX ME: SQL_SUCCEEDED */ + + close_enumerated_type(); + + + /**************************** + * use these to indicate string termination to some function + ****************************/ + single_value(SQL_NTS); + single_value(SQL_NTSL); + + /* maximum message length */ + single_value(SQL_MAX_MESSAGE_LENGTH); + + /* date/time length constants */ +#if (ODBCVER >= 0x0300) + single_value(SQL_DATE_LEN); + single_value(SQL_TIME_LEN); + single_value(SQL_TIMESTAMP_LEN); +#endif + next_block(); + + /* handle type identifiers */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("handle"); + enumerated_type_value("env", SQL_HANDLE_ENV); + enumerated_type_value("dbc", SQL_HANDLE_DBC); + enumerated_type_value("stmt", SQL_HANDLE_STMT); + enumerated_type_value("desc", SQL_HANDLE_DESC); + close_enumerated_type(); +#endif + + /* environment attribute */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("attribute"); + enumerated_type_value("output-nfs", SQL_ATTR_OUTPUT_NTS); +#endif + + /* connection attributes */ +#if (ODBCVER >= 0x0300) + enumerated_type_value("auto-ipd", SQL_ATTR_AUTO_IPD); + enumerated_type_value("metadata-id", SQL_ATTR_METADATA_ID); +#endif /* ODBCVER >= 0x0300 */ + + /* statement attributes */ +#if (ODBCVER >= 0x0300) + enumerated_type_value("app-row-desc", SQL_ATTR_APP_ROW_DESC); + enumerated_type_value("app-param-desc", SQL_ATTR_APP_PARAM_DESC); + enumerated_type_value("imp-row-desc", SQL_ATTR_IMP_ROW_DESC); + enumerated_type_value("imp-param-desc", SQL_ATTR_IMP_PARAM_DESC); + enumerated_type_value("cursor-scrollable", SQL_ATTR_CURSOR_SCROLLABLE); + enumerated_type_value("cursor-sensitivity", SQL_ATTR_CURSOR_SENSITIVITY); + close_enumerated_type(); +#endif + + /* SQL_ATTR_CURSOR_SCROLLABLE values */ +#if (ODBCVER >= 0x0300) + single_value(SQL_NONSCROLLABLE); + single_value(SQL_SCROLLABLE); + next_block(); +#endif /* ODBCVER >= 0x0300 */ + + /* identifiers of fields in the SQL descriptor */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("descriptor"); + enumerated_type_value("count", SQL_DESC_COUNT); + enumerated_type_value("type", SQL_DESC_TYPE); + enumerated_type_value("length", SQL_DESC_LENGTH); + enumerated_type_value("octet-length-ptr", SQL_DESC_OCTET_LENGTH_PTR); + enumerated_type_value("precision", SQL_DESC_PRECISION); + enumerated_type_value("scale", SQL_DESC_SCALE); + enumerated_type_value("datetime-interval-code", SQL_DESC_DATETIME_INTERVAL_CODE); + enumerated_type_value("nullable", SQL_DESC_NULLABLE); + enumerated_type_value("indicator-ptr", SQL_DESC_INDICATOR_PTR); + enumerated_type_value("data-ptr", SQL_DESC_DATA_PTR); + enumerated_type_value("name", SQL_DESC_NAME); + enumerated_type_value("unnamed", SQL_DESC_UNNAMED); + enumerated_type_value("octet-length", SQL_DESC_OCTET_LENGTH); + enumerated_type_value("alloc-type", SQL_DESC_ALLOC_TYPE); + close_enumerated_type(); +#endif + + /* identifiers of fields in the diagnostics area */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("diagnostics"); + enumerated_type_value("returncode", SQL_DIAG_RETURNCODE); + enumerated_type_value("number", SQL_DIAG_NUMBER); + enumerated_type_value("sqlstate", SQL_DIAG_SQLSTATE); + enumerated_type_value("native", SQL_DIAG_NATIVE); + enumerated_type_value("message-text", SQL_DIAG_MESSAGE_TEXT); + enumerated_type_value("dynamic-function", SQL_DIAG_DYNAMIC_FUNCTION); + enumerated_type_value("class-origin", SQL_DIAG_CLASS_ORIGIN); + enumerated_type_value("subclass-origin", SQL_DIAG_SUBCLASS_ORIGIN); + enumerated_type_value("connection-name", SQL_DIAG_CONNECTION_NAME); + enumerated_type_value("server-name", SQL_DIAG_SERVER_NAME); + enumerated_type_value("dynamic-function-code", SQL_DIAG_DYNAMIC_FUNCTION_CODE); +#endif + + /* dynamic function codes */ +#if (ODBCVER >= 0x0300) + enumerated_type_value("alter-domain", SQL_DIAG_ALTER_DOMAIN); + enumerated_type_value("alter-table", SQL_DIAG_ALTER_TABLE); + enumerated_type_value("call", SQL_DIAG_CALL); + enumerated_type_value("create-assertion", SQL_DIAG_CREATE_ASSERTION); + enumerated_type_value("create-character-set", SQL_DIAG_CREATE_CHARACTER_SET); + enumerated_type_value("create-collation", SQL_DIAG_CREATE_COLLATION); + enumerated_type_value("create-domain", SQL_DIAG_CREATE_DOMAIN); + enumerated_type_value("create-index", SQL_DIAG_CREATE_INDEX); + enumerated_type_value("create-schema", SQL_DIAG_CREATE_SCHEMA); + enumerated_type_value("create-table", SQL_DIAG_CREATE_TABLE); + enumerated_type_value("create-translation", SQL_DIAG_CREATE_TRANSLATION); + enumerated_type_value("create-view", SQL_DIAG_CREATE_VIEW); + enumerated_type_value("delete-where", SQL_DIAG_DELETE_WHERE); + enumerated_type_value("drop-assertion", SQL_DIAG_DROP_ASSERTION); + enumerated_type_value("drop-character-set", SQL_DIAG_DROP_CHARACTER_SET); + enumerated_type_value("drop-collation", SQL_DIAG_DROP_COLLATION); + enumerated_type_value("drop-domain", SQL_DIAG_DROP_DOMAIN); + enumerated_type_value("drop-index", SQL_DIAG_DROP_INDEX); + enumerated_type_value("drop-schema", SQL_DIAG_DROP_SCHEMA); + enumerated_type_value("drop-table", SQL_DIAG_DROP_TABLE); + enumerated_type_value("drop-translation", SQL_DIAG_DROP_TRANSLATION); + enumerated_type_value("drop-view", SQL_DIAG_DROP_VIEW); + enumerated_type_value("dynamic-delete-cursor", SQL_DIAG_DYNAMIC_DELETE_CURSOR); + enumerated_type_value("dynamic-update-cursor", SQL_DIAG_DYNAMIC_UPDATE_CURSOR); + enumerated_type_value("grant", SQL_DIAG_GRANT); + enumerated_type_value("insert", SQL_DIAG_INSERT); + enumerated_type_value("revoke", SQL_DIAG_REVOKE); + enumerated_type_value("select-cursor", SQL_DIAG_SELECT_CURSOR); + enumerated_type_value("unknown-statement", SQL_DIAG_UNKNOWN_STATEMENT); + enumerated_type_value("update-where", SQL_DIAG_UPDATE_WHERE); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + + /* SQL data type codes */ + open_enumerated_type("data-type"); + enumerated_type_value("unknown-type", SQL_UNKNOWN_TYPE); + enumerated_type_value("char", SQL_CHAR); + enumerated_type_value("numeric", SQL_NUMERIC); + enumerated_type_value("decimal", SQL_DECIMAL); + enumerated_type_value("integer", SQL_INTEGER); + enumerated_type_value("smallint", SQL_SMALLINT); + enumerated_type_value("float", SQL_FLOAT); + enumerated_type_value("real", SQL_REAL); + enumerated_type_value("double", SQL_DOUBLE); +#if (ODBCVER >= 0x0300) + enumerated_type_value("datetime", SQL_DATETIME); +#endif + enumerated_type_value("varchar", SQL_VARCHAR); + close_enumerated_type(); + + /* One-parameter shortcuts for date/time data types */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("type"); + enumerated_type_value("date", SQL_TYPE_DATE); + enumerated_type_value("time", SQL_TYPE_TIME); + enumerated_type_value("timestamp", SQL_TYPE_TIMESTAMP); + close_enumerated_type(); +#endif + + /* Statement attribute values for cursor sensitivity */ +#if (ODBCVER >= 0x0300) + single_value(SQL_UNSPECIFIED); + single_value(SQL_INSENSITIVE); + single_value(SQL_SENSITIVE); + next_block(); +#endif + + /* GetTypeInfo() request for all data types */ + single_value(SQL_ALL_TYPES); + next_block(); + + /* Default conversion code for SQLBindCol(), SQLBindParam() and SQLGetData() */ +#if (ODBCVER >= 0x0300) + single_value(SQL_DEFAULT); + next_block(); +#endif + + /* SQLGetData() code indicating that the application row descriptor + * specifies the data type + */ +#if (ODBCVER >= 0x0300) + single_value(SQL_ARD_TYPE); + next_block(); +#endif + + /* SQL date/time type subcodes */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("code"); + enumerated_type_value("date", SQL_CODE_DATE); + enumerated_type_value("time", SQL_CODE_TIME); + enumerated_type_value("timestamp", SQL_CODE_TIMESTAMP); + close_enumerated_type(); +#endif + + /* CLI option values */ +#if (ODBCVER >= 0x0300) + single_value(SQL_FALSE); + single_value(SQL_TRUE); + next_block(); +#endif + + /* values of NULLABLE field in descriptor */ + single_value(SQL_NO_NULLS); + single_value(SQL_NULLABLE); + next_block(); + + /* Value returned by SQLGetTypeInfo() to denote that it is + * not known whether or not a data type supports null values. + */ + single_value(SQL_NULLABLE_UNKNOWN); + next_block(); + + /* Values returned by SQLGetTypeInfo() to show WHERE clause + * supported + */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("pred"); + enumerated_type_value("none", SQL_PRED_NONE); + enumerated_type_value("char", SQL_PRED_CHAR); + enumerated_type_value("basic", SQL_PRED_BASIC); + close_enumerated_type(); +#endif + + /* values of UNNAMED field in descriptor */ +#if (ODBCVER >= 0x0300) + single_value(SQL_NAMED); + single_value(SQL_UNNAMED); + next_block(); +#endif + + /* values of ALLOC_TYPE field in descriptor */ +#if (ODBCVER >= 0x0300) + single_value(SQL_DESC_ALLOC_AUTO); + single_value(SQL_DESC_ALLOC_USER); + next_block(); +#endif + + /* FreeStmt() options */ + open_enumerated_type("free-stmt"); + enumerated_type_value("close", SQL_CLOSE); + enumerated_type_value("drop", SQL_DROP); + enumerated_type_value("unbind", SQL_UNBIND); + enumerated_type_value("reset-params", SQL_RESET_PARAMS); + close_enumerated_type(); + + /* Codes used for FetchOrientation in SQLFetchScroll(), + and in SQLDataSources() + */ + open_enumerated_type("fetch"); + enumerated_type_value("next", SQL_FETCH_NEXT); + enumerated_type_value("first", SQL_FETCH_FIRST); + + /* Other codes used for FetchOrientation in SQLFetchScroll() */ + enumerated_type_value("last", SQL_FETCH_LAST); + enumerated_type_value("prior", SQL_FETCH_PRIOR); + enumerated_type_value("absolute", SQL_FETCH_ABSOLUTE); + enumerated_type_value("relative", SQL_FETCH_RELATIVE); + close_enumerated_type(); + + /* SQLEndTran() options */ + single_value(SQL_COMMIT); + single_value(SQL_ROLLBACK); + next_block(); + + /* null handles returned by SQLAllocHandle() */ + open_enumerated_type("null"); + enumerated_type_value("henv", SQL_NULL_HENV); + enumerated_type_value("hdbc", SQL_NULL_HDBC); + enumerated_type_value("hstmt", SQL_NULL_HSTMT); +#if (ODBCVER >= 0x0300) + enumerated_type_value("hdesc", SQL_NULL_HDESC); +#endif + + /* null handle used in place of parent handle when allocating HENV */ +#if (ODBCVER >= 0x0300) + enumerated_type_value("handle", SQL_NULL_HANDLE); +#endif + close_enumerated_type(); + + /* Values that may appear in the result set of SQLSpecialColumns() */ + open_enumerated_type("scope"); + enumerated_type_value("currow", SQL_SCOPE_CURROW); + enumerated_type_value("transaction", SQL_SCOPE_TRANSACTION); + enumerated_type_value("session", SQL_SCOPE_SESSION); + close_enumerated_type(); + + open_enumerated_type("pc"); + enumerated_type_value("unknown", SQL_PC_UNKNOWN); +#if (ODBCVER >= 0x0300) + enumerated_type_value("non-pseudo", SQL_PC_NON_PSEUDO); +#endif + enumerated_type_value("pseudo", SQL_PC_PSEUDO); + close_enumerated_type(); + + /* Reserved value for the IdentifierType argument of SQLSpecialColumns() */ +#if (ODBCVER >= 0x0300) + single_value(SQL_ROW_IDENTIFIER); + next_block(); +#endif + + /* Reserved values for UNIQUE argument of SQLStatistics() */ + open_enumerated_type("index"); + enumerated_type_value("unique", SQL_INDEX_UNIQUE); + enumerated_type_value("all", SQL_INDEX_ALL); + + /* Values that may appear in the result set of SQLStatistics() */ + enumerated_type_value("clustered", SQL_INDEX_CLUSTERED); + enumerated_type_value("hashed", SQL_INDEX_HASHED); + enumerated_type_value("other", SQL_INDEX_OTHER); + close_enumerated_type(); + + /* SQLGetFunctions() values to identify ODBC APIs */ + open_enumerated_type("api"); + enumerated_type_value("sql-alloc-connection", SQL_API_SQLALLOCCONNECT); + enumerated_type_value("sql-alloc-environment", SQL_API_SQLALLOCENV); +#if (ODBCVER >= 0x0300) + enumerated_type_value("sql-alloc-handle", SQL_API_SQLALLOCHANDLE); +#endif + enumerated_type_value("sql-alloc-statement", SQL_API_SQLALLOCSTMT); + enumerated_type_value("sql-bind-column", SQL_API_SQLBINDCOL); +#if (ODBCVER >= 0x0300) + enumerated_type_value("sql-bind-parameter", SQL_API_SQLBINDPARAM); +#endif + enumerated_type_value("sql-cancel", SQL_API_SQLCANCEL); +#if (ODBCVER >= 0x0300) + enumerated_type_value("sql-close-cursor", SQL_API_SQLCLOSECURSOR); + enumerated_type_value("sql-column-attribute", SQL_API_SQLCOLATTRIBUTE); +#endif + enumerated_type_value("sql-columns", SQL_API_SQLCOLUMNS); + enumerated_type_value("sql-connect", SQL_API_SQLCONNECT); +#if (ODBCVER >= 0x0300) + enumerated_type_value("sql-copy-description", SQL_API_SQLCOPYDESC); +#endif + enumerated_type_value("sql-datasources", SQL_API_SQLDATASOURCES); + enumerated_type_value("sql-describe-columns", SQL_API_SQLDESCRIBECOL); + enumerated_type_value("sql-disconnect", SQL_API_SQLDISCONNECT); +#if (ODBCVER >= 0x0300) + enumerated_type_value("sql-end-transaction", SQL_API_SQLENDTRAN); +#endif + enumerated_type_value("sql-error", SQL_API_SQLERROR); + enumerated_type_value("sql-execute-directly", SQL_API_SQLEXECDIRECT); + enumerated_type_value("sql-execute", SQL_API_SQLEXECUTE); + enumerated_type_value("sql-fetch", SQL_API_SQLFETCH); +#if (ODBCVER >= 0x0300) + enumerated_type_value("sql-fetch-scroll", SQL_API_SQLFETCHSCROLL); +#endif + enumerated_type_value("sql-free-connection", SQL_API_SQLFREECONNECT); + enumerated_type_value("sql-free-environment", SQL_API_SQLFREEENV); +#if (ODBCVER >= 0x0300) + enumerated_type_value("sql-free-handle", SQL_API_SQLFREEHANDLE); +#endif + enumerated_type_value("sql-free-statement", SQL_API_SQLFREESTMT); +#if (ODBCVER >= 0x0300) + enumerated_type_value("sql-get-connection-attribute", SQL_API_SQLGETCONNECTATTR); +#endif + enumerated_type_value("sql-get-connection-option", SQL_API_SQLGETCONNECTOPTION); + enumerated_type_value("sql-get-cursor-name", SQL_API_SQLGETCURSORNAME); + enumerated_type_value("sql-get-data", SQL_API_SQLGETDATA); +#if (ODBCVER >= 0x0300) + enumerated_type_value("sql-get-description-field", SQL_API_SQLGETDESCFIELD); + enumerated_type_value("sql-get-description-record", SQL_API_SQLGETDESCREC); + enumerated_type_value("sql-get-diagnostics-field", SQL_API_SQLGETDIAGFIELD); + enumerated_type_value("sql-get-diagnostics-record", SQL_API_SQLGETDIAGREC); + enumerated_type_value("sql-get-environment-attribute", SQL_API_SQLGETENVATTR); +#endif + enumerated_type_value("sql-get-functions", SQL_API_SQLGETFUNCTIONS); + enumerated_type_value("sql-get-information", SQL_API_SQLGETINFO); +#if (ODBCVER >= 0x0300) + enumerated_type_value("sql-get-statement-attribute", SQL_API_SQLGETSTMTATTR); +#endif + enumerated_type_value("sql-get-statement-option", SQL_API_SQLGETSTMTOPTION); + enumerated_type_value("sql-get-information-type", SQL_API_SQLGETTYPEINFO); + enumerated_type_value("sql-number-of-result-columns", SQL_API_SQLNUMRESULTCOLS); + enumerated_type_value("sql-parameter-data", SQL_API_SQLPARAMDATA); + enumerated_type_value("sql-prepare", SQL_API_SQLPREPARE); + enumerated_type_value("sql-put-data", SQL_API_SQLPUTDATA); + enumerated_type_value("sql-row-count", SQL_API_SQLROWCOUNT); +#if (ODBCVER >= 0x0300) + enumerated_type_value("sql-set-connection-attribute", SQL_API_SQLSETCONNECTATTR); +#endif + enumerated_type_value("sql-set-connection-option", SQL_API_SQLSETCONNECTOPTION); + enumerated_type_value("sql-set-cursor-name", SQL_API_SQLSETCURSORNAME); +#if (ODBCVER >= 0x0300) + enumerated_type_value("sql-set-description-field", SQL_API_SQLSETDESCFIELD); + enumerated_type_value("sql-set-description-record", SQL_API_SQLSETDESCREC); + enumerated_type_value("sql-set-environment-attribute", SQL_API_SQLSETENVATTR); +#endif + enumerated_type_value("sql-set-parameter", SQL_API_SQLSETPARAM); +#if (ODBCVER >= 0x0300) + enumerated_type_value("sql-set-statement-attribute", SQL_API_SQLSETSTMTATTR); +#endif + enumerated_type_value("sql-set-statement-option", SQL_API_SQLSETSTMTOPTION); + enumerated_type_value("sql-special-columns", SQL_API_SQLSPECIALCOLUMNS); + enumerated_type_value("sql-statistics", SQL_API_SQLSTATISTICS); + enumerated_type_value("sql-tables", SQL_API_SQLTABLES); + enumerated_type_value("sql-transaction", SQL_API_SQLTRANSACT); + close_enumerated_type(); + + /* Information requested by SQLGetInfo() */ + open_enumerated_type("SQLGetInfo"); +#if (ODBCVER >= 0x0300) + enumerated_type_value("max-driver-connections", SQL_MAX_DRIVER_CONNECTIONS); + enumerated_type_value("max-concurrent-activities", SQL_MAX_CONCURRENT_ACTIVITIES); +#endif + enumerated_type_value("data-source-name", SQL_DATA_SOURCE_NAME); + enumerated_type_value("fetch-direction", SQL_FETCH_DIRECTION); + enumerated_type_value("server-name", SQL_SERVER_NAME); + enumerated_type_value("search-pattern-escape", SQL_SEARCH_PATTERN_ESCAPE); + enumerated_type_value("dbms-name", SQL_DBMS_NAME); + enumerated_type_value("dbms-version", SQL_DBMS_VER); + enumerated_type_value("accessible-tables", SQL_ACCESSIBLE_TABLES); + enumerated_type_value("accessible-procedures", SQL_ACCESSIBLE_PROCEDURES); + enumerated_type_value("cursor-commit-behavior", SQL_CURSOR_COMMIT_BEHAVIOR); + enumerated_type_value("data-source-read-only", SQL_DATA_SOURCE_READ_ONLY); + enumerated_type_value("default-txn-isolation", SQL_DEFAULT_TXN_ISOLATION); + enumerated_type_value("identifier-case", SQL_IDENTIFIER_CASE); + enumerated_type_value("identifier-quote-char", SQL_IDENTIFIER_QUOTE_CHAR); + enumerated_type_value("max-column-name-length", SQL_MAX_COLUMN_NAME_LEN); + enumerated_type_value("max-cursor-name-length", SQL_MAX_CURSOR_NAME_LEN); + enumerated_type_value("max-schema-name-length", SQL_MAX_SCHEMA_NAME_LEN); + enumerated_type_value("max-catalog-name-length", SQL_MAX_CATALOG_NAME_LEN); + enumerated_type_value("max-table-name-length", SQL_MAX_TABLE_NAME_LEN); + enumerated_type_value("scroll-concurrency", SQL_SCROLL_CONCURRENCY); + enumerated_type_value("txn-capable", SQL_TXN_CAPABLE); + enumerated_type_value("transaction-capable", SQL_TRANSACTION_CAPABLE); + enumerated_type_value("user-name", SQL_USER_NAME); + enumerated_type_value("txn-isolation-option", SQL_TXN_ISOLATION_OPTION); + enumerated_type_value("integrity", SQL_INTEGRITY); + enumerated_type_value("getdata-extensions", SQL_GETDATA_EXTENSIONS); + enumerated_type_value("null-collation", SQL_NULL_COLLATION); + enumerated_type_value("alter-table", SQL_ALTER_TABLE); + enumerated_type_value("order-by-columns-in-selection", SQL_ORDER_BY_COLUMNS_IN_SELECT); + enumerated_type_value("special-characters", SQL_SPECIAL_CHARACTERS); + enumerated_type_value("max-columns-in-group-by", SQL_MAX_COLUMNS_IN_GROUP_BY); + enumerated_type_value("max-columns-in-index", SQL_MAX_COLUMNS_IN_INDEX); + enumerated_type_value("max-columns-in-order-by", SQL_MAX_COLUMNS_IN_ORDER_BY); + enumerated_type_value("max-columns-in-select", SQL_MAX_COLUMNS_IN_SELECT); + enumerated_type_value("max-columns-in-table", SQL_MAX_COLUMNS_IN_TABLE); + enumerated_type_value("max-index-size", SQL_MAX_INDEX_SIZE); + enumerated_type_value("max-row-size", SQL_MAX_ROW_SIZE); + enumerated_type_value("max-statement-length", SQL_MAX_STATEMENT_LEN); + enumerated_type_value("max-tables-in-selection", SQL_MAX_TABLES_IN_SELECT); + enumerated_type_value("max-user-name-length", SQL_MAX_USER_NAME_LEN); +#if (ODBCVER >= 0x0300) + enumerated_type_value("oj-capabilities", SQL_OJ_CAPABILITIES); + enumerated_type_value("outer-join-capabilities", SQL_OUTER_JOIN_CAPABILITIES); +#endif /* ODBCVER >= 0x0300 */ + close_enumerated_type(); + +#if (ODBCVER >= 0x0300) + single_value(SQL_XOPEN_CLI_YEAR); + single_value(SQL_CURSOR_SENSITIVITY); + single_value(SQL_DESCRIBE_PARAMETER); + + /* FIX ME: UNIDENTIFIED OUPUT FOR SQL_CATALOG_NAME... */ + single_value(SQL_CATALOG_NAME); + + single_value(SQL_COLLATION_SEQ); + single_value(SQL_MAXIMUM_IDENTIFIER_LENGTH); +#endif /* ODBCVER >= 0x0300 */ + next_block(); + + /* SQL_ALTER_TABLE bitmasks */ +#if (ODBCVER >= 0x0200) + open_enumerated_type("altertable"); + enumerated_type_value("add-column", SQL_AT_ADD_COLUMN); + enumerated_type_value("drop-column", SQL_AT_DROP_COLUMN); +#endif /* ODBCVER >= 0x0200 */ + +#if (ODBCVER >= 0x0300) + enumerated_type_value("add-constraint", SQL_AT_ADD_CONSTRAINT); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + +#if (ODBCVER < 0x0300) + close_enumerated_type(); +#endif /* ODBCVER < 0x0300 */ + + /* SQL_ASYNC_MODE values */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("asyncmode"); + enumerated_type_value("none", SQL_AM_NONE); + enumerated_type_value("connection", SQL_AM_CONNECTION); + enumerated_type_value("statement", SQL_AM_STATEMENT); + close_enumerated_type(); +#endif + + /* SQL_CURSOR_COMMIT_BEHAVIOR values */ + open_enumerated_type("cursorcommitbehavior"); + enumerated_type_value("delete", SQL_CB_DELETE); + enumerated_type_value("close", SQL_CB_CLOSE); + enumerated_type_value("preserve", SQL_CB_PRESERVE); + close_enumerated_type(); + + /* SQL_FETCH_DIRECTION bitmasks */ + open_enumerated_type("fetchdirection"); + enumerated_type_value("next", SQL_FD_FETCH_NEXT); + enumerated_type_value("first", SQL_FD_FETCH_FIRST); + enumerated_type_value("last", SQL_FD_FETCH_LAST); + enumerated_type_value("prior", SQL_FD_FETCH_PRIOR); + enumerated_type_value("absolute", SQL_FD_FETCH_ABSOLUTE); + enumerated_type_value("relative", SQL_FD_FETCH_RELATIVE); + close_enumerated_type(); + + /* SQL_GETDATA_EXTENSIONS bitmasks */ + open_enumerated_type("getdataextensions"); + enumerated_type_value("any-column", SQL_GD_ANY_COLUMN); + enumerated_type_value("any-order", SQL_GD_ANY_ORDER); + close_enumerated_type(); + + /* SQL_IDENTIFIER_CASE values */ + open_enumerated_type("identifiercase"); + enumerated_type_value("upper", SQL_IC_UPPER); + enumerated_type_value("lower", SQL_IC_LOWER); + enumerated_type_value("sensitive", SQL_IC_SENSITIVE); + enumerated_type_value("mixed", SQL_IC_MIXED); + close_enumerated_type(); + + /* SQL_OJ_CAPABILITIES bitmasks */ +#if (ODBCVER >= 0x0201) + open_enumerated_type("ojcapabilities"); + enumerated_type_value("left", SQL_OJ_LEFT); + enumerated_type_value("right", SQL_OJ_RIGHT); + enumerated_type_value("full", SQL_OJ_FULL); + enumerated_type_value("nested", SQL_OJ_NESTED); + enumerated_type_value("not-ordered", SQL_OJ_NOT_ORDERED); + enumerated_type_value("inner", SQL_OJ_INNER); + enumerated_type_value("all-comparison-ops", SQL_OJ_ALL_COMPARISON_OPS); + close_enumerated_type(); +#endif + + /* SQL_SCROLL_CONCURRENCY bitmasks */ + open_enumerated_type("scrollconcurrency"); + enumerated_type_value("read-only", SQL_SCCO_READ_ONLY); + enumerated_type_value("read-lock", SQL_SCCO_LOCK); + enumerated_type_value("opt-rowver", SQL_SCCO_OPT_ROWVER); + enumerated_type_value("opt-values", SQL_SCCO_OPT_VALUES); + close_enumerated_type(); + + /* SQL_TXN_CAPABLE values */ + open_enumerated_type("txncapable"); + enumerated_type_value("none", SQL_TC_NONE); + enumerated_type_value("dml", SQL_TC_DML); + enumerated_type_value("all", SQL_TC_ALL); + enumerated_type_value("ddl-commit", SQL_TC_DDL_COMMIT); + enumerated_type_value("ddl-ignore", SQL_TC_DDL_IGNORE); + close_enumerated_type(); + + /* SQL_TXN_ISOLATION_OPTION bitmasks */ + open_enumerated_type("txnisolationoption"); + enumerated_type_value("read-uncommitted", SQL_TXN_READ_UNCOMMITTED); + enumerated_type_value("read-committed", SQL_TXN_READ_COMMITTED); + enumerated_type_value("repeatable-read", SQL_TXN_REPEATABLE_READ); + enumerated_type_value("serializable", SQL_TXN_SERIALIZABLE); + close_enumerated_type(); + + /* SQL_NULL_COLLATION values */ + single_value(SQL_NC_HIGH); + single_value(SQL_NC_LOW); + next_block(); + + + /* ------------------------------------------------------------------------ + * ODBC-Constants from 'sqlext.h' + * ------------------------------------------------------------------------ + */ + + + /* insert info-box in scheme-output file (scm_out) */ + next_block(); + info_box("ODBC-Constants from 'sqlext.h'"); + + + /* BEGIN - unixODBC ONLY (programs like ODBCConfig and DataManager use these) */ + + /* COLUMNS IN SQLTables() RESULT SET */ + open_enumerated_type("SQLTables"); + enumerated_type_value("table-catalog", SQLTables_TABLE_CATALOG); + enumerated_type_value("table-scheme", SQLTables_TABLE_SCHEM); + enumerated_type_value("table-name", SQLTables_TABLE_NAME); + enumerated_type_value("table-type", SQLTables_TABLE_TYPE); + enumerated_type_value("remarks", SQLTables_REMARKS); + close_enumerated_type(); + + /* COLUMNS IN SQLColumns() RESULT SET */ + open_enumerated_type("SQLColumns"); + enumerated_type_value("table-catalog", SQLColumns_TABLE_CAT); + enumerated_type_value("table-scheme", SQLColumns_TABLE_SCHEM); + enumerated_type_value("table-name", SQLColumns_TABLE_NAME); + enumerated_type_value("column-name", SQLColumns_COLUMN_NAME); + enumerated_type_value("data-type", SQLColumns_DATA_TYPE); + enumerated_type_value("type-name", SQLColumns_TYPE_NAME); + enumerated_type_value("column-size", SQLColumns_COLUMN_SIZE); + enumerated_type_value("buffer-length", SQLColumns_BUFFER_LENGTH); + enumerated_type_value("decimal-digits", SQLColumns_DECIMAL_DIGITS); + enumerated_type_value("num-prec-radix", SQLColumns_NUM_PREC_RADIX); + enumerated_type_value("nullable", SQLColumns_NULLABLE); + enumerated_type_value("remarks", SQLColumns_REMARKS); + enumerated_type_value("column-def", SQLColumns_COLUMN_DEF); + enumerated_type_value("sql-data-type", SQLColumns_SQL_DATA_TYPE); + enumerated_type_value("sql-datetime-sub", SQLColumns_SQL_DATETIME_SUB); + enumerated_type_value("char-octet-length", SQLColumns_CHAR_OCTET_LENGTH); + enumerated_type_value("ordinal-position", SQLColumns_ORDINAL_POSITION); + enumerated_type_value("is-nullable", SQLColumns_IS_NULLABLE); + close_enumerated_type(); + + /* END - unixODBC ONLY */ + + + /* generally useful constants */ + single_value(SQL_SPEC_MAJOR); + single_value(SQL_SPEC_MINOR); + single_value(SQL_SPEC_STRING); + single_value(SQL_SQLSTATE_SIZE); + single_value(SQL_MAX_DSN_LENGTH); + single_value(SQL_MAX_OPTION_STRING_LENGTH); + next_block(); + + /* return code SQL_NO_DATA_FOUND is the same as SQL_NO_DATA */ + single_value(SQL_NO_DATA_FOUND); + next_block(); + + /* an end handle type */ +#if (ODBCVER >= 0x0300) + single_value(SQL_HANDLE_SENV); + next_block(); +#endif /* ODBCVER >= 0x0300 */ + + /* env attribute */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("environment-attribute"); + enumerated_type_value("odbc-version", SQL_ATTR_ODBC_VERSION); + enumerated_type_value("connection-pooling", SQL_ATTR_CONNECTION_POOLING); + enumerated_type_value("connection-pooling-match", SQL_ATTR_CP_MATCH); + +/* unixODBC additions */ + enumerated_type_value("unixodbc-syspath", SQL_ATTR_UNIXODBC_SYSPATH); + enumerated_type_value("unixodbc-version", SQL_ATTR_UNIXODBC_VERSION); + enumerated_type_value("unixodbc-environment-attribute", SQL_ATTR_UNIXODBC_ENVATTR); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + + /* values for SQL_ATTR_CONNECTION_POOLING */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("connection-pooling"); + enumerated_type_value("off", SQL_CP_OFF); + enumerated_type_value("one-per-driver", SQL_CP_ONE_PER_DRIVER); + enumerated_type_value("one-per-environment-handle", SQL_CP_ONE_PER_HENV); + enumerated_type_value("default", SQL_CP_DEFAULT); + + /* values for SQL_ATTR_CP_MATCH */ + enumerated_type_value("strict-match", SQL_CP_STRICT_MATCH); + enumerated_type_value("relaxed-match", SQL_CP_RELAXED_MATCH); + enumerated_type_value("match-default", SQL_CP_MATCH_DEFAULT); + close_enumerated_type(); + + /* values for SQL_ATTR_ODBC_VERSION */ + open_enumerated_type("odbc-version"); + enumerated_type_value("odbc2", SQL_OV_ODBC2); + enumerated_type_value("odbc3", SQL_OV_ODBC3); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + + /* connection attributes */ + open_enumerated_type("connection-attribute"); + enumerated_type_value("access-mode", SQL_ACCESS_MODE); + enumerated_type_value("autocommit", SQL_AUTOCOMMIT); + enumerated_type_value("login-timeout", SQL_LOGIN_TIMEOUT); + enumerated_type_value("opt-trace", SQL_OPT_TRACE); + enumerated_type_value("opt-tracefile", SQL_OPT_TRACEFILE); + enumerated_type_value("translate-dll", SQL_TRANSLATE_DLL); + enumerated_type_value("translate-option", SQL_TRANSLATE_OPTION); + enumerated_type_value("txn-isolation", SQL_TXN_ISOLATION); + enumerated_type_value("current-qualifier", SQL_CURRENT_QUALIFIER); + enumerated_type_value("odbc-cursors", SQL_ODBC_CURSORS); + enumerated_type_value("quiet-mode", SQL_QUIET_MODE); + enumerated_type_value("packet-size", SQL_PACKET_SIZE); + enumerated_type_value("connection-dead", SQL_ATTR_CONNECTION_DEAD); +#if (ODBCVER >= 0x0300) + enumerated_type_value("connection-timeout", SQL_ATTR_CONNECTION_TIMEOUT); + enumerated_type_value("disconnect-behavior", SQL_ATTR_DISCONNECT_BEHAVIOR); + enumerated_type_value("enlist-in-dtc", SQL_ATTR_ENLIST_IN_DTC); + enumerated_type_value("enlist-in-xa", SQL_ATTR_ENLIST_IN_XA); +#endif /* ODBCVER >= 0x0300 */ +#if (ODBCVER >= 0x0351) + enumerated_type_value("ansi-app", SQL_ATTR_ANSI_APP); +#endif + close_enumerated_type(); + + /* SQL_CONNECT_OPT_DRVR_START is not meaningful for 3.0 driver */ +#if (ODBCVER < 0x0300) + single_value(SQL_CONNECT_OPT_DRVR_START); + single_value(SQL_CONN_OPT_MAX); + single_value(SQL_CONN_OPT_MIN); + next_block(); +#endif /* ODBCVER < 0x0300 */ + + /* SQL_ACCESS_MODE options */ + open_enumerated_type("access-mode"); + enumerated_type_value("read-write", SQL_MODE_READ_WRITE); + enumerated_type_value("read-only", SQL_MODE_READ_ONLY); + enumerated_type_value("default", SQL_MODE_DEFAULT); + close_enumerated_type(); + + /* SQL_AUTOCOMMIT options */ + open_enumerated_type("autocommit"); + enumerated_type_value("off", SQL_AUTOCOMMIT_OFF); + enumerated_type_value("on", SQL_AUTOCOMMIT_ON); + enumerated_type_value("default", SQL_AUTOCOMMIT_DEFAULT); + close_enumerated_type(); + + /* SQL_LOGIN_TIMEOUT options */ + single_value(SQL_LOGIN_TIMEOUT_DEFAULT); + next_block(); + + /* SQL_OPT_TRACE options */ + open_enumerated_type("opt-trace"); + enumerated_type_value("off", SQL_OPT_TRACE_OFF); + enumerated_type_value("on", SQL_OPT_TRACE_ON); + enumerated_type_value("default", SQL_OPT_TRACE_DEFAULT); + enumerated_type_value("file-default", SQL_OPT_TRACE_FILE_DEFAULT); + close_enumerated_type(); + + /* SQL_ODBC_CURSORS options */ + open_enumerated_type("odbc-cursors"); + enumerated_type_value("use-if-needed", SQL_CUR_USE_IF_NEEDED); + enumerated_type_value("use-odbc", SQL_CUR_USE_ODBC); + enumerated_type_value("use-driver", SQL_CUR_USE_DRIVER); + enumerated_type_value("use-default", SQL_CUR_DEFAULT); + close_enumerated_type(); + +#if (ODBCVER >= 0x0300) + /* values for SQL_ATTR_DISCONNECT_BEHAVIOR */ + open_enumerated_type("disconnect-behavior"); + enumerated_type_value("return-to-pool", SQL_DB_RETURN_TO_POOL); + enumerated_type_value("disconnect", SQL_DB_DISCONNECT); + enumerated_type_value("default", SQL_DB_DEFAULT); + close_enumerated_type(); + + /* values for SQL_ATTR_ENLIST_IN_DTC */ + single_value(SQL_DTC_DONE); + next_block(); +#endif /* ODBCVER >= 0x0300 */ + + /* values for SQL_ATTR_CONNECTION_DEAD */ + open_enumerated_type("connection-dead"); + enumerated_type_value("true", SQL_CD_TRUE); + enumerated_type_value("false", SQL_CD_FALSE); + close_enumerated_type(); + +#if (ODBCVER >= 0x0351) + /* values for SQL_ATTR_ANSI_APP */ + open_enumerated_type("ansi-app"); + enumerated_type_value("true", SQL_AA_TRUE); + enumerated_type_value("false", SQL_AA_FALSE); + close_enumerated_type(); +#endif + + /* statement attributes */ + open_enumerated_type("statement-attribute"); + enumerated_type_value("query-timeout", SQL_QUERY_TIMEOUT); + enumerated_type_value("noscan", SQL_NOSCAN); + enumerated_type_value("max-length", SQL_MAX_LENGTH); + enumerated_type_value("async-enable", SQL_ASYNC_ENABLE); + enumerated_type_value("bind-type", SQL_BIND_TYPE); + enumerated_type_value("cursor-type", SQL_CURSOR_TYPE); + enumerated_type_value("concurrency", SQL_CONCURRENCY); + enumerated_type_value("keyset-size", SQL_KEYSET_SIZE); + enumerated_type_value("rowset-size", SQL_ROWSET_SIZE); + enumerated_type_value("stimulate-cursor", SQL_SIMULATE_CURSOR); + enumerated_type_value("retrieve-data", SQL_RETRIEVE_DATA); + enumerated_type_value("use-bookmarks", SQL_USE_BOOKMARKS); + enumerated_type_value("get-bookmark", SQL_GET_BOOKMARK); + enumerated_type_value("row-number", SQL_ROW_NUMBER); + +#if (ODBCVER >= 0x0300) + /* statement attributes for ODBC 3.0 */ + enumerated_type_value("enable-auto-ipd", SQL_ATTR_ENABLE_AUTO_IPD); + enumerated_type_value("fetch-bookmark-pointer", SQL_ATTR_FETCH_BOOKMARK_PTR); + enumerated_type_value("bind-offset-pointer", SQL_ATTR_PARAM_BIND_OFFSET_PTR); + enumerated_type_value("bind-type", SQL_ATTR_PARAM_BIND_TYPE); + enumerated_type_value("operation-pointer", SQL_ATTR_PARAM_OPERATION_PTR); + enumerated_type_value("status-pointer", SQL_ATTR_PARAM_STATUS_PTR); + enumerated_type_value("processed-pointer", SQL_ATTR_PARAMS_PROCESSED_PTR); + enumerated_type_value("parameterset-size", SQL_ATTR_PARAMSET_SIZE); + enumerated_type_value("row-bind-offset-pointer", SQL_ATTR_ROW_BIND_OFFSET_PTR); + enumerated_type_value("row-operation-pointer", SQL_ATTR_ROW_OPERATION_PTR); + enumerated_type_value("row-status-pointer", SQL_ATTR_ROW_STATUS_PTR); + enumerated_type_value("rows-fetched-pointer", SQL_ATTR_ROWS_FETCHED_PTR); + enumerated_type_value("row-array-size", SQL_ATTR_ROW_ARRAY_SIZE); +#endif /* ODBCVER >= 0x0300 */ + close_enumerated_type(); + +#if (ODBCVER < 0x0300) + single_value(SQL_STMT_OPT_MAX); + single_value(SQL_STMT_OPT_MIN); + next_block(); +#endif /* ODBCVER < 0x0300 */ + +#if (ODBCVER >= 0x0300) + /* New defines for SEARCHABLE column in SQLGetTypeInfo */ + single_value(SQL_COL_PRED_CHAR); + single_value(SQL_COL_PRED_BASIC); + next_block(); +#endif /* ODBCVER >= 0x0300 */ + +#if (ODBCVER >= 0x0300) + /* whether an attribute is a pointer or not */ + open_enumerated_type("vartyp-of-attribute"); + enumerated_type_value("pointer", SQL_IS_POINTER); + enumerated_type_value("uninteger", SQL_IS_UINTEGER); + enumerated_type_value("integer", SQL_IS_INTEGER); + enumerated_type_value("usmallint", SQL_IS_USMALLINT); + enumerated_type_value("smallint", SQL_IS_SMALLINT); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + +#if (ODBCVER >= 0x0300) + /* the value of SQL_ATTR_PARAM_BIND_TYPE */ + single_value(SQL_PARAM_BIND_BY_COLUMN); + single_value(SQL_PARAM_BIND_TYPE_DEFAULT); + next_block(); +#endif /* ODBCVER >= 0x0300 */ + + /* SQL_QUERY_TIMEOUT options */ + single_value(SQL_QUERY_TIMEOUT_DEFAULT); + next_block(); + + /* SQL_MAX_ROWS options */ + single_value(SQL_MAX_ROWS_DEFAULT); + next_block(); + + /* SQL_NOSCAN options */ + open_enumerated_type("noscan"); + enumerated_type_value("off", SQL_NOSCAN_OFF); + enumerated_type_value("on", SQL_NOSCAN_ON); + enumerated_type_value("default", SQL_NOSCAN_DEFAULT); + close_enumerated_type(); + + /* SQL_MAX_LENGTH options */ + single_value(SQL_MAX_LENGTH_DEFAULT); + next_block(); + + /* values for SQL_ATTR_ASYNC_ENABLE */ + open_enumerated_type("async-enable"); + enumerated_type_value("off", SQL_ASYNC_ENABLE_OFF); + enumerated_type_value("on", SQL_ASYNC_ENABLE_ON); + enumerated_type_value("default", SQL_ASYNC_ENABLE_DEFAULT); + close_enumerated_type(); + + /* SQL_BIND_TYPE options */ + single_value(SQL_BIND_BY_COLUMN); + single_value(SQL_BIND_TYPE_DEFAULT); + next_block(); + + /* SQL_CONCURRENCY options */ + open_enumerated_type("concurrency"); + enumerated_type_value("read-only", SQL_CONCUR_READ_ONLY); + enumerated_type_value("lock", SQL_CONCUR_LOCK); + enumerated_type_value("rowver", SQL_CONCUR_ROWVER); + enumerated_type_value("values", SQL_CONCUR_VALUES); + enumerated_type_value("default", SQL_CONCUR_DEFAULT); + close_enumerated_type(); + + /* SQL_CURSOR_TYPE options */ + open_enumerated_type("cursor_type"); + enumerated_type_value("forward-only", SQL_CURSOR_FORWARD_ONLY); + enumerated_type_value("keyset-driven", SQL_CURSOR_KEYSET_DRIVEN); + enumerated_type_value("dynamic", SQL_CURSOR_DYNAMIC); + enumerated_type_value("static", SQL_CURSOR_STATIC); + enumerated_type_value("default", SQL_CURSOR_TYPE_DEFAULT); + close_enumerated_type(); + + /* SQL_ROWSET_SIZE options */ + single_value(SQL_ROWSET_SIZE_DEFAULT); + next_block(); + + /* SQL_KEYSET_SIZE options */ + single_value(SQL_KEYSET_SIZE_DEFAULT); + next_block(); + + /* SQL_SIMULATE_CURSOR options */ + open_enumerated_type("simulate-cursor"); + enumerated_type_value("non-unique", SQL_SC_NON_UNIQUE); + enumerated_type_value("try-unique", SQL_SC_TRY_UNIQUE); + enumerated_type_value("unique", SQL_SC_UNIQUE); + close_enumerated_type(); + + /* SQL_RETRIEVE_DATA options */ + open_enumerated_type("retrieve-data"); + enumerated_type_value("off", SQL_RD_OFF); + enumerated_type_value("on", SQL_RD_ON); + enumerated_type_value("default", SQL_RD_DEFAULT); + close_enumerated_type(); + + /* SQL_USE_BOOKMARKS options */ + open_enumerated_type("use-bookmarks"); + enumerated_type_value("off", SQL_UB_OFF); + enumerated_type_value("on", SQL_UB_ON); + enumerated_type_value("default", SQL_UB_DEFAULT); + +#if (ODBCVER >= 0x0300) + /* New values for SQL_USE_BOOKMARKS attribute */ + enumerated_type_value("fixed", SQL_UB_FIXED); + enumerated_type_value("variable", SQL_UB_VARIABLE); +#endif /* ODBCVER >= 0x0300 */ + close_enumerated_type(); + +/* extended descriptor field */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("descriptor-field-extended"); + enumerated_type_value("array-size", SQL_DESC_ARRAY_SIZE); + enumerated_type_value("array-status-pointer", SQL_DESC_ARRAY_STATUS_PTR); + enumerated_type_value("auto-unique-value", SQL_DESC_AUTO_UNIQUE_VALUE); + enumerated_type_value("base-column-name", SQL_DESC_BASE_COLUMN_NAME); + enumerated_type_value("base-table-name", SQL_DESC_BASE_TABLE_NAME); + enumerated_type_value("bind-offset-pointer", SQL_DESC_BIND_OFFSET_PTR); + enumerated_type_value("bind-type", SQL_DESC_BIND_TYPE); + enumerated_type_value("case-sensitive", SQL_DESC_CASE_SENSITIVE); + enumerated_type_value("catalog-name", SQL_DESC_CATALOG_NAME); + enumerated_type_value("concise-type", SQL_DESC_CONCISE_TYPE); + enumerated_type_value("datetime-interval-precision", SQL_DESC_DATETIME_INTERVAL_PRECISION); + enumerated_type_value("display-size", SQL_DESC_DISPLAY_SIZE); + enumerated_type_value("fixed-prec-scale", SQL_DESC_FIXED_PREC_SCALE); + enumerated_type_value("label", SQL_DESC_LABEL); + enumerated_type_value("litteral-prefix", SQL_DESC_LITERAL_PREFIX); + enumerated_type_value("litteral-suffix", SQL_DESC_LITERAL_SUFFIX); + enumerated_type_value("local-type-name", SQL_DESC_LOCAL_TYPE_NAME); + enumerated_type_value("maximum-scale", SQL_DESC_MAXIMUM_SCALE); + enumerated_type_value("minimum-scale", SQL_DESC_MINIMUM_SCALE); + enumerated_type_value("num-prec-radix", SQL_DESC_NUM_PREC_RADIX); + enumerated_type_value("parameter-type", SQL_DESC_PARAMETER_TYPE); + enumerated_type_value("rows-processed-pointer", SQL_DESC_ROWS_PROCESSED_PTR); +#if (ODBCVER >= 0x0350) + enumerated_type_value("rowver", SQL_DESC_ROWVER); +#endif /* ODBCVER >= 0x0350 */ + enumerated_type_value("schema-name", SQL_DESC_SCHEMA_NAME); + enumerated_type_value("searchable", SQL_DESC_SEARCHABLE); + enumerated_type_value("type-name", SQL_DESC_TYPE_NAME); + enumerated_type_value("table-name", SQL_DESC_TABLE_NAME); + enumerated_type_value("unsigned", SQL_DESC_UNSIGNED); + enumerated_type_value("updatable", SQL_DESC_UPDATABLE); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + +#if (ODBCVER >= 0x0300) + /* defines for diagnostics fields */ + open_enumerated_type("diagnostic-fields-extended"); + enumerated_type_value("cursor-row-count", SQL_DIAG_CURSOR_ROW_COUNT); + enumerated_type_value("row-number", SQL_DIAG_ROW_NUMBER); + enumerated_type_value("column-number", SQL_DIAG_COLUMN_NUMBER); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + + /* SQL extended datatypes */ + open_enumerated_type("datatypes-extended"); + enumerated_type_value("date", SQL_DATE); +#if (ODBCVER >= 0x0300) + enumerated_type_value("interval", SQL_INTERVAL); +#endif /* ODBCVER >= 0x0300 */ + enumerated_type_value("time", SQL_TIME); + enumerated_type_value("timestamp", SQL_TIMESTAMP); + enumerated_type_value("longvarchar", SQL_LONGVARCHAR); + enumerated_type_value("binary", SQL_BINARY); + enumerated_type_value("varbinary", SQL_VARBINARY); + enumerated_type_value("longvarbinary", SQL_LONGVARBINARY); + enumerated_type_value("bigint", SQL_BIGINT); + enumerated_type_value("tinyint", SQL_TINYINT); + enumerated_type_value("bit", SQL_BIT); +#if (ODBCVER >= 0x0350) + enumerated_type_value("guid", SQL_GUID); +#endif /* ODBCVER >= 0x0350 */ + close_enumerated_type(); + + /* interval code */ + open_enumerated_type("interval-code"); +#if (ODBCVER >= 0x0300) + enumerated_type_value("code-year", SQL_CODE_YEAR); + enumerated_type_value("code-month", SQL_CODE_MONTH); + enumerated_type_value("code-day", SQL_CODE_DAY); + enumerated_type_value("code-hour", SQL_CODE_HOUR); + enumerated_type_value("code-minute", SQL_CODE_MINUTE); + enumerated_type_value("code-second", SQL_CODE_SECOND); + enumerated_type_value("code-year-to-month", SQL_CODE_YEAR_TO_MONTH); + enumerated_type_value("code-day-to-hour", SQL_CODE_DAY_TO_HOUR); + enumerated_type_value("code-day-to-minute", SQL_CODE_DAY_TO_MINUTE); + enumerated_type_value("code-day-to-second", SQL_CODE_DAY_TO_SECOND); + enumerated_type_value("code-hour-to-minute", SQL_CODE_HOUR_TO_MINUTE); + enumerated_type_value("code-hour-to-second", SQL_CODE_HOUR_TO_SECOND); + enumerated_type_value("code-minute-to-second", SQL_CODE_MINUTE_TO_SECOND); +#endif /* ODBCVER >= 0x0300 */ + + enumerated_type_value("interval-year", SQL_INTERVAL_YEAR); + enumerated_type_value("interval-month", SQL_INTERVAL_MONTH); + enumerated_type_value("interval-day", SQL_INTERVAL_DAY); + enumerated_type_value("interval-hour", SQL_INTERVAL_HOUR); + enumerated_type_value("interval-minute", SQL_INTERVAL_MINUTE); + enumerated_type_value("interval-second", SQL_INTERVAL_SECOND); + enumerated_type_value("interval-year-to-month", SQL_INTERVAL_YEAR_TO_MONTH); + enumerated_type_value("interval-day-to-hour", SQL_INTERVAL_DAY_TO_HOUR); + enumerated_type_value("interval-day-to-minute", SQL_INTERVAL_DAY_TO_MINUTE); + enumerated_type_value("interval-day-to-second", SQL_INTERVAL_DAY_TO_SECOND); + enumerated_type_value("interval-hour-to-minute", SQL_INTERVAL_HOUR_TO_MINUTE); + enumerated_type_value("interval-hour-to-second", SQL_INTERVAL_HOUR_TO_SECOND); + enumerated_type_value("interval-minute-to-second", SQL_INTERVAL_MINUTE_TO_SECOND); + close_enumerated_type(); + + + /* FIX ME: WCHAR-PROBLEM => WCHAR NOT IMPLEMENTED + * definitions for SQL_UNICODE_ + * open_enumerated_type("unicode"); + * enumerated_type_value("unicode", SQL_UNICODE); + * enumerated_type_value("varchar", SQL_UNICODE_VARCHAR); + * enumerated_type_value("long-varchar", SQL_UNICODE_LONGVARCHAR); + * enumerated_type_value("char", SQL_UNICODE_CHAR); + * close_enumerated_type(); + */ + +#if (ODBCVER < 0x0300) + single_value(SQL_TYPE_DRIVER_START); + single_value(SQL_TYPE_DRIVER_END); + next_block(): +#endif /* ODBCVER < 0x0300 */ + + single_value(SQL_TYPE_NULL); +#if (ODBCVER < 0x0300) + single_value(SQL_TYPE_MIN); + single_value(SQL_TYPE_MAX); +#endif + next_block(); + +#if (ODBCVER >= 0x0300) + /* define for SQL_DIAG_ROW_NUMBER and SQL_DIAG_COLUMN_NUMBER */ + single_value(SQL_NO_ROW_NUMBER); + single_value(SQL_NO_COLUMN_NUMBER); + single_value(SQL_ROW_NUMBER_UNKNOWN); + single_value(SQL_COLUMN_NUMBER_UNKNOWN); + next_block(); +#endif + + /* SQLBindParameter extensions */ + single_value(SQL_DEFAULT_PARAM); + single_value(SQL_IGNORE); +#if (ODBCVER >= 0x0300) + single_value(SQL_COLUMN_IGNORE); +#endif /* ODBCVER >= 0x0300 */ + single_value(SQL_LEN_DATA_AT_EXEC_OFFSET); + next_block(); + + /* binary length for driver specific attributes */ + single_value(SQL_LEN_BINARY_ATTR_OFFSET); + next_block(); + + /* Defines used by Driver Manager when mapping SQLSetParam to SQLBindParameter */ + single_value(SQL_PARAM_TYPE_DEFAULT); + single_value(SQL_SETPARAM_VALUE_MAX); + next_block(); + + /* SQLColAttributes defines */ + open_enumerated_type("SQLColumnAtributes-extended"); + enumerated_type_value("count", SQL_COLUMN_COUNT); + enumerated_type_value("name", SQL_COLUMN_NAME); + enumerated_type_value("type", SQL_COLUMN_TYPE); + enumerated_type_value("length", SQL_COLUMN_LENGTH); + enumerated_type_value("precision", SQL_COLUMN_PRECISION); + enumerated_type_value("scale", SQL_COLUMN_SCALE); + enumerated_type_value("display-size", SQL_COLUMN_DISPLAY_SIZE); + enumerated_type_value("nullable", SQL_COLUMN_NULLABLE); + enumerated_type_value("unsigned", SQL_COLUMN_UNSIGNED); + enumerated_type_value("money", SQL_COLUMN_MONEY); + enumerated_type_value("updatable", SQL_COLUMN_UPDATABLE); + enumerated_type_value("auto-increment", SQL_COLUMN_AUTO_INCREMENT); + enumerated_type_value("case-sensitive", SQL_COLUMN_CASE_SENSITIVE); + enumerated_type_value("searchable", SQL_COLUMN_SEARCHABLE); + enumerated_type_value("type-name", SQL_COLUMN_TYPE_NAME); + enumerated_type_value("table-name", SQL_COLUMN_TABLE_NAME); + enumerated_type_value("owner-name", SQL_COLUMN_OWNER_NAME); + enumerated_type_value("qualifier-name", SQL_COLUMN_QUALIFIER_NAME); + enumerated_type_value("label", SQL_COLUMN_LABEL); +#if (ODBCVER < 0x0300) + enumerated_type_value("driver-start", SQL_COLUMN_DRIVER_START); +#endif /* ODBCVER < 0x0300 */ + close_enumerated_type(); + + /* SQLColAttributes subdefines for SQL_COLUMN_UPDATABLE */ + single_value(SQL_ATTR_READONLY); + single_value(SQL_ATTR_WRITE); + single_value(SQL_ATTR_READWRITE_UNKNOWN); + next_block(); + + /* SQLColAttributes subdefines for SQL_COLUMN_SEARCHABLE */ + single_value(SQL_UNSEARCHABLE); + single_value(SQL_LIKE_ONLY); + single_value(SQL_ALL_EXCEPT_LIKE); + single_value(SQL_SEARCHABLE); + single_value(SQL_PRED_SEARCHABLE); + next_block(); + + /* Special return values for SQLGetData */ + single_value(SQL_NO_TOTAL); + next_block(); + + /********************************************/ + /* SQLGetFunctions: additional values for */ + /* fFunction to represent functions that */ + /* are not in the X/Open spec. */ + /********************************************/ + open_enumerated_type("api-extended"); +#if (ODBCVER >= 0x0300) + enumerated_type_value("sql-alloc-handle-std", SQL_API_SQLALLOCHANDLESTD); + enumerated_type_value("sql-bulk-operations", SQL_API_SQLBULKOPERATIONS); +#endif /* ODBCVER >= 0x0300 */ + enumerated_type_value("sql-bind-parameter", SQL_API_SQLBINDPARAMETER); + enumerated_type_value("sql-alloc-handle-std", SQL_API_SQLBROWSECONNECT); + enumerated_type_value("sql-column-attributes", SQL_API_SQLCOLATTRIBUTES); + enumerated_type_value("sql-column-privileges", SQL_API_SQLCOLUMNPRIVILEGES); + enumerated_type_value("sql-describe-parameter", SQL_API_SQLDESCRIBEPARAM); + enumerated_type_value("sql-driver-connect", SQL_API_SQLDRIVERCONNECT); + enumerated_type_value("sql-drivers", SQL_API_SQLDRIVERS); + enumerated_type_value("sql-extended-fetch", SQL_API_SQLEXTENDEDFETCH); + enumerated_type_value("sql-foreign-keys", SQL_API_SQLFOREIGNKEYS); + enumerated_type_value("sql-more-results", SQL_API_SQLMORERESULTS); + enumerated_type_value("sql-native-sql", SQL_API_SQLNATIVESQL); + enumerated_type_value("sql-num-parameters", SQL_API_SQLNUMPARAMS); + enumerated_type_value("sql-parameter-options", SQL_API_SQLPARAMOPTIONS); + enumerated_type_value("sql-primary-keys", SQL_API_SQLPRIMARYKEYS); + enumerated_type_value("sql-procedure-columns", SQL_API_SQLPROCEDURECOLUMNS); + enumerated_type_value("sql-procedures", SQL_API_SQLPROCEDURES); + enumerated_type_value("sql-set-position", SQL_API_SQLSETPOS); + enumerated_type_value("sql-set-scroll-options", SQL_API_SQLSETSCROLLOPTIONS); + enumerated_type_value("sql-table-privileges", SQL_API_SQLTABLEPRIVILEGES); + /*-------------------------------------------*/ + /* SQL_API_ALL_FUNCTIONS returns an array */ + /* of 'booleans' representing whether a */ + /* function is implemented by the driver. */ + /*-------------------------------------------*/ + enumerated_type_value("all-functions", SQL_API_ALL_FUNCTIONS); + /*-----------------------------------------------*/ + /* 2.X drivers export a dummy function with */ + /* ordinal number SQL_API_LOADBYORDINAL to speed */ + /* loading under the windows operating system. */ + /*-----------------------------------------------*/ + enumerated_type_value("load-by-ordinal", SQL_API_LOADBYORDINAL); +#if (ODBCVER >= 0x0300) + /*-------------------------------------------*/ + /* SQL_API_ODBC3_ALL_FUNCTIONS */ + /*-------------------------------------------*/ + enumerated_type_value("odbc3-all-functions", SQL_API_ODBC3_ALL_FUNCTIONS); + enumerated_type_value("odbc3-all-functions-size", SQL_API_ODBC3_ALL_FUNCTIONS_SIZE); + close_enumerated_type(); +#endif /* (ODBCVER >= 0x0300) */ + +#if (ODBCVER < 0x0300) + /*-------------------------------------------*/ + /* SQL_EXT_API_LAST is not useful with ODBC */ + /* version 3.0 because some of the values */ + /* from X/Open are in the 10000 range. */ + /*-------------------------------------------*/ + single_value(SQL_EXT_API_LAST); + single_value(SQL_NUM_FUNCTIONS); + single_value(SQL_EXT_API_START); + single_value(SQL_NUM_EXTENSIONS); + next_block(); +#endif + + /*********************************************/ + /* Extended definitions for SQLGetInfo */ + /*********************************************/ + + /*-----------------------------------------------------*/ + /* Values in ODBC 2.0 that are not in the X/Open spec */ + /*-----------------------------------------------------*/ + single_value(SQL_INFO_FIRST); + single_value(SQL_ACTIVE_CONNECTIONS); + single_value(SQL_ACTIVE_STATEMENTS); + single_value(SQL_DRIVER_HDBC); + single_value(SQL_DRIVER_HENV); + single_value(SQL_DRIVER_HSTMT); + single_value(SQL_DRIVER_NAME); + single_value(SQL_DRIVER_VER); + single_value(SQL_ODBC_API_CONFORMANCE); + single_value(SQL_ODBC_VER); + single_value(SQL_ROW_UPDATES); + single_value(SQL_ODBC_SAG_CLI_CONFORMANCE); + single_value(SQL_ODBC_SQL_CONFORMANCE); + single_value(SQL_PROCEDURES); + single_value(SQL_CONCAT_NULL_BEHAVIOR); + single_value(SQL_CURSOR_ROLLBACK_BEHAVIOR); + single_value(SQL_EXPRESSIONS_IN_ORDERBY); + single_value(SQL_MAX_OWNER_NAME_LEN); + single_value(SQL_MAX_PROCEDURE_NAME_LEN); + single_value(SQL_MAX_QUALIFIER_NAME_LEN); + single_value(SQL_MULT_RESULT_SETS); + single_value(SQL_MULTIPLE_ACTIVE_TXN); + single_value(SQL_OUTER_JOINS); + single_value(SQL_OWNER_TERM); + single_value(SQL_PROCEDURE_TERM); + single_value(SQL_QUALIFIER_NAME_SEPARATOR); + single_value(SQL_QUALIFIER_TERM); + single_value(SQL_SCROLL_OPTIONS); + single_value(SQL_TABLE_TERM); + single_value(SQL_CONVERT_FUNCTIONS); + single_value(SQL_NUMERIC_FUNCTIONS); + single_value(SQL_STRING_FUNCTIONS); + single_value(SQL_SYSTEM_FUNCTIONS); + single_value(SQL_TIMEDATE_FUNCTIONS); + single_value(SQL_ODBC_SQL_OPT_IEF); + single_value(SQL_CORRELATION_NAME); + single_value(SQL_NON_NULLABLE_COLUMNS); + single_value(SQL_DRIVER_HLIB); + single_value(SQL_DRIVER_ODBC_VER); + single_value(SQL_LOCK_TYPES); + single_value(SQL_POS_OPERATIONS); + single_value(SQL_POSITIONED_STATEMENTS); + single_value(SQL_BOOKMARK_PERSISTENCE); + single_value(SQL_STATIC_SENSITIVITY); + single_value(SQL_FILE_USAGE); + single_value(SQL_COLUMN_ALIAS); + single_value(SQL_GROUP_BY); + single_value(SQL_KEYWORDS); + single_value(SQL_OWNER_USAGE); + single_value(SQL_QUALIFIER_USAGE); + single_value(SQL_QUOTED_IDENTIFIER_CASE); + single_value(SQL_SUBQUERIES); + single_value(SQL_UNION); + single_value(SQL_MAX_ROW_SIZE_INCLUDES_LONG); + single_value(SQL_MAX_CHAR_LITERAL_LEN) + single_value(SQL_TIMEDATE_ADD_INTERVALS); + single_value(SQL_TIMEDATE_DIFF_INTERVALS); + single_value(SQL_NEED_LONG_DATA_LEN); + single_value(SQL_MAX_BINARY_LITERAL_LEN); + single_value(SQL_LIKE_ESCAPE_CLAUSE); + single_value(SQL_QUALIFIER_LOCATION); + next_block(); + + open_enumerated_type("convert-extended"); + enumerated_type_value("bigint", SQL_CONVERT_BIGINT); + enumerated_type_value("binary", SQL_CONVERT_BINARY); + enumerated_type_value("bit", SQL_CONVERT_BIT); + enumerated_type_value("char", SQL_CONVERT_CHAR); + enumerated_type_value("date", SQL_CONVERT_DATE); + enumerated_type_value("decimal", SQL_CONVERT_DECIMAL); + enumerated_type_value("double", SQL_CONVERT_DOUBLE); + enumerated_type_value("float", SQL_CONVERT_FLOAT); + enumerated_type_value("integer", SQL_CONVERT_INTEGER); + enumerated_type_value("longvarchar", SQL_CONVERT_LONGVARCHAR); + enumerated_type_value("numeric", SQL_CONVERT_NUMERIC); + enumerated_type_value("real", SQL_CONVERT_REAL); + enumerated_type_value("smallint", SQL_CONVERT_SMALLINT); + enumerated_type_value("time", SQL_CONVERT_TIME); + enumerated_type_value("timestamp", SQL_CONVERT_TIMESTAMP); + enumerated_type_value("tinyint", SQL_CONVERT_TINYINT); + enumerated_type_value("varbinary", SQL_CONVERT_VARBINARY); + enumerated_type_value("varchar", SQL_CONVERT_VARCHAR); + enumerated_type_value("longvarbinary", SQL_CONVERT_LONGVARBINARY); +#if (ODBCVER >= 0x0300) + enumerated_type_value("wchar", SQL_CONVERT_WCHAR); + enumerated_type_value("interval-day-time", SQL_CONVERT_INTERVAL_DAY_TIME); + enumerated_type_value("interval-year-month", SQL_CONVERT_INTERVAL_YEAR_MONTH); + enumerated_type_value("wlongvarchar", SQL_CONVERT_WLONGVARCHAR); + enumerated_type_value("wvarchar", SQL_CONVERT_WVARCHAR); +#endif /* ODBCVER >= 0x0300 */ + close_enumerated_type(); + + /*----------------------------------------------*/ + /* SQL_INFO_LAST and SQL_INFO_DRIVER_START are */ + /* not useful anymore, because X/Open has */ + /* values in the 10000 range. */ + /*----------------------------------------------*/ +#if (ODBCVER < 0x0300) + single_value(SQL_INFO_LAST); + single_value(SQL_INFO_DRIVER_START); +#endif /* ODBCVER < 0x0300 */ + + + /*-----------------------------------------------*/ + /* ODBC 3.0 SQLGetInfo values that are not part */ + /* of the X/Open standard at this time. X/Open */ + /* standard values are in sql.h. */ + /*-----------------------------------------------*/ +#if (ODBCVER >= 0x0300) + open_enumerated_type("SQLGetInfo-extended"); + enumerated_type_value("active-environments", SQL_ACTIVE_ENVIRONMENTS); + enumerated_type_value("alter-domain", SQL_ALTER_DOMAIN); + enumerated_type_value("sql-conformance", SQL_SQL_CONFORMANCE); + enumerated_type_value("datetime-literals", SQL_DATETIME_LITERALS); + enumerated_type_value("async-mode", SQL_ASYNC_MODE); + enumerated_type_value("batch-row-count", SQL_BATCH_ROW_COUNT); + enumerated_type_value("batch-support", SQL_BATCH_SUPPORT); + enumerated_type_value("catalog-location", SQL_CATALOG_LOCATION); + enumerated_type_value("catalog-name-separator", SQL_CATALOG_NAME_SEPARATOR); + enumerated_type_value("catalog-term", SQL_CATALOG_TERM); + enumerated_type_value("catalog-usage", SQL_CATALOG_USAGE); + enumerated_type_value("create-assertion", SQL_CREATE_ASSERTION); + enumerated_type_value("create-character-set", SQL_CREATE_CHARACTER_SET); + enumerated_type_value("create-collatiom", SQL_CREATE_COLLATION); + enumerated_type_value("create-domain", SQL_CREATE_DOMAIN); + enumerated_type_value("create-schema", SQL_CREATE_SCHEMA); + enumerated_type_value("create-table", SQL_CREATE_TABLE); + enumerated_type_value("create-translation", SQL_CREATE_TRANSLATION); + enumerated_type_value("create-view", SQL_CREATE_VIEW); + enumerated_type_value("driver-handle-description", SQL_DRIVER_HDESC); + enumerated_type_value("drop-assertion", SQL_DROP_ASSERTION); + enumerated_type_value("drop-character-set", SQL_DROP_CHARACTER_SET); + enumerated_type_value("drop-collation", SQL_DROP_COLLATION); + enumerated_type_value("drop-domain", SQL_DROP_DOMAIN); + enumerated_type_value("drop-schema", SQL_DROP_SCHEMA); + enumerated_type_value("drop-table", SQL_DROP_TABLE); + enumerated_type_value("drop-translation", SQL_DROP_TRANSLATION); + enumerated_type_value("drop-view", SQL_DROP_VIEW); + enumerated_type_value("dynamic-cursor-attributes1", SQL_DYNAMIC_CURSOR_ATTRIBUTES1); + enumerated_type_value("dynamic-cursor-attributes2", SQL_DYNAMIC_CURSOR_ATTRIBUTES2); + enumerated_type_value("forward-only-cursor-attributes1", SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1); + enumerated_type_value("forward-only-cursor-attributes2", SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2); + enumerated_type_value("index-keywords", SQL_INDEX_KEYWORDS); + enumerated_type_value("info-schema-views", SQL_INFO_SCHEMA_VIEWS); + enumerated_type_value("keyset-cursor-attributes1", SQL_KEYSET_CURSOR_ATTRIBUTES1); + enumerated_type_value("keyset-cursor-attributes2", SQL_KEYSET_CURSOR_ATTRIBUTES2); + enumerated_type_value("max-async-concurrent-statements", SQL_MAX_ASYNC_CONCURRENT_STATEMENTS); + enumerated_type_value("odbc-interface-conformance", SQL_ODBC_INTERFACE_CONFORMANCE); + enumerated_type_value("parameter-array-row-counts", SQL_PARAM_ARRAY_ROW_COUNTS); + enumerated_type_value("parameter-array-selects", SQL_PARAM_ARRAY_SELECTS); + enumerated_type_value("schema-term", SQL_SCHEMA_TERM); + enumerated_type_value("schema-usage", SQL_SCHEMA_USAGE); + enumerated_type_value("sql92-datetime-functions", SQL_SQL92_DATETIME_FUNCTIONS); + enumerated_type_value("sql92-foreign-key-delete-rule", SQL_SQL92_FOREIGN_KEY_DELETE_RULE); + enumerated_type_value("sql92-foreign-key-update-rule", SQL_SQL92_FOREIGN_KEY_UPDATE_RULE); + enumerated_type_value("sql92-grant", SQL_SQL92_GRANT); + enumerated_type_value("sql92-numeric-value-functions", SQL_SQL92_NUMERIC_VALUE_FUNCTIONS); + enumerated_type_value("sql92-predicates", SQL_SQL92_PREDICATES); + enumerated_type_value("sql92-relational-join-operations", SQL_SQL92_RELATIONAL_JOIN_OPERATORS); + enumerated_type_value("sql92-revoke", SQL_SQL92_REVOKE); + enumerated_type_value("sql92-row-value-constructor", SQL_SQL92_ROW_VALUE_CONSTRUCTOR); + enumerated_type_value("sql92-string-functions", SQL_SQL92_STRING_FUNCTIONS); + enumerated_type_value("sql92-value-expressions", SQL_SQL92_VALUE_EXPRESSIONS); + enumerated_type_value("standard-cli-conformance", SQL_STANDARD_CLI_CONFORMANCE); + enumerated_type_value("static-cursor-attributes1", SQL_STATIC_CURSOR_ATTRIBUTES1); + enumerated_type_value("static-cursor-attributes2", SQL_STATIC_CURSOR_ATTRIBUTES2); + enumerated_type_value("aggregate-functions", SQL_AGGREGATE_FUNCTIONS); + enumerated_type_value("ddl-index", SQL_DDL_INDEX); + enumerated_type_value("dm-ver", SQL_DM_VER); + enumerated_type_value("insert-statement", SQL_INSERT_STATEMENT); + enumerated_type_value("union-statement", SQL_UNION_STATEMENT); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + + single_value(SQL_DTC_TRANSITION_COST); + next_block(); + + /* SQL_ALTER_TABLE bitmasks */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("altertable-extended"); + enumerated_type_value("add-column-single", SQL_AT_ADD_COLUMN_SINGLE); + enumerated_type_value("add-column-default", SQL_AT_ADD_COLUMN_DEFAULT); + enumerated_type_value("add-column-collation", SQL_AT_ADD_COLUMN_COLLATION); + enumerated_type_value("set-column-default", SQL_AT_SET_COLUMN_DEFAULT); + enumerated_type_value("drop-column-default", SQL_AT_DROP_COLUMN_DEFAULT); + enumerated_type_value("drop-column-cascade", SQL_AT_DROP_COLUMN_CASCADE); + enumerated_type_value("drop-column-restrict", SQL_AT_DROP_COLUMN_RESTRICT); + enumerated_type_value("add-table-constraint", SQL_AT_ADD_TABLE_CONSTRAINT); + enumerated_type_value("drop-table-constraint-cascade", SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE); + enumerated_type_value("drop-table-constraint-restrict", SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT); + enumerated_type_value("constraint-name-definition", SQL_AT_CONSTRAINT_NAME_DEFINITION); + enumerated_type_value("constraint-initially-deferred", SQL_AT_CONSTRAINT_INITIALLY_DEFERRED); + enumerated_type_value("constraint-initially-immediate", SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE); + enumerated_type_value("constraint-deferrable", SQL_AT_CONSTRAINT_DEFERRABLE); + enumerated_type_value("constraint-non-deferrable", SQL_AT_CONSTRAINT_NON_DEFERRABLE); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + + /* SQL_CONVERT_* return value bitmasks */ + open_enumerated_type("SQLConvert-extended"); + enumerated_type_value("char", SQL_CVT_CHAR); + enumerated_type_value("numeric", SQL_CVT_NUMERIC); + enumerated_type_value("decimal", SQL_CVT_DECIMAL); + enumerated_type_value("integer", SQL_CVT_INTEGER); + enumerated_type_value("smallint", SQL_CVT_SMALLINT); + enumerated_type_value("float", SQL_CVT_FLOAT); + enumerated_type_value("real", SQL_CVT_REAL); + enumerated_type_value("real", SQL_CVT_REAL); + enumerated_type_value("double", SQL_CVT_DOUBLE); + enumerated_type_value("varchar", SQL_CVT_VARCHAR); + enumerated_type_value("longvarchar", SQL_CVT_LONGVARCHAR); + enumerated_type_value("binary", SQL_CVT_BINARY); + enumerated_type_value("varbinary", SQL_CVT_VARBINARY); + enumerated_type_value("bit", SQL_CVT_BIT); + enumerated_type_value("tinyint", SQL_CVT_TINYINT); + enumerated_type_value("bigint", SQL_CVT_BIGINT); + enumerated_type_value("date", SQL_CVT_DATE); + enumerated_type_value("time", SQL_CVT_TIME); + enumerated_type_value("timestamp", SQL_CVT_TIMESTAMP); + enumerated_type_value("longvarbinary", SQL_CVT_LONGVARBINARY); +#if (ODBCVER >= 0x0300) + enumerated_type_value("interval-year-month", SQL_CVT_INTERVAL_YEAR_MONTH); + enumerated_type_value("interval-day-time", SQL_CVT_INTERVAL_DAY_TIME); + enumerated_type_value("wchar", SQL_CVT_WCHAR); + enumerated_type_value("wlongvarchar", SQL_CVT_WLONGVARCHAR); + enumerated_type_value("wvarchar", SQL_CVT_WVARCHAR); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + + /* SQL_CONVERT_FUNCTIONS functions */ + single_value(SQL_FN_CVT_CONVERT); +#if (ODBCVER >= 0x0300) + single_value(SQL_FN_CVT_CAST); +#endif /* ODBCVER >= 0x0300 */ + next_block(); + + /* SQL_STRING_FUNCTIONS functions */ + open_enumerated_type("string-functions"); + enumerated_type_value("concat", SQL_FN_STR_CONCAT); + enumerated_type_value("insert", SQL_FN_STR_INSERT); + enumerated_type_value("left", SQL_FN_STR_LEFT); + enumerated_type_value("ltrim", SQL_FN_STR_LTRIM); + enumerated_type_value("length", SQL_FN_STR_LENGTH); + enumerated_type_value("locate", SQL_FN_STR_LOCATE); + enumerated_type_value("lcase", SQL_FN_STR_LCASE); + enumerated_type_value("repeat", SQL_FN_STR_REPEAT); + enumerated_type_value("left", SQL_FN_STR_REPLACE); + enumerated_type_value("right", SQL_FN_STR_RIGHT); + enumerated_type_value("rtrim", SQL_FN_STR_RTRIM); + enumerated_type_value("substring", SQL_FN_STR_SUBSTRING); + enumerated_type_value("ucase", SQL_FN_STR_UCASE); + enumerated_type_value("ascii", SQL_FN_STR_ASCII); + enumerated_type_value("char", SQL_FN_STR_CHAR); + enumerated_type_value("difference", SQL_FN_STR_DIFFERENCE); + enumerated_type_value("locate-2", SQL_FN_STR_LOCATE_2); + enumerated_type_value("soundex", SQL_FN_STR_SOUNDEX); + enumerated_type_value("space", SQL_FN_STR_SPACE); +#if (ODBCVER >= 0x0300) + enumerated_type_value("bit-length", SQL_FN_STR_BIT_LENGTH); + enumerated_type_value("char-length", SQL_FN_STR_CHAR_LENGTH); + enumerated_type_value("character-length", SQL_FN_STR_CHARACTER_LENGTH); + enumerated_type_value("octet-length", SQL_FN_STR_OCTET_LENGTH); + enumerated_type_value("position", SQL_FN_STR_POSITION); +#endif /* ODBCVER >= 0x0300 */ + close_enumerated_type(); + + /* SQL_SQL92_STRING_FUNCTIONS */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("sql92-string-functions"); + enumerated_type_value("convert", SQL_SSF_CONVERT); + enumerated_type_value("lower", SQL_SSF_LOWER); + enumerated_type_value("upper", SQL_SSF_UPPER); + enumerated_type_value("substring", SQL_SSF_SUBSTRING); + enumerated_type_value("translate", SQL_SSF_TRANSLATE); + enumerated_type_value("trim-both", SQL_SSF_TRIM_BOTH); + enumerated_type_value("trim-leading", SQL_SSF_TRIM_LEADING); + enumerated_type_value("trim-trailing", SQL_SSF_TRIM_TRAILING); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + + /* SQL_NUMERIC_FUNCTIONS functions */ + open_enumerated_type("numeric-functions"); + enumerated_type_value("abs", SQL_FN_NUM_ABS); + enumerated_type_value("acos", SQL_FN_NUM_ACOS); + enumerated_type_value("asin", SQL_FN_NUM_ASIN); + enumerated_type_value("atan", SQL_FN_NUM_ATAN); + enumerated_type_value("atan-2", SQL_FN_NUM_ATAN2); + enumerated_type_value("ceiling", SQL_FN_NUM_CEILING); + enumerated_type_value("cos", SQL_FN_NUM_COS); + enumerated_type_value("cot", SQL_FN_NUM_COT); + enumerated_type_value("exp", SQL_FN_NUM_EXP); + enumerated_type_value("floor", SQL_FN_NUM_FLOOR); + enumerated_type_value("log", SQL_FN_NUM_LOG); + enumerated_type_value("mod", SQL_FN_NUM_MOD); + enumerated_type_value("sign", SQL_FN_NUM_SIGN); + enumerated_type_value("sin", SQL_FN_NUM_SIN); + enumerated_type_value("sort", SQL_FN_NUM_SQRT); + enumerated_type_value("tan", SQL_FN_NUM_TAN); + enumerated_type_value("pi", SQL_FN_NUM_PI); + enumerated_type_value("rand", SQL_FN_NUM_RAND); + enumerated_type_value("degrees", SQL_FN_NUM_DEGREES); + enumerated_type_value("log10", SQL_FN_NUM_LOG10); + enumerated_type_value("power", SQL_FN_NUM_POWER); + enumerated_type_value("radians", SQL_FN_NUM_RADIANS); + enumerated_type_value("round", SQL_FN_NUM_ROUND); + enumerated_type_value("truncate", SQL_FN_NUM_TRUNCATE); + close_enumerated_type(); + + /* SQL_SQL92_NUMERIC_VALUE_FUNCTIONS */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("sql92-numeric-value-functions"); + enumerated_type_value("bit-length", SQL_SNVF_BIT_LENGTH); + enumerated_type_value("char-length", SQL_SNVF_CHAR_LENGTH); + enumerated_type_value("character-length", SQL_SNVF_CHARACTER_LENGTH); + enumerated_type_value("extract", SQL_SNVF_EXTRACT); + enumerated_type_value("octet-length", SQL_SNVF_OCTET_LENGTH); + enumerated_type_value("position", SQL_SNVF_POSITION); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + + + /* SQL_TIMEDATE_FUNCTIONS functions */ + open_enumerated_type("timedate-functions"); + enumerated_type_value("now", SQL_FN_TD_NOW); + enumerated_type_value("cur-date", SQL_FN_TD_CURDATE); + enumerated_type_value("day-of-month", SQL_FN_TD_DAYOFMONTH); + enumerated_type_value("day-of-week", SQL_FN_TD_DAYOFWEEK); + enumerated_type_value("day-of-year", SQL_FN_TD_DAYOFYEAR); + enumerated_type_value("month", SQL_FN_TD_MONTH); + enumerated_type_value("quarter", SQL_FN_TD_QUARTER); + enumerated_type_value("week", SQL_FN_TD_WEEK); + enumerated_type_value("year", SQL_FN_TD_YEAR); + enumerated_type_value("cur-time", SQL_FN_TD_CURTIME); + enumerated_type_value("hour", SQL_FN_TD_HOUR); + enumerated_type_value("minute", SQL_FN_TD_MINUTE); + enumerated_type_value("second", SQL_FN_TD_SECOND); + enumerated_type_value("time-stamp-add", SQL_FN_TD_TIMESTAMPADD); + enumerated_type_value("time-stamp-diff", SQL_FN_TD_TIMESTAMPDIFF); + enumerated_type_value("day-name", SQL_FN_TD_DAYNAME); + enumerated_type_value("month-name", SQL_FN_TD_MONTHNAME); +#if (ODBCVER >= 0x0300) + enumerated_type_value("current-date", SQL_FN_TD_CURRENT_DATE); + enumerated_type_value("current-time", SQL_FN_TD_CURRENT_TIME); + enumerated_type_value("current-timestamp", SQL_FN_TD_CURRENT_TIMESTAMP); + enumerated_type_value("extract", SQL_FN_TD_EXTRACT); +#endif /* ODBCVER >= 0x0300 */ + close_enumerated_type(); + + /* SQL_SQL92_DATETIME_FUNCTIONS */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("sql92-datetime-functions"); + enumerated_type_value("current-date", SQL_SDF_CURRENT_DATE); + enumerated_type_value("current-time", SQL_SDF_CURRENT_TIME); + enumerated_type_value("current-timestamp", SQL_SDF_CURRENT_TIMESTAMP); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + + /* SQL_SYSTEM_FUNCTIONS functions */ + open_enumerated_type("system-functions"); + enumerated_type_value("username", SQL_FN_SYS_USERNAME); + enumerated_type_value("database-name", SQL_FN_SYS_DBNAME); + enumerated_type_value("if-null", SQL_FN_SYS_IFNULL); + close_enumerated_type(); + + /* SQL_TIMEDATE_ADD_INTERVALS and SQL_TIMEDATE_DIFF_INTERVALS functions */ + open_enumerated_type("timdate-interval-functions"); + enumerated_type_value("frac-second", SQL_FN_TSI_FRAC_SECOND); + enumerated_type_value("second", SQL_FN_TSI_SECOND); + enumerated_type_value("minute", SQL_FN_TSI_MINUTE); + enumerated_type_value("hour", SQL_FN_TSI_HOUR) + enumerated_type_value("day", SQL_FN_TSI_DAY); + enumerated_type_value("week", SQL_FN_TSI_WEEK); + enumerated_type_value("month", SQL_FN_TSI_MONTH); + enumerated_type_value("quarter", SQL_FN_TSI_QUARTER); + enumerated_type_value("year", SQL_FN_TSI_YEAR); + close_enumerated_type(); + + /* bitmasks for SQL_DYNAMIC_CURSOR_ATTRIBUTES1, + * SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1, + * SQL_KEYSET_CURSOR_ATTRIBUTES1, and SQL_STATIC_CURSOR_ATTRIBUTES1 + */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("cursor-attributes1"); + /* supported SQLFetchScroll FetchOrientation's */ + enumerated_type_value("next", SQL_CA1_NEXT); + enumerated_type_value("absolute", SQL_CA1_ABSOLUTE); + enumerated_type_value("relative", SQL_CA1_RELATIVE); + enumerated_type_value("bookmark", SQL_CA1_BOOKMARK); + + /* supported SQLSetPos LockType's */ + enumerated_type_value("lock-no-change", SQL_CA1_LOCK_NO_CHANGE); + enumerated_type_value("lock-exklusive", SQL_CA1_LOCK_EXCLUSIVE); + enumerated_type_value("lock-unlock", SQL_CA1_LOCK_UNLOCK); + + /* supported SQLSetPos Operations */ + enumerated_type_value("pos-position", SQL_CA1_POS_POSITION); + enumerated_type_value("pos-update", SQL_CA1_POS_UPDATE); + enumerated_type_value("delete", SQL_CA1_POS_DELETE); + enumerated_type_value("refresh", SQL_CA1_POS_REFRESH); + + /* positioned updates and deletes */ + enumerated_type_value("positioned-update", SQL_CA1_POSITIONED_UPDATE); + enumerated_type_value("delete", SQL_CA1_POSITIONED_DELETE); + enumerated_type_value("select-for-update", SQL_CA1_SELECT_FOR_UPDATE); + + /* supported SQLBulkOperations operations */ + enumerated_type_value("bulk-add", SQL_CA1_BULK_ADD); + enumerated_type_value("bulk-update-by-bookmark", SQL_CA1_BULK_UPDATE_BY_BOOKMARK); + enumerated_type_value("bulk-delete-by-bookmark", SQL_CA1_BULK_DELETE_BY_BOOKMARK); + enumerated_type_value("bulk-fetch-by-bookmark", SQL_CA1_BULK_FETCH_BY_BOOKMARK); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + + /* bitmasks for SQL_DYNAMIC_CURSOR_ATTRIBUTES2, + * SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2, + * SQL_KEYSET_CURSOR_ATTRIBUTES2, and SQL_STATIC_CURSOR_ATTRIBUTES2 + */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("cursor-attributes2"); + /* supported values for SQL_ATTR_SCROLL_CONCURRENCY */ + enumerated_type_value("read-only-concurrency", SQL_CA2_READ_ONLY_CONCURRENCY); + enumerated_type_value("lock-concurrency", SQL_CA2_LOCK_CONCURRENCY); + enumerated_type_value("opt-rowver-concurrency", SQL_CA2_OPT_ROWVER_CONCURRENCY); + enumerated_type_value("opt-values-concurrency", SQL_CA2_OPT_VALUES_CONCURRENCY); + + /* sensitivity of the cursor to its own inserts, deletes, and updates */ + enumerated_type_value("sensitivity-additions", SQL_CA2_SENSITIVITY_ADDITIONS); + enumerated_type_value("sensitivity-deletions", SQL_CA2_SENSITIVITY_DELETIONS); + enumerated_type_value("sensitivity-updates", SQL_CA2_SENSITIVITY_UPDATES); + + /* semantics of SQL_ATTR_MAX_ROWS */ + enumerated_type_value("max-rows-select", SQL_CA2_MAX_ROWS_SELECT); + enumerated_type_value("max-rows-insert", SQL_CA2_MAX_ROWS_INSERT); + enumerated_type_value("max-rows-delete", SQL_CA2_MAX_ROWS_DELETE); + enumerated_type_value("max-rows-update", SQL_CA2_MAX_ROWS_UPDATE); + enumerated_type_value("max-rows-catalog", SQL_CA2_MAX_ROWS_CATALOG); + enumerated_type_value("max-rows-affects-all", SQL_CA2_MAX_ROWS_AFFECTS_ALL); + + /* semantics of SQL_DIAG_CURSOR_ROW_COUNT */ + enumerated_type_value("crc-exact", SQL_CA2_CRC_EXACT); + enumerated_type_value("crc-approximate", SQL_CA2_CRC_APPROXIMATE); + + /* the kinds of positioned statements that can be simulated */ + enumerated_type_value("simulate-non-unique", SQL_CA2_SIMULATE_NON_UNIQUE); + enumerated_type_value("simulate-try-unique", SQL_CA2_SIMULATE_TRY_UNIQUE); + enumerated_type_value("simulate-unique", SQL_CA2_SIMULATE_UNIQUE); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + + /* SQL_ODBC_API_CONFORMANCE values */ + open_enumerated_type("odbc-api-conformance"); + enumerated_type_value("none", SQL_OAC_NONE); + enumerated_type_value("level-1", SQL_OAC_LEVEL1); + enumerated_type_value("level-2", SQL_OAC_LEVEL2); + close_enumerated_type(); + + /* SQL_ODBC_SAG_CLI_CONFORMANCE values */ + open_enumerated_type("odbc-sag-cli-conformance"); + enumerated_type_value("not-compliant", SQL_OSCC_NOT_COMPLIANT); + enumerated_type_value("compliant", SQL_OSCC_COMPLIANT); + close_enumerated_type(); + + /* SQL_ODBC_SQL_CONFORMANCE values */ + open_enumerated_type("odbc-sql-conformance"); + enumerated_type_value("minimum", SQL_OSC_MINIMUM); + enumerated_type_value("core", SQL_OSC_CORE); + enumerated_type_value("extended", SQL_OSC_EXTENDED); + close_enumerated_type(); + + /* SQL_CONCAT_NULL_BEHAVIOR values */ + single_value(SQL_CB_NULL); + single_value(SQL_CB_NON_NULL); + next_block(); + + /* SQL_SCROLL_OPTIONS masks */ + open_enumerated_type("scroll-options"); + enumerated_type_value("forward-only", SQL_SO_FORWARD_ONLY); + enumerated_type_value("keyset-driven", SQL_SO_KEYSET_DRIVEN); + enumerated_type_value("dynamic", SQL_SO_DYNAMIC); + enumerated_type_value("mixed", SQL_SO_MIXED); + enumerated_type_value("static", SQL_SO_STATIC); + close_enumerated_type(); + + /* SQL_FETCH_DIRECTION masks */ + /* SQL_FETCH_RESUME is no longer supported */ + single_value(SQL_FD_FETCH_BOOKMARK); + next_block(); + + /* SQL_CORRELATION_NAME values */ + open_enumerated_type("correlation-name"); + enumerated_type_value("none", SQL_CN_NONE); + enumerated_type_value("different", SQL_CN_DIFFERENT); + enumerated_type_value("any", SQL_CN_ANY); + close_enumerated_type(); + + /* SQL_NON_NULLABLE_COLUMNS values */ + single_value(SQL_NNC_NULL); + single_value(SQL_NNC_NON_NULL); + next_block(); + + /* SQL_NULL_COLLATION values */ + single_value(SQL_NC_START); + single_value(SQL_NC_END); + next_block(); + + /* SQL_FILE_USAGE values */ + open_enumerated_type("file-usage"); + enumerated_type_value("not-supported", SQL_FILE_NOT_SUPPORTED); + enumerated_type_value("table", SQL_FILE_TABLE); + enumerated_type_value("qualifier", SQL_FILE_QUALIFIER); + enumerated_type_value("catalog", SQL_FILE_CATALOG); + close_enumerated_type(); + + /* SQL_GETDATA_EXTENSIONS values */ + single_value(SQL_GD_BLOCK); + single_value(SQL_GD_BOUND); + next_block(); + + /* SQL_POSITIONED_STATEMENTS masks */ + open_enumerated_type("positioned-statements"); + enumerated_type_value("positioned-delete", SQL_PS_POSITIONED_DELETE); + enumerated_type_value("positioned-update", SQL_PS_POSITIONED_UPDATE); + enumerated_type_value("select-for-update", SQL_PS_SELECT_FOR_UPDATE); + close_enumerated_type(); + + + /* SQL_GROUP_BY values */ + open_enumerated_type("group-by"); + enumerated_type_value("not-supported", SQL_GB_NOT_SUPPORTED); + enumerated_type_value("group-by-equals-select", SQL_GB_GROUP_BY_EQUALS_SELECT); + enumerated_type_value("group-by-contains-select", SQL_GB_GROUP_BY_CONTAINS_SELECT); + enumerated_type_value("no-relation", SQL_GB_NO_RELATION); +#if (ODBCVER >= 0x0300) + enumerated_type_value("collate", SQL_GB_COLLATE); +#endif /* ODBCVER >= 0x0300 */ + close_enumerated_type(); + + /* SQL_OWNER_USAGE masks */ + open_enumerated_type("owner-usage"); + enumerated_type_value("dml-statements", SQL_OU_DML_STATEMENTS); + enumerated_type_value("procedure-invocation", SQL_OU_PROCEDURE_INVOCATION); + enumerated_type_value("table-definition", SQL_OU_TABLE_DEFINITION); + enumerated_type_value("index-definition", SQL_OU_INDEX_DEFINITION); + enumerated_type_value("privilege-definition", SQL_OU_PRIVILEGE_DEFINITION); + close_enumerated_type(); + + /* SQL_SCHEMA_USAGE masks */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("schema-usage"); + enumerated_type_value("dml-statements", SQL_SU_DML_STATEMENTS); + enumerated_type_value("procedure-invocation", SQL_SU_PROCEDURE_INVOCATION); + enumerated_type_value("table-definition", SQL_SU_TABLE_DEFINITION); + enumerated_type_value("index-definition", SQL_SU_INDEX_DEFINITION); + enumerated_type_value("privilege-definition", SQL_SU_PRIVILEGE_DEFINITION); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + + /* SQL_QUALIFIER_USAGE masks */ + open_enumerated_type("qualifier-usage"); + enumerated_type_value("dml-statements", SQL_QU_DML_STATEMENTS); + enumerated_type_value("procedure-invocation", SQL_QU_PROCEDURE_INVOCATION); + enumerated_type_value("table-definition", SQL_QU_TABLE_DEFINITION); + enumerated_type_value("index-definition", SQL_QU_INDEX_DEFINITION); + enumerated_type_value("privilege-definition", SQL_QU_PRIVILEGE_DEFINITION); + close_enumerated_type(); + + /* SQL_CATALOG_USAGE masks */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("catalog-usage"); + enumerated_type_value("dml-statements", SQL_CU_DML_STATEMENTS); + enumerated_type_value("procedure-invocation", SQL_CU_PROCEDURE_INVOCATION); + enumerated_type_value("table-definition", SQL_CU_TABLE_DEFINITION); + enumerated_type_value("index-definition", SQL_CU_INDEX_DEFINITION); + enumerated_type_value("privilege-definition", SQL_CU_PRIVILEGE_DEFINITION); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + + /* SQL_SUBQUERIES masks */ + open_enumerated_type("subqueries"); + enumerated_type_value("comparison", SQL_SQ_COMPARISON); + enumerated_type_value("exists", SQL_SQ_EXISTS); + enumerated_type_value("in", SQL_SQ_IN); + enumerated_type_value("quantified", SQL_SQ_QUANTIFIED); + enumerated_type_value("correlated-subqueries", SQL_SQ_CORRELATED_SUBQUERIES); + close_enumerated_type(); + + /* SQL_UNION masks */ + single_value(SQL_U_UNION); + single_value(SQL_U_UNION_ALL); + next_block(); + + /* SQL_BOOKMARK_PERSISTENCE values */ + open_enumerated_type("bookmark-persistence"); + enumerated_type_value("close", SQL_BP_CLOSE); + enumerated_type_value("delete", SQL_BP_DELETE); + enumerated_type_value("drop", SQL_BP_DROP); + enumerated_type_value("transaction", SQL_BP_TRANSACTION); + enumerated_type_value("update", SQL_BP_UPDATE); + enumerated_type_value("other-handle-statement", SQL_BP_OTHER_HSTMT); + enumerated_type_value("scroll", SQL_BP_SCROLL); + close_enumerated_type(); + + /* SQL_STATIC_SENSITIVITY values */ + open_enumerated_type("static-sensitivity"); + enumerated_type_value("additions", SQL_SS_ADDITIONS); + enumerated_type_value("deletions", SQL_SS_DELETIONS); + enumerated_type_value("updates", SQL_SS_UPDATES); + close_enumerated_type(); + + /* SQL_VIEW values */ + open_enumerated_type("view"); + enumerated_type_value("create-view", SQL_CV_CREATE_VIEW); + enumerated_type_value("check-option", SQL_CV_CHECK_OPTION); + enumerated_type_value("cascaded", SQL_CV_CASCADED); + enumerated_type_value("local", SQL_CV_LOCAL); + close_enumerated_type(); + + /* SQL_LOCK_TYPES masks */ + open_enumerated_type("lock"); + enumerated_type_value("no-change", SQL_LCK_NO_CHANGE); + enumerated_type_value("exclusive", SQL_LCK_EXCLUSIVE); + enumerated_type_value("unlock", SQL_LCK_UNLOCK); + close_enumerated_type(); + + /* SQL_POS_OPERATIONS masks */ + open_enumerated_type("position-operations"); + enumerated_type_value("position", SQL_POS_POSITION); + enumerated_type_value("refresh", SQL_POS_REFRESH); + enumerated_type_value("update", SQL_POS_UPDATE); + enumerated_type_value("delete", SQL_POS_DELETE); + enumerated_type_value("add", SQL_POS_ADD); + close_enumerated_type(); + + /* SQL_QUALIFIER_LOCATION values */ + single_value(SQL_QL_START); + single_value(SQL_QL_END); + next_block(); + + /* Here start return values for ODBC 3.0 SQLGetInfo */ + +#if (ODBCVER >= 0x0300) + /* SQL_AGGREGATE_FUNCTIONS bitmasks */ + open_enumerated_type("aggregate-functions"); + enumerated_type_value("average", SQL_AF_AVG); + enumerated_type_value("count", SQL_AF_COUNT); + enumerated_type_value("max", SQL_AF_MAX); + enumerated_type_value("min", SQL_AF_MIN); + enumerated_type_value("sum", SQL_AF_SUM); + enumerated_type_value("distinct", SQL_AF_DISTINCT); + enumerated_type_value("all", SQL_AF_ALL); + close_enumerated_type(); + + /* SQL_SQL_CONFORMANCE bit masks */ + open_enumerated_type("sql-conformance"); + enumerated_type_value("sql92-entry", SQL_SC_SQL92_ENTRY); + enumerated_type_value("fips127-2-transitional", SQL_SC_FIPS127_2_TRANSITIONAL); + enumerated_type_value("sql92-intermediate", SQL_SC_SQL92_INTERMEDIATE); + enumerated_type_value("sql92-full", SQL_SC_SQL92_FULL); + close_enumerated_type(); + + /* SQL_DATETIME_LITERALS masks */ + open_enumerated_type("datetime-literals-sql92"); + enumerated_type_value("date", SQL_DL_SQL92_DATE); + enumerated_type_value("time", SQL_DL_SQL92_TIME); + enumerated_type_value("timestamp", SQL_DL_SQL92_TIMESTAMP); + enumerated_type_value("interval-year", SQL_DL_SQL92_INTERVAL_YEAR); + enumerated_type_value("interval-month", SQL_DL_SQL92_INTERVAL_MONTH); + enumerated_type_value("interval-day", SQL_DL_SQL92_INTERVAL_DAY); + enumerated_type_value("interval-hour", SQL_DL_SQL92_INTERVAL_HOUR); + enumerated_type_value("interval-minute", SQL_DL_SQL92_INTERVAL_MINUTE); + enumerated_type_value("interval-second", SQL_DL_SQL92_INTERVAL_SECOND); + enumerated_type_value("interval-year-to-month", SQL_DL_SQL92_INTERVAL_YEAR_TO_MONTH); + enumerated_type_value("interval-day-to-hour", SQL_DL_SQL92_INTERVAL_DAY_TO_HOUR); + enumerated_type_value("interval-day-to-minute", SQL_DL_SQL92_INTERVAL_DAY_TO_MINUTE); + enumerated_type_value("interval-day-to-second", SQL_DL_SQL92_INTERVAL_DAY_TO_SECOND); + enumerated_type_value("interval-hour-to-minute", SQL_DL_SQL92_INTERVAL_HOUR_TO_MINUTE); + enumerated_type_value("interval-hour-to-second", SQL_DL_SQL92_INTERVAL_HOUR_TO_SECOND); + enumerated_type_value("interval-minute-to-second", SQL_DL_SQL92_INTERVAL_MINUTE_TO_SECOND); + close_enumerated_type(); + + /* SQL_CATALOG_LOCATION values */ + single_value(SQL_CL_START); + single_value(SQL_CL_END); + next_block(); + + /* values for SQL_BATCH_ROW_COUNT */ + open_enumerated_type("batch-row-count"); + enumerated_type_value("procedures", SQL_BRC_PROCEDURES); + enumerated_type_value("explicit", SQL_BRC_EXPLICIT); + enumerated_type_value("rolled-up", SQL_BRC_ROLLED_UP); + close_enumerated_type(); + + /* bitmasks for SQL_BATCH_SUPPORT */ + open_enumerated_type("batch-support"); + enumerated_type_value("select-explicit", SQL_BS_SELECT_EXPLICIT); + enumerated_type_value("row-count-explicit", SQL_BS_ROW_COUNT_EXPLICIT); + enumerated_type_value("select-procedure", SQL_BS_SELECT_PROC); + enumerated_type_value("row-count-procedure", SQL_BS_ROW_COUNT_PROC); + close_enumerated_type(); + + /* Values for SQL_PARAM_ARRAY_ROW_COUNTS getinfo */ + single_value(SQL_PARC_BATCH); + single_value(SQL_PARC_NO_BATCH); + next_block(); + + /* values for SQL_PARAM_ARRAY_SELECTS */ + open_enumerated_type("parameter-array-selects"); + enumerated_type_value("batch", SQL_PAS_BATCH); + enumerated_type_value("no-batch", SQL_PAS_NO_BATCH); + enumerated_type_value("no-select", SQL_PAS_NO_SELECT); + close_enumerated_type(); + + /* Bitmasks for SQL_INDEX_KEYWORDS */ + open_enumerated_type("index-keywords"); + enumerated_type_value("none", SQL_IK_NONE); + enumerated_type_value("asc", SQL_IK_ASC); + enumerated_type_value("desc", SQL_IK_DESC); + enumerated_type_value("all", SQL_IK_ALL); + close_enumerated_type(); + + /* Bitmasks for SQL_INFO_SCHEMA_VIEWS */ + open_enumerated_type("info-schema-views"); + enumerated_type_value("assertions", SQL_ISV_ASSERTIONS); + enumerated_type_value("character-sets", SQL_ISV_CHARACTER_SETS); + enumerated_type_value("check-constraints", SQL_ISV_CHECK_CONSTRAINTS); + enumerated_type_value("collations", SQL_ISV_COLLATIONS); + enumerated_type_value("column-domain-usage", SQL_ISV_COLUMN_DOMAIN_USAGE); + enumerated_type_value("column-privileges", SQL_ISV_COLUMN_PRIVILEGES); + enumerated_type_value("columns", SQL_ISV_COLUMNS); + enumerated_type_value("constraint-column-usage", SQL_ISV_CONSTRAINT_COLUMN_USAGE); + enumerated_type_value("constraint-table-usage", SQL_ISV_CONSTRAINT_TABLE_USAGE); + enumerated_type_value("domain-constraints", SQL_ISV_DOMAIN_CONSTRAINTS); + enumerated_type_value("domains", SQL_ISV_DOMAINS); + enumerated_type_value("key-column-usage", SQL_ISV_KEY_COLUMN_USAGE); + enumerated_type_value("referential-constraints", SQL_ISV_REFERENTIAL_CONSTRAINTS); + enumerated_type_value("schemata", SQL_ISV_SCHEMATA); + enumerated_type_value("languages", SQL_ISV_SQL_LANGUAGES); + enumerated_type_value("table-constraints", SQL_ISV_TABLE_CONSTRAINTS); + enumerated_type_value("table-privileges", SQL_ISV_TABLE_PRIVILEGES); + enumerated_type_value("tables", SQL_ISV_TABLES); + enumerated_type_value("translations", SQL_ISV_TRANSLATIONS); + enumerated_type_value("usage-privileges", SQL_ISV_USAGE_PRIVILEGES); + enumerated_type_value("view-column-usage", SQL_ISV_VIEW_COLUMN_USAGE); + enumerated_type_value("view-table-usage", SQL_ISV_VIEW_TABLE_USAGE); + enumerated_type_value("views", SQL_ISV_VIEWS); + close_enumerated_type(); + + /* Bitmasks for SQL_ASYNC_MODE */ + open_enumerated_type("async-mode"); + enumerated_type_value("none", SQL_AM_NONE); + enumerated_type_value("connection", SQL_AM_CONNECTION); + enumerated_type_value("statement", SQL_AM_STATEMENT); + close_enumerated_type(); + + /* Bitmasks for SQL_ALTER_DOMAIN */ + open_enumerated_type("alter-domain"); + enumerated_type_value("constraint-name-definition", SQL_AD_CONSTRAINT_NAME_DEFINITION); + enumerated_type_value("add-domain-constraint", SQL_AD_ADD_DOMAIN_CONSTRAINT); + enumerated_type_value("drop-domain-constraint", SQL_AD_DROP_DOMAIN_CONSTRAINT); + enumerated_type_value("add-domain-default", SQL_AD_ADD_DOMAIN_DEFAULT); + enumerated_type_value("drop-domain-default", SQL_AD_DROP_DOMAIN_DEFAULT); + enumerated_type_value("add-constraint-initially-deferred", SQL_AD_ADD_CONSTRAINT_INITIALLY_DEFERRED); + enumerated_type_value("add-constraint-initially-immediate", SQL_AD_ADD_CONSTRAINT_INITIALLY_IMMEDIATE); + enumerated_type_value("add-constraint-deferrable", SQL_AD_ADD_CONSTRAINT_DEFERRABLE); + enumerated_type_value("non-deferrable", SQL_AD_ADD_CONSTRAINT_NON_DEFERRABLE); + close_enumerated_type(); + + /* SQL_CREATE_SCHEMA bitmasks */ + open_enumerated_type("create-schema"); + enumerated_type_value("create-schema", SQL_CS_CREATE_SCHEMA); + enumerated_type_value("authorization", SQL_CS_AUTHORIZATION); + enumerated_type_value("default-character-set", SQL_CS_DEFAULT_CHARACTER_SET); + close_enumerated_type(); + + /* SQL_CREATE_TRANSLATION bitmasks */ + single_value(SQL_CTR_CREATE_TRANSLATION); + next_block(); + + /* SQL_CREATE_ASSERTION bitmasks */ + open_enumerated_type("create-assertion"); + enumerated_type_value("create-assertion", SQL_CA_CREATE_ASSERTION); + enumerated_type_value("constraint-initially-deferred", SQL_CA_CONSTRAINT_INITIALLY_DEFERRED); + enumerated_type_value("constraint-initially-immediate", SQL_CA_CONSTRAINT_INITIALLY_IMMEDIATE); + enumerated_type_value("constraint-deferrable", SQL_CA_CONSTRAINT_DEFERRABLE); + enumerated_type_value("constraint-non-deferrable", SQL_CA_CONSTRAINT_NON_DEFERRABLE); + close_enumerated_type(); + + /* SQL_CREATE_CHARACTER_SET bitmasks */ + open_enumerated_type("create-character-set"); + enumerated_type_value("create-character-set", SQL_CCS_CREATE_CHARACTER_SET); + enumerated_type_value("collate-clause", SQL_CCS_COLLATE_CLAUSE); + enumerated_type_value("limited-collation", SQL_CCS_LIMITED_COLLATION); + close_enumerated_type(); + + /* SQL_CREATE_COLLATION bitmasks */ + single_value(SQL_CCOL_CREATE_COLLATION); + next_block(); + + /* SQL_CREATE_DOMAIN bitmasks */ + open_enumerated_type("create-domain"); + enumerated_type_value("create-domain", SQL_CDO_CREATE_DOMAIN); + enumerated_type_value("default", SQL_CDO_DEFAULT); + enumerated_type_value("constraint", SQL_CDO_CONSTRAINT); + enumerated_type_value("collation", SQL_CDO_COLLATION); + enumerated_type_value("constraint-name-definition", SQL_CDO_CONSTRAINT_NAME_DEFINITION); + enumerated_type_value("constraint-initially-deferred", SQL_CDO_CONSTRAINT_INITIALLY_DEFERRED); + enumerated_type_value("constraint-initially-immediate", SQL_CDO_CONSTRAINT_INITIALLY_IMMEDIATE); + enumerated_type_value("constraint-deferrable", SQL_CDO_CONSTRAINT_DEFERRABLE); + enumerated_type_value("constraint-non-deferrable", SQL_CDO_CONSTRAINT_NON_DEFERRABLE); + close_enumerated_type(); + + /* SQL_CREATE_TABLE bitmasks */ + open_enumerated_type("create-table"); + enumerated_type_value("create-table", SQL_CT_CREATE_TABLE); + enumerated_type_value("commit-preserve", SQL_CT_COMMIT_PRESERVE); + enumerated_type_value("commit-delete", SQL_CT_COMMIT_DELETE); + enumerated_type_value("global-temporary", SQL_CT_GLOBAL_TEMPORARY); + enumerated_type_value("local-temporary", SQL_CT_LOCAL_TEMPORARY); + enumerated_type_value("constraint-initially-deferred", SQL_CT_CONSTRAINT_INITIALLY_DEFERRED); + enumerated_type_value("constraint-initially-immediate", SQL_CT_CONSTRAINT_INITIALLY_IMMEDIATE); + enumerated_type_value("constraint-deferrable", SQL_CT_CONSTRAINT_DEFERRABLE); + enumerated_type_value("constraint-non-deferrable", SQL_CT_CONSTRAINT_NON_DEFERRABLE); + enumerated_type_value("column-constraint", SQL_CT_COLUMN_CONSTRAINT); + enumerated_type_value("column-default", SQL_CT_COLUMN_DEFAULT); + enumerated_type_value("column-collation", SQL_CT_COLUMN_COLLATION); + enumerated_type_value("table-constraint", SQL_CT_TABLE_CONSTRAINT); + enumerated_type_value("constraint-name-definition", SQL_CT_CONSTRAINT_NAME_DEFINITION); + close_enumerated_type(); + + /* SQL_DDL_INDEX bitmasks */ + single_value(SQL_DI_CREATE_INDEX); + single_value(SQL_DI_DROP_INDEX); + next_block(); + + /* SQL_DROP_COLLATION bitmasks */ + single_value(SQL_DC_DROP_COLLATION); + next_block(); + + /* SQL_DROP_DOMAIN bitmasks */ + open_enumerated_type("drop-domain"); + enumerated_type_value("drop-domain", SQL_DD_DROP_DOMAIN); + enumerated_type_value("restrict", SQL_DD_RESTRICT); + enumerated_type_value("cascade", SQL_DD_CASCADE); + close_enumerated_type(); + + /* SQL_DROP_SCHEMA bitmasks */ + open_enumerated_type("drop-schema"); + enumerated_type_value("drop-schema", SQL_DS_DROP_SCHEMA); + enumerated_type_value("restrict", SQL_DS_RESTRICT); + enumerated_type_value("cascade", SQL_DS_CASCADE); + close_enumerated_type(); + + /* SQL_DROP_CHARACTER_SET bitmasks */ + single_value(SQL_DCS_DROP_CHARACTER_SET); + next_block(); + + /* SQL_DROP_ASSERTION bitmasks */ + single_value(SQL_DA_DROP_ASSERTION); + next_block(); + + /* SQL_DROP_TABLE bitmasks */ + open_enumerated_type("drop-table"); + enumerated_type_value("drop-table", SQL_DT_DROP_TABLE); + enumerated_type_value("restrict", SQL_DT_RESTRICT); + enumerated_type_value("cascade", SQL_DT_CASCADE); + close_enumerated_type(); + + /* SQL_DROP_TRANSLATION bitmasks */ + single_value(SQL_DTR_DROP_TRANSLATION); + next_block(); + + /* SQL_DROP_VIEW bitmasks */ + open_enumerated_type("drop-view"); + enumerated_type_value("drop-view", SQL_DV_DROP_VIEW); + enumerated_type_value("restrict", SQL_DV_RESTRICT); + enumerated_type_value("cascade", SQL_DV_CASCADE); + close_enumerated_type(); + + /* SQL_INSERT_STATEMENT bitmasks */ + open_enumerated_type("insert-statement"); + enumerated_type_value("insert-literals", SQL_IS_INSERT_LITERALS); + enumerated_type_value("insert-searched", SQL_IS_INSERT_SEARCHED); + enumerated_type_value("selected-into", SQL_IS_SELECT_INTO); + close_enumerated_type(); + + /* SQL_ODBC_INTERFACE_CONFORMANCE values */ + open_enumerated_type("odbc-interface-conformance"); + enumerated_type_value("core", SQL_OIC_CORE); + enumerated_type_value("level-1", SQL_OIC_LEVEL1); + enumerated_type_value("level-2", SQL_OIC_LEVEL2); + close_enumerated_type(); + + /* SQL_SQL92_FOREIGN_KEY_DELETE_RULE bitmasks */ + open_enumerated_type("sql92-foreign-key-delete-rule"); + enumerated_type_value("cascade", SQL_SFKD_CASCADE); + enumerated_type_value("no-action", SQL_SFKD_NO_ACTION); + enumerated_type_value("set-default", SQL_SFKD_SET_DEFAULT); + enumerated_type_value("set-null", SQL_SFKD_SET_NULL); + close_enumerated_type(); + + /* SQL_SQL92_FOREIGN_KEY_UPDATE_RULE bitmasks */ + open_enumerated_type("sql92-foreign-key-update-rule"); + enumerated_type_value("cascade", SQL_SFKU_CASCADE); + enumerated_type_value("no-action", SQL_SFKU_NO_ACTION); + enumerated_type_value("set-default", SQL_SFKU_SET_DEFAULT); + enumerated_type_value("set-null", SQL_SFKU_SET_NULL); + close_enumerated_type(); + + /* SQL_SQL92_GRANT bitmasks */ + open_enumerated_type("sql92-grant"); + enumerated_type_value("usage-on-domain", SQL_SG_USAGE_ON_DOMAIN); + enumerated_type_value("usage-on-character-set", SQL_SG_USAGE_ON_CHARACTER_SET); + enumerated_type_value("usage-on-collation", SQL_SG_USAGE_ON_COLLATION); + enumerated_type_value("usage-on-translation", SQL_SG_USAGE_ON_TRANSLATION); + enumerated_type_value("with-grant-option", SQL_SG_WITH_GRANT_OPTION); + enumerated_type_value("delete-table", SQL_SG_DELETE_TABLE); + enumerated_type_value("insert-table", SQL_SG_INSERT_TABLE); + enumerated_type_value("insert-column", SQL_SG_INSERT_COLUMN); + enumerated_type_value("references-table", SQL_SG_REFERENCES_TABLE); + enumerated_type_value("references-column", SQL_SG_REFERENCES_COLUMN); + enumerated_type_value("select-table", SQL_SG_SELECT_TABLE); + enumerated_type_value("update-table", SQL_SG_UPDATE_TABLE); + enumerated_type_value("update-column", SQL_SG_UPDATE_COLUMN); + close_enumerated_type(); + + /* SQL_SQL92_PREDICATES bitmasks */ + open_enumerated_type("sql92-predicates"); + enumerated_type_value("exists", SQL_SP_EXISTS); + enumerated_type_value("is-not-null", SQL_SP_ISNOTNULL); + enumerated_type_value("is-null", SQL_SP_ISNULL); + enumerated_type_value("match-full", SQL_SP_MATCH_FULL); + enumerated_type_value("match-partial", SQL_SP_MATCH_PARTIAL); + enumerated_type_value("match-unique-full", SQL_SP_MATCH_UNIQUE_FULL); + enumerated_type_value("match-unique-partial", SQL_SP_MATCH_UNIQUE_PARTIAL); + enumerated_type_value("overlaps", SQL_SP_OVERLAPS); + enumerated_type_value("unique", SQL_SP_UNIQUE); + enumerated_type_value("like", SQL_SP_LIKE); + enumerated_type_value("in", SQL_SP_IN); + enumerated_type_value("between", SQL_SP_BETWEEN); + enumerated_type_value("comparison", SQL_SP_COMPARISON); + enumerated_type_value("quantified-comparison", SQL_SP_QUANTIFIED_COMPARISON); + close_enumerated_type(); + + /* SQL_SQL92_RELATIONAL_JOIN_OPERATORS bitmasks */ + open_enumerated_type("sql92-relational-join-operators"); + enumerated_type_value("corresponding-clause", SQL_SRJO_CORRESPONDING_CLAUSE); + enumerated_type_value("cross-join", SQL_SRJO_CROSS_JOIN); + enumerated_type_value("except-join", SQL_SRJO_EXCEPT_JOIN); + enumerated_type_value("full-outer-join", SQL_SRJO_FULL_OUTER_JOIN); + enumerated_type_value("inner-join", SQL_SRJO_INNER_JOIN); + enumerated_type_value("intersect-join", SQL_SRJO_INTERSECT_JOIN); + enumerated_type_value("left-outer-join", SQL_SRJO_LEFT_OUTER_JOIN); + enumerated_type_value("natural-join", SQL_SRJO_NATURAL_JOIN); + enumerated_type_value("right-outer-join", SQL_SRJO_RIGHT_OUTER_JOIN); + enumerated_type_value("union-join", SQL_SRJO_UNION_JOIN); + close_enumerated_type(); + + /* SQL_SQL92_REVOKE bitmasks */ + open_enumerated_type("sql92-revoke"); + enumerated_type_value("usage-on-domain", SQL_SR_USAGE_ON_DOMAIN); + enumerated_type_value("usage-on-character-set", SQL_SR_USAGE_ON_CHARACTER_SET); + enumerated_type_value("usage-on-collation", SQL_SR_USAGE_ON_COLLATION); + enumerated_type_value("usage-on-translation", SQL_SR_USAGE_ON_TRANSLATION); + enumerated_type_value("grant-option-for", SQL_SR_GRANT_OPTION_FOR); + enumerated_type_value("delete-table", SQL_SR_DELETE_TABLE); + enumerated_type_value("insert-table", SQL_SR_INSERT_TABLE); + enumerated_type_value("insert-column", SQL_SR_INSERT_COLUMN); + enumerated_type_value("references-table", SQL_SR_REFERENCES_TABLE); + enumerated_type_value("references-column", SQL_SR_REFERENCES_COLUMN); + enumerated_type_value("select-table", SQL_SR_SELECT_TABLE); + enumerated_type_value("update-table", SQL_SR_UPDATE_TABLE); + enumerated_type_value("update-column", SQL_SR_UPDATE_COLUMN); + close_enumerated_type(); + + /* SQL_SQL92_ROW_VALUE_CONSTRUCTOR bitmasks */ + open_enumerated_type("sql92-row-value-constructor"); + enumerated_type_value("value-expression", SQL_SRVC_VALUE_EXPRESSION); + enumerated_type_value("null", SQL_SRVC_NULL); + enumerated_type_value("default", SQL_SRVC_DEFAULT); + enumerated_type_value("row-subquery", SQL_SRVC_ROW_SUBQUERY); + close_enumerated_type(); + + /* SQL_SQL92_VALUE_EXPRESSIONS bitmasks */ + open_enumerated_type("sql92-value-expressions"); + enumerated_type_value("case", SQL_SVE_CASE); + enumerated_type_value("cast", SQL_SVE_CAST); + enumerated_type_value("coalesce", SQL_SVE_COALESCE); + enumerated_type_value("null-if", SQL_SVE_NULLIF); + close_enumerated_type(); + + /* SQL_STANDARD_CLI_CONFORMANCE bitmasks */ + single_value(SQL_SCC_XOPEN_CLI_VERSION1); + single_value(SQL_SCC_ISO92_CLI); + next_block(); + + /* SQL_UNION_STATEMENT bitmasks */ + single_value(SQL_US_UNION); + single_value(SQL_US_UNION_ALL); + next_block(); + +#endif /* ODBCVER >= 0x0300 */ + + /* SQL_DTC_TRANSITION_COST bitmasks */ + single_value(SQL_DTC_ENLIST_EXPENSIVE); + single_value(SQL_DTC_UNENLIST_EXPENSIVE); + next_block(); + + /* additional SQLDataSources fetch directions */ +#if (ODBCVER >= 0x0300) + single_value(SQL_FETCH_FIRST_USER); + single_value(SQL_FETCH_FIRST_SYSTEM); + next_block(); +#endif /* ODBCVER >= 0x0300 */ + + + /* Defines for SQLSetPos */ + open_enumerated_type("SQLSetPos"); + enumerated_type_value("entire-rowset", SQL_ENTIRE_ROWSET); + + /* Operations in SQLSetPos */ + enumerated_type_value("position", SQL_POSITION); + enumerated_type_value("refresh", SQL_REFRESH); + enumerated_type_value("update", SQL_UPDATE); + enumerated_type_value("delete", SQL_DELETE); + + /* Lock options in SQLSetPos */ + enumerated_type_value("lock-no-change", SQL_LOCK_NO_CHANGE); + enumerated_type_value("lock-exklusive", SQL_LOCK_EXCLUSIVE); + enumerated_type_value("lock-unlock", SQL_LOCK_UNLOCK); + enumerated_type_value("setpos-max-lock-value", SQL_SETPOS_MAX_LOCK_VALUE); + + /* FIX ME: Macros for SQLSetPos + * #define SQL_POSITION_TO(hstmt,irow) SQLSetPos(hstmt,irow,SQL_POSITION,SQL_LOCK_NO_CHANGE) + * #define SQL_LOCK_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_POSITION,fLock) + * #define SQL_REFRESH_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_REFRESH,fLock) + * #define SQL_UPDATE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_UPDATE,SQL_LOCK_NO_CHANGE) + * #define SQL_DELETE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_DELETE,SQL_LOCK_NO_CHANGE) + * #define SQL_ADD_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_ADD,SQL_LOCK_NO_CHANGE) + */ + + close_enumerated_type(); + + /* Operations in SQLBulkOperations */ + open_enumerated_type("SQLBulkOperations"); + enumerated_type_value("add", SQL_ADD); + enumerated_type_value("setpos-max-option-value", SQL_SETPOS_MAX_OPTION_VALUE); +#if (ODBCVER >= 0x0300) + enumerated_type_value("update-by-bookmark", SQL_UPDATE_BY_BOOKMARK); + enumerated_type_value("delete-by-bookmark", SQL_DELETE_BY_BOOKMARK); + enumerated_type_value("fetch-by-bookmark", SQL_FETCH_BY_BOOKMARK); +#endif /* ODBCVER >= 0x0300 */ + close_enumerated_type(); + + /* Column types and scopes in SQLSpecialColumns. */ + single_value(SQL_BEST_ROWID); + single_value(SQL_ROWVER); + next_block(); + + /* Defines for SQLSpecialColumns (returned in the result set) + SQL_PC_UNKNOWN and SQL_PC_PSEUDO are defined in sql.h */ + single_value(SQL_PC_NOT_PSEUDO); + next_block(); + + /* Defines for SQLStatistics */ + single_value(SQL_QUICK); + single_value(SQL_ENSURE); + next_block(); + + /* Defines for SQLStatistics (returned in the result set) + SQL_INDEX_CLUSTERED, SQL_INDEX_HASHED, and SQL_INDEX_OTHER are defined in sql.h */ + single_value(SQL_TABLE_STAT); + next_block(); + + /* Defines for SQLTables */ +#if (ODBCVER >= 0x0300) + single_value(SQL_ALL_CATALOGS); + single_value(SQL_ALL_SCHEMAS); + single_value(SQL_ALL_TABLE_TYPES); +#endif /* ODBCVER >= 0x0300 */ + + /* Options for SQLDriverConnect */ + open_enumerated_type("SQLDriverConnect"); + enumerated_type_value("no-prompt", SQL_DRIVER_NOPROMPT); + enumerated_type_value("complete", SQL_DRIVER_COMPLETE); + enumerated_type_value("prompt", SQL_DRIVER_PROMPT); + enumerated_type_value("complete-required", SQL_DRIVER_COMPLETE_REQUIRED); + close_enumerated_type(); + + + /* --------------------------------------------- */ + /* Level 2 Functions */ + + /* SQLExtendedFetch "fFetchType" values */ + single_value(SQL_FETCH_BOOKMARK); + next_block(); + + /* SQLExtendedFetch "rgfRowStatus" element values */ + open_enumerated_type("SQLExtendedFetch-row-status"); + enumerated_type_value("success", SQL_ROW_SUCCESS); + enumerated_type_value("deleted", SQL_ROW_DELETED); + enumerated_type_value("updated", SQL_ROW_UPDATED); + enumerated_type_value("no-row", SQL_ROW_NOROW); + enumerated_type_value("added", SQL_ROW_ADDED); + enumerated_type_value("error", SQL_ROW_ERROR); +#if (ODBCVER >= 0x0300) + enumerated_type_value("success-with-info", SQL_ROW_SUCCESS_WITH_INFO); + enumerated_type_value("proceed", SQL_ROW_PROCEED); + enumerated_type_value("ignore", SQL_ROW_IGNORE); +#endif + close_enumerated_type(); + + /* value for SQL_DESC_ARRAY_STATUS_PTR */ +#if (ODBCVER >= 0x0300) + open_enumerated_type("desc-array-status-pointer"); + enumerated_type_value("success", SQL_PARAM_SUCCESS); + enumerated_type_value("success-with-info", SQL_PARAM_SUCCESS_WITH_INFO); + enumerated_type_value("error", SQL_PARAM_ERROR); + enumerated_type_value("unused", SQL_PARAM_UNUSED); + enumerated_type_value("diagnostic-unavailable", SQL_PARAM_DIAG_UNAVAILABLE); + enumerated_type_value("proceed", SQL_PARAM_PROCEED); + enumerated_type_value("ignore", SQL_PARAM_IGNORE); + close_enumerated_type(); +#endif /* ODBCVER >= 0x0300 */ + + /* Defines for SQLForeignKeys (UPDATE_RULE and DELETE_RULE) */ + open_enumerated_type("SQLForeignKeys"); + enumerated_type_value("cascade", SQL_CASCADE); + enumerated_type_value("restrict", SQL_RESTRICT); + enumerated_type_value("set-null", SQL_SET_NULL); +#if (ODBCVER >= 0x0250) + enumerated_type_value("no-action", SQL_NO_ACTION); + enumerated_type_value("set-default", SQL_SET_DEFAULT); +#endif /* ODBCVER >= 0x0250 */ + close_enumerated_type(); + +#if (ODBCVER >= 0x0300) + /* Note that the following are in a different column of SQLForeignKeys than */ + /* the previous #defines. These are for DEFERRABILITY. */ + single_value(SQL_INITIALLY_DEFERRED); + single_value(SQL_INITIALLY_IMMEDIATE); + single_value(SQL_NOT_DEFERRABLE); + next_block(); +#endif /* ODBCVER >= 0x0300 */ + + /* Defines for SQLBindParameter and SQLProcedureColumns (returned in the result set) */ + single_value(SQL_PARAM_TYPE_UNKNOWN); + single_value(SQL_PARAM_INPUT); + single_value(SQL_PARAM_INPUT_OUTPUT); + single_value(SQL_RESULT_COL); + single_value(SQL_PARAM_OUTPUT); + single_value(SQL_RETURN_VALUE); + next_block(); + + /* Defines for SQLProcedures (returned in the result set) */ + open_enumerated_type("SQLProcedures"); + enumerated_type_value("unknown", SQL_PT_UNKNOWN); + enumerated_type_value("procedure", SQL_PT_PROCEDURE); + enumerated_type_value("function", SQL_PT_FUNCTION); + close_enumerated_type(); + + /* This define is too large for RC */ + single_value(SQL_ODBC_KEYWORDS); + + + /*---------------n--------------------------------------------*/ + /* SQLAllocHandleStd is implemented to make SQLAllocHandle */ + /* compatible with X/Open standard. an application should */ + /* not call SQLAllocHandleStd directly */ + /*-----------------------------------------------------------*/ +#ifdef ODBC_STD + /* single_value(SQLAllocHandle); */ + + /* Internal type subcodes */ + single_value(SQL_YEAR); + single_value(SQL_MONTH); + single_value(SQL_DAY); + single_value(SQL_HOUR); + single_value(SQL_MINUTE); + single_value(SQL_SECOND); + single_value(SQL_YEAR_TO_MONTH); + single_value(SQL_DAY_TO_HOUR); + single_value(SQL_DAY_TO_MINUTE); + single_value(SQL_DAY_TO_SECOND); + single_value(SQL_HOUR_TO_MINUTE); + single_value(SQL_HOUR_TO_SECOND); + single_value(SQL_MINUTE_TO_SECOND); + next_block(); +#endif /* ODBC_STD */ + + /* Deprecated defines from prior versions of ODBC */ + single_value(SQL_DATABASE_NAME); + single_value(SQL_FD_FETCH_PREV); + single_value(SQL_FETCH_PREV); + single_value(SQL_CONCUR_TIMESTAMP); + single_value(SQL_SCCO_OPT_TIMESTAMP); + single_value(SQL_CC_DELETE); + single_value(SQL_CR_DELETE); + single_value(SQL_CC_CLOSE); + single_value(SQL_CR_CLOSE); + single_value(SQL_CC_PRESERVE); + single_value(SQL_CR_PRESERVE); + single_value(SQL_SCROLL_FORWARD_ONLY); + single_value(SQL_SCROLL_KEYSET_DRIVEN); + single_value(SQL_SCROLL_DYNAMIC); + single_value(SQL_SCROLL_STATIC); + next_block(); + + + /* Tracing section */ + single_value(TRACE_VERSION); + next_block(); + + /* Functions for Visual Studio Analyzer*/ + single_value(TRACE_ON); + single_value(TRACE_VS_EVENT_ON); + next_block(); + + /* the flags in ODBC_VS_ARGS */ + single_value(ODBC_VS_FLAG_UNICODE_ARG); + single_value(ODBC_VS_FLAG_UNICODE_COR); + single_value(ODBC_VS_FLAG_RETCODE); + single_value(ODBC_VS_FLAG_STOP); + next_block(); + + + + /* ------------------------------------------------------------ */ + /* close scheme-module file (module_out) */ + close_module(); + + /* close scm_out and module_out */ + fclose(scm_output); + fclose(module_output); + + return; + + + + + + /* ============================================================ * + * * + * created by T. Schmid * + * * + * 21-01-2005, Tübingen/Germany * + * * + * ============================================================ */ + - exit(0); }