#perl -w
# $Id$

use DBI;

my $dbh = DBI->connect() or die "$DBI::errstr\n";


my %InfoTests = (
    'SQL_MAX_DRIVER_CONNECTTIONS', 0,
    'SQL_MAX_CONCURRENT_ACTIVITIES', 1,
    'SQL_DATA_SOURCE_NAME', 2,
    'SQL_DRIVER_NAME', 6,
    'SQL_DRIVER_VER', 7,
    'SQL_FETCH_DIRECTION', 8,
    'SQL_ODBC_API_CONFORMANCE', 9,
    'SQL_ODBC_VER', 10,
    'SQL_ROW_UPDATES', 11,
    'SQL_ODBC_SAG_CLI_CONFORMANCE', 12,
    'SQL_SERVER_NAME', 13,
    'SQL_SEARCH_PATTERN_ESCAPE', 14,
    'SQL_ODBC_SQL_CONFORMANCE', 15,
    'SQL_DBMS_NAME', 17,
    'SQL_DBMS_VER', 18,
    'SQL_ACCESSIBLE_PROCEDURES', 20,
    'SQK_PROCEDURES', 21,
    'SQL_CONCAT_NULL_BEHAVIOR', 22,
    'SQL_CURSOR_COMMIT_BEHAVIOR', 23,
    'SQL_CURSOR_ROLLBACK_BEHAVIOR', 24,
    'SQL_DATA_SOURCE_READ_ONLT', 25,
    'SQL_DEFAULT_TXN_ISOLATION', 26,
    'SQL_EXPRESSIONS_IN_ORDERBY', 27,
    'SQL_IDENTIFIER_CASE', 28,
    'SQL_IDENTIFIER_QUOTE_CHAR', 29,
    'SQL_MAX_COLUMN_NAME_LEN', 30,
    'SQL_MAX_CURSOR_NAME_LEN', 31,
    'SQL_MAX_SCHEMA_NAME_LEN', 32,
    'SQL_MAX_PROCEDURE_NAME_LEN', 33,
    'SQL_MAX_CATALOG_NAME_LENGTH', 34,
    'SQL_MAX_TABLE_NAME_LEN', 35,
    'SQL_MULT_RESULT_SETS', 36,
    'SQL_MULTIPLE_ACTIVE_TXN', 37,
    'SQL_OUTER_JOINS', 38,
    'SQL_OWNER_TERM', 39,
    'SQL_PROCEDURE_TERM', 40,
    'SQL_QUALIFIER_NAME_SEPARATOR', 41,
    'SQL_QUALIFIER_TERM', 42,
    'SQL_SCROLL_CONCURRENCY', 43,
    'SQL_SCROLL_OPTIONS', 44,
    'SQL_TABLE_TERM', 45,
    'SQL_TXN_CAPABLE', 46,
    'SQL_USER_NAME', 47,
    'SQL_CONVERT_FUNCTIONS', 48,
    'SQL_NUMERIC_FUNCTIONS', 49,
    'SQL_STRING_FUNCTIONS', 50,
    'SQL_SYSTEMS_FUNCTIONS', 51,
    'SQL_TIMEDATE_FUNCTIONS', 52,
    'SQL_CONVERT_BIGINT', 53,
    'SQL_CONVERT_BINARY', 54,
    'SQL_CONVERT_BIT', 55,
    'SQL_CONVERT_CHAR', 56,
    'SQL_CONVERT_DATE', 57,
    'SQL_CONVERT_DECIMAL', 58,
    'SQL_CONVERT_DOUBLE', 59,
    'SQL_CONVERT_FLOAT', 60,
    'SQL_CONVERT_INTEGER', 61,
    'SQL_CONVERT_LONGVARCHAR', 62,
    'SQL_CONVERT_NUMERIC', 63,
    'SQL_CONVERT_REAL', 64,
    'SQL_CONVERT_SMALLINT', 65,
    'SQL_CONVERT_TIME', 66,
    'SQL_CONVERT_TIMESTAMP', 67,
    'SQL_CONVERT_TINYINT', 68,
    'SQL_CONVERT_VARBINARY', 69,
    'SQL_CONVERT_VARCHAR', 70,
    'SQL_CONVERT_LONGVARBINARY', 71,
    'SQL_TXN_ISOLATION_OPTION', 72,
    'SQL_INTEGRITY', 73,
    'SQL_CORRELATION_NAME', 74,
    'SQL_NON_NULLABLE_COLUMNS', 75,
    'SQL_DRIVER_ODBC_VER', 77,
    'SQL_LOCK_TYPES', 78,
    'SQL_POS_OPERATIONS', 79,
    'SQL_POSITIONED_STATEMENTS', 80,
    'SQL_GETDATA_EXTENSIONS', 81,
    'SQL_BOOKMARK_PERSISTENCE', 82,
    'SQL_STATIC_SENSITIVITY', 83,
    'SQL_FILE_USAGE', 84,
    'SQL_NULL_COLLATION', 85,
    'SQL_ALTER_TABLE', 86,
    'SQL_COLUMN_ALIAS', 87,
    'SQL_GROUP_BY', 88,
    'SQL_KEYWORDS', 89,
    'SQL_ORDER_BY_COLUMNS_IN_SELECT', 90,
    'SQL_OWNER_USAGE', 91,
    'SQL_QUALIFIER_USAGE', 92,
    'SQL_QUOTED_IDENTIFIER_CASE', 93,
    'SQL_SPECIAL_CHARACTERS', 94,
    'SQL_SUBQUERIES', 95,
    'SQL_UNION', 96,
    'SQL_MAX_COLUMNS_IN_GROUP_BY', 97,
    'SQL_MAX_COLUMNS_IN_INDEX', 98,
    'SQL_MAX_COLUMNS_IN_ORDER_BY', 99,
    'SQL_MAX_COLUMNS_IN_SELECT', 100,
    'SQL_MAX_COLUMNS_IN_TABLE', 101,
    'SQL_MAX_INDEX_SIZE', 102,
    'SQL_MAX_ROW_SIZE_INCLUDES_LONG', 103,
    'SQL_MAX_ROW_SIZE', 104,
    'SQL_MAX_STATEMENT_LEN', 105,
    'SQL_MAX_TABLES_IN_SELECT', 106,
    'SQL_MAX_USER_NAME_LENGTH', 107,
    'SQL_MAX_CHAR_LITERAL_LEN', 108,
    'SQL_TIMEDATE_ADD_INTERVALS', 109,
    'SQL_TIMEDATE_DIFF_INTERVALS', 110,
    'SQL_NEED_LONG_DATA_LEN', 111,
    'SQL_MAX_BINARY_LITERAL_LEN', 112,
    'SQL_LIKE_ESCAPE_CLAUSE', 113,
    'SQL_QUALIFIER_LOCATION', 114,
    'SQL_OJ_CAPABILITIES', 115,
    'SQL_ACTIVE_ENVIRONMENTS', 116,
    'SQL_ALTER_DOMAIN', 117,
    'SQL_SQL_CONFORMANCE', 118,
    'SQL_DATETIME_LITERALS', 119,
    'SQL_BATCH_ROW_COUNT', 120,
    'SQL_BATCH_SUPPORT', 121,
    'SQL_CONVERT_WCHAR', 122,
    'SQL_CONVERT_INTERVAL_DAY_TIME', 123,
    'SQL_CONVERT_INTERVAL_YEAR_MONTH', 124,
    'SQL_CONVERT_WLONGVARCHAR', 125,
    'SQL_CONVERT_WVARCHAR', 126,
    'SQL_CREATE_ASSERTION', 127,
    'SQL_CREATE_CHARARCTER_SET', 128,
    'SQL_CREATE_COLLATION', 129,
    'SQL_CREATE_DOMAIN', 130,
    'SQL_CREATE_SCHEMA', 131,
    'SQL_CREATE_TABLE', 132,
    'SQL_CREATE_TRANSLATION', 133,
    'SQL_CREATE_VIEW', 134,
    'SQL_DROP_ASSERTION', 136,
    'SQL_DROP_CHARACTER_SET', 137,
    'SQL_DROP_COLLATION', 138,
    'SQL_DROP_DOMAIN', 139,
    'SQL_DROP_SCHEMA', 140,
    'SQL_DROP_TABLE', 141,
    'SQL_DROP_TRANSLATION', 142,
    'SQL_DROP_VIEW', 143,
    'SQL_DYNAMIC_CURSOR_ATTRIBUTES1', 144,
    'SQL_DYNAMIC_CURSOR_ATTRIBUTES2', 145,
    'SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1', 146,
    'SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2', 147,
    'SQL_INDEX_KEYWORDS', 148,
    'SQL_INFO_SCHEMA_VIEWS', 149,
    'SQL_KEYSET_CURSOR_ATTRIBUTES1', 150,
    'SQL_KEYSET_CURSOR_ATTRIBUTES2', 151,
    'SQL_ODBC_INTERFACE_CONFORMANCE', 152,
    'SQL_PARAM_ARRAY_ROW_COUNTS', 153,
    'SQL_PARAM_ARRAY_SELECTS', 154,
    'SQL_SQL92_DATETIME_FUNCTIONS', 155,
    'SQL_SQL92_FOREIGN_KEY_DELETE_RULE', 156,
    'SQL_SQL92_FOREIGN_KEY_UPDATE_RULE', 157,
    'SQL_SQL92_GRANT', 158,
    'SQL_SQL92_NUMERIC_VALUE_FUNCTIONS', 159,
    'SQL_SQL92_PREDICATES', 160,
    'SQL_SQL92_RELATIONAL_JOIN_OPERATORS', 161,
    'SQL_SQL92_REMOKE', 162,
    'SQL_SQL92_ROW_VALUE_CONSTRUCTOR', 163,
    'SQL_SQL92_STRING_FUNCTIONS', 164,
    'SQL_SQL92_VALUE_EXPRESSIONS', 165,
    'SQL_STANDARD_CLI_CONFORMANCE', 166,
    'SQL_STATUC_CURSOR_ATTRIBUTES1', 167,
    'SQL_STATUC_CURSOR_ATTRIBUTES2', 168,
    'SQL_AGGREGATE_FUNCTIONS', 169,
    'SQL_DDL_INDEX', 170,
    'SQL_DM_VER', 171,
    'SQL_DTC_TRANSITION_COST', 1750,
    'SQL_XOPEN_CLI_YEAR', 10000,
    'SQL_CURSOR_SENSITIVITY', 10001,
    'SQL_DESCRIBE_PARAMETER', 10002,
    'SQL_CATALOG_NAME', 10003,
    'SQL_COLLATION_SEQ', 10004,
    'SQL_MAX_IDENTIFIER_LEN', 10005,
    'SQL_ASYNC_MODE', 10021,
    'SQL_MAX_ASYNC_CONCURRENT_STATEMENTS', 10022,
);

foreach $SQLInfo (sort keys %InfoTests) {
   $ret = 0;
   $ret = $dbh->func($InfoTests{$SQLInfo}, GetInfo);
   print "$SQLInfo ($InfoTests{$SQLInfo}):\t$ret\n";
}

$dbh->disconnect;

