' ########################################################################################
' Microsoft Windows
' File: sql.inc
' Contents: This is the the main include for ODBC Core functions
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_sql_PBI)
#DEFINE PBX_sql_PBI
%EQUATE `SQL_INC = 1
#INCLUDE ONCE "Core/Windows.inc"
'/*
'* ODBCVER Default to ODBC version number (0x0380). To exclude
'* definitions introduced in version 3.8 (or above)
'* #define ODBCVER 0x0351 before #including <sql.h>
'*/
#IF NOT %DEF(%ODBCVER)
%EQUATE `ODBCVER = &H0380
#ENDIF
#INCLUDE ONCE "Legacy/Data/sqltypes.inc"
'/* special length/indicator values */
%EQUATE `SQL_NULL_DATA = -1
%EQUATE `SQL_DATA_AT_EXEC = -2
'/* return values from functions */
%EQUATE `SQL_SUCCESS = 0
%EQUATE `SQL_SUCCESS_WITH_INFO = 1
#IF %ODBCVER >= &H0300
%EQUATE `SQL_NO_DATA = 100
#ENDIF
#IF %ODBCVER >= &H0380
%EQUATE `SQL_PARAM_DATA_AVAILABLE = 101
#ENDIF
%EQUATE `SQL_ERROR = -1
%EQUATE `SQL_INVALID_HANDLE = -2
%EQUATE `SQL_STILL_EXECUTING = 2
%EQUATE `SQL_NEED_DATA = 99
'/* test for SQL_SUCCESS or SQL_SUCCESS_WITH_INFO */
'#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)
MACRO SQL_SUCCEEDED (rc) = -BITS(INTEGER, (rc = 0) OR (rc = 1))
'/* flags for null-terminated string */
%EQUATE `SQL_NTS = -3
%EQUATE `SQL_NTSL = -3&
'/* maximum message length */
%EQUATE `SQL_MAX_MESSAGE_LENGTH = 512
'/* date/time length constants */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_DATE_LEN = 10
%EQUATE `SQL_TIME_LEN = 8 '/* add P+1 if precision is nonzero */
%EQUATE `SQL_TIMESTAMP_LEN = 19 '/* add P+1 if precision is nonzero */
#ENDIF
'/* handle type identifiers */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_HANDLE_ENV = 1
%EQUATE `SQL_HANDLE_DBC = 2
%EQUATE `SQL_HANDLE_STMT = 3
%EQUATE `SQL_HANDLE_DESC = 4
#ENDIF
'/* environment attribute */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_ATTR_OUTPUT_NTS = 10001
#ENDIF
'/* connection attributes */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_ATTR_AUTO_IPD = 10001
%EQUATE `SQL_ATTR_METADATA_ID = 10014
#ENDIF ' /* ODBCVER >= 0x0300 */
'/* statement attributes */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_ATTR_APP_ROW_DESC = 10010
%EQUATE `SQL_ATTR_APP_PARAM_DESC = 10011
%EQUATE `SQL_ATTR_IMP_ROW_DESC = 10012
%EQUATE `SQL_ATTR_IMP_PARAM_DESC = 10013
%EQUATE `SQL_ATTR_CURSOR_SCROLLABLE = -1
%EQUATE `SQL_ATTR_CURSOR_SENSITIVITY = -2
#ENDIF
'/* SQL_ATTR_CURSOR_SCROLLABLE values */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_NONSCROLLABLE = 0
%EQUATE `SQL_SCROLLABLE = 1
#ENDIF ' /* ODBCVER >= 0x0300 */
'/* identifiers of fields in the SQL descriptor */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_DESC_COUNT = 1001
%EQUATE `SQL_DESC_TYPE = 1002
%EQUATE `SQL_DESC_LENGTH = 1003
%EQUATE `SQL_DESC_OCTET_LENGTH_PTR = 1004
%EQUATE `SQL_DESC_PRECISION = 1005
%EQUATE `SQL_DESC_SCALE = 1006
%EQUATE `SQL_DESC_DATETIME_INTERVAL_CODE = 1007
%EQUATE `SQL_DESC_NULLABLE = 1008
%EQUATE `SQL_DESC_INDICATOR_PTR = 1009
%EQUATE `SQL_DESC_DATA_PTR = 1010
%EQUATE `SQL_DESC_NAME = 1011
%EQUATE `SQL_DESC_UNNAMED = 1012
%EQUATE `SQL_DESC_OCTET_LENGTH = 1013
%EQUATE `SQL_DESC_ALLOC_TYPE = 1099
#ENDIF
'/* identifiers of fields in the diagnostics area */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_DIAG_RETURNCODE = 1
%EQUATE `SQL_DIAG_NUMBER = 2
%EQUATE `SQL_DIAG_ROW_COUNT = 3
%EQUATE `SQL_DIAG_SQLSTATE = 4
%EQUATE `SQL_DIAG_NATIVE = 5
%EQUATE `SQL_DIAG_MESSAGE_TEXT = 6
%EQUATE `SQL_DIAG_DYNAMIC_FUNCTION = 7
%EQUATE `SQL_DIAG_CLASS_ORIGIN = 8
%EQUATE `SQL_DIAG_SUBCLASS_ORIGIN = 9
%EQUATE `SQL_DIAG_CONNECTION_NAME = 10
%EQUATE `SQL_DIAG_SERVER_NAME = 11
%EQUATE `SQL_DIAG_DYNAMIC_FUNCTION_CODE = 12
#ENDIF
'/* dynamic function codes */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_DIAG_ALTER_DOMAIN = 3
%EQUATE `SQL_DIAG_ALTER_TABLE = 4
%EQUATE `SQL_DIAG_CALL = 7
%EQUATE `SQL_DIAG_CREATE_ASSERTION = 6
%EQUATE `SQL_DIAG_CREATE_CHARACTER_SET = 8
%EQUATE `SQL_DIAG_CREATE_COLLATION = 10
%EQUATE `SQL_DIAG_CREATE_DOMAIN = 23
%EQUATE `SQL_DIAG_CREATE_INDEX = -1
%EQUATE `SQL_DIAG_CREATE_SCHEMA = 64
%EQUATE `SQL_DIAG_CREATE_TABLE = 77
%EQUATE `SQL_DIAG_CREATE_TRANSLATION = 79
%EQUATE `SQL_DIAG_CREATE_VIEW = 84
%EQUATE `SQL_DIAG_DELETE_WHERE = 19
%EQUATE `SQL_DIAG_DROP_ASSERTION = 24
%EQUATE `SQL_DIAG_DROP_CHARACTER_SET = 25
%EQUATE `SQL_DIAG_DROP_COLLATION = 26
%EQUATE `SQL_DIAG_DROP_DOMAIN = 27
%EQUATE `SQL_DIAG_DROP_INDEX = -2
%EQUATE `SQL_DIAG_DROP_SCHEMA = 31
%EQUATE `SQL_DIAG_DROP_TABLE = 32
%EQUATE `SQL_DIAG_DROP_TRANSLATION = 33
%EQUATE `SQL_DIAG_DROP_VIEW = 36
%EQUATE `SQL_DIAG_DYNAMIC_DELETE_CURSOR = 38
%EQUATE `SQL_DIAG_DYNAMIC_UPDATE_CURSOR = 81
%EQUATE `SQL_DIAG_GRANT = 48
%EQUATE `SQL_DIAG_INSERT = 50
%EQUATE `SQL_DIAG_REVOKE = 59
%EQUATE `SQL_DIAG_SELECT_CURSOR = 85
%EQUATE `SQL_DIAG_UNKNOWN_STATEMENT = 0
%EQUATE `SQL_DIAG_UPDATE_WHERE = 82
#ENDIF ' /* ODBCVER >= 0x0300 */
'/* SQL data type codes */
%EQUATE `SQL_UNKNOWN_TYPE = 0
%EQUATE `SQL_CHAR = 1
%EQUATE `SQL_NUMERIC = 2
%EQUATE `SQL_DECIMAL = 3
%EQUATE `SQL_INTEGER = 4
%EQUATE `SQL_SMALLINT = 5
%EQUATE `SQL_FLOAT = 6
%EQUATE `SQL_REAL = 7
%EQUATE `SQL_DOUBLE = 8
#IF %ODBCVER >= &H0300
%EQUATE `SQL_DATETIME = 9
#ENDIF
%EQUATE `SQL_VARCHAR = 12
'/* One-parameter shortcuts for date/time data types */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_TYPE_DATE = 91
%EQUATE `SQL_TYPE_TIME = 92
%EQUATE `SQL_TYPE_TIMESTAMP = 93
#ENDIF
'/* Statement attribute values for cursor sensitivity */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_UNSPECIFIED = 0
%EQUATE `SQL_INSENSITIVE = 1
%EQUATE `SQL_SENSITIVE = 2
#ENDIF
'/* GetTypeInfo() request for all data types */
%EQUATE `SQL_ALL_TYPES = 0
'/* Default conversion code for SQLBindCol(), SQLBindParam() and SQLGetData() */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_DEFAULT = 99
#ENDIF
'/* SQLSQLLEN GetData() code indicating that the application row descriptor
' * specifies the data type
' */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_ARD_TYPE = -99
#ENDIF
#IF %ODBCVER >= &H0380
%EQUATE `SQL_APD_TYPE = -100
#ENDIF
'/* SQL date/time type subcodes */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_CODE_DATE = 1
%EQUATE `SQL_CODE_TIME = 2
%EQUATE `SQL_CODE_TIMESTAMP = 3
#ENDIF
'/* CLI option values */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_FALSE = 0
%EQUATE `SQL_TRUE = 1
#ENDIF
'/* values of NULLABLE field in descriptor */
%EQUATE `SQL_NO_NULLS = 0
%EQUATE `SQL_NULLABLE = 1
'/* Value returned by SQLGetTypeInfo() to denote that it is
' * not known whether or not a data type supports null values.
' */
%EQUATE `SQL_NULLABLE_UNKNOWN = 2
'/* Values returned by SQLGetTypeInfo() to show WHERE clause
' * supported
' */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_PRED_NONE = 0
%EQUATE `SQL_PRED_CHAR = 1
%EQUATE `SQL_PRED_BASIC = 2
#ENDIF
'/* values of UNNAMED field in descriptor */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_NAMED = 0
%EQUATE `SQL_UNNAMED = 1
#ENDIF
'/* values of ALLOC_TYPE field in descriptor */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_DESC_ALLOC_AUTO = 1
%EQUATE `SQL_DESC_ALLOC_USER = 2
#ENDIF
'/* FreeStmt() options */
%EQUATE `SQL_CLOSE = 0
%EQUATE `SQL_DROP = 1
%EQUATE `SQL_UNBIND = 2
%EQUATE `SQL_RESET_PARAMS = 3
'/* Codes used for FetchOrientation in SQLFetchScroll(),
' and in SQLDataSources()
'*/
%EQUATE `SQL_FETCH_NEXT = 1
%EQUATE `SQL_FETCH_FIRST = 2
'/* Other codes used for FetchOrientation in SQLFetchScroll() */
%EQUATE `SQL_FETCH_LAST = 3
%EQUATE `SQL_FETCH_PRIOR = 4
%EQUATE `SQL_FETCH_ABSOLUTE = 5
%EQUATE `SQL_FETCH_RELATIVE = 6
'/* SQLEndTran() options */
%EQUATE `SQL_COMMIT = 0
%EQUATE `SQL_ROLLBACK = 1
'/* null handles returned by SQLAllocHandle() */
%EQUATE `SQL_NULL_HENV = 0
%EQUATE `SQL_NULL_HDBC = 0
%EQUATE `SQL_NULL_HSTMT = 0
#IF %ODBCVER >= &H0300
%EQUATE `SQL_NULL_HDESC = 0
#ENDIF
'/* null handle used in place of parent handle when allocating HENV */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_NULL_HANDLE = 0&
#ENDIF
'/* Values that may appear in the result set of SQLSpecialColumns() */
%EQUATE `SQL_SCOPE_CURROW = 0
%EQUATE `SQL_SCOPE_TRANSACTION = 1
%EQUATE `SQL_SCOPE_SESSION = 2
%EQUATE `SQL_PC_UNKNOWN = 0
#IF %ODBCVER >= &H0300
%EQUATE `SQL_PC_NON_PSEUDO = 1
#ENDIF
%EQUATE `SQL_PC_PSEUDO = 2
'/* Reserved value for the IdentifierType argument of SQLSpecialColumns() */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_ROW_IDENTIFIER = 1
#ENDIF
'/* Reserved values for UNIQUE argument of SQLStatistics() */
%EQUATE `SQL_INDEX_UNIQUE = 0
%EQUATE `SQL_INDEX_ALL = 1
'/* Values that may appear in the result set of SQLStatistics() */
%EQUATE `SQL_INDEX_CLUSTERED = 1
%EQUATE `SQL_INDEX_HASHED = 2
%EQUATE `SQL_INDEX_OTHER = 3
'/* SQLGetFunctions() values to identify ODBC APIs */
%EQUATE `SQL_API_SQLALLOCCONNECT = 1
%EQUATE `SQL_API_SQLALLOCENV = 2
#IF %ODBCVER >= &H0300
%EQUATE `SQL_API_SQLALLOCHANDLE = 1001
#ENDIF
%EQUATE `SQL_API_SQLALLOCSTMT = 3
%EQUATE `SQL_API_SQLBINDCOL = 4
#IF %ODBCVER >= &H0300
%EQUATE `SQL_API_SQLBINDPARAM = 1002
#ENDIF
%EQUATE `SQL_API_SQLCANCEL = 5
#IF %ODBCVER >= &H0300
%EQUATE `SQL_API_SQLCLOSECURSOR = 1003
%EQUATE `SQL_API_SQLCOLATTRIBUTE = 6
#ENDIF
%EQUATE `SQL_API_SQLCOLUMNS = 40
%EQUATE `SQL_API_SQLCONNECT = 7
#IF %ODBCVER >= &H0300
%EQUATE `SQL_API_SQLCOPYDESC = 1004
#ENDIF
%EQUATE `SQL_API_SQLDATASOURCES = 57
%EQUATE `SQL_API_SQLDESCRIBECOL = 8
%EQUATE `SQL_API_SQLDISCONNECT = 9
#IF %ODBCVER >= &H0300
%EQUATE `SQL_API_SQLENDTRAN = 1005
#ENDIF
%EQUATE `SQL_API_SQLERROR = 10
%EQUATE `SQL_API_SQLEXECDIRECT = 11
%EQUATE `SQL_API_SQLEXECUTE = 12
%EQUATE `SQL_API_SQLFETCH = 13
#IF %ODBCVER >= &H0300
%EQUATE `SQL_API_SQLFETCHSCROLL = 1021
#ENDIF
%EQUATE `SQL_API_SQLFREECONNECT = 14
%EQUATE `SQL_API_SQLFREEENV = 15
#IF %ODBCVER >= &H0300
%EQUATE `SQL_API_SQLFREEHANDLE = 1006
#ENDIF
%EQUATE `SQL_API_SQLFREESTMT = 16
#IF %ODBCVER >= &H0300
%EQUATE `SQL_API_SQLGETCONNECTATTR = 1007
#ENDIF
%EQUATE `SQL_API_SQLGETCONNECTOPTION = 42
%EQUATE `SQL_API_SQLGETCURSORNAME = 17
%EQUATE `SQL_API_SQLGETDATA = 43
#IF %ODBCVER >= &H0300
%EQUATE `SQL_API_SQLGETDESCFIELD = 1008
%EQUATE `SQL_API_SQLGETDESCREC = 1009
%EQUATE `SQL_API_SQLGETDIAGFIELD = 1010
%EQUATE `SQL_API_SQLGETDIAGREC = 1011
%EQUATE `SQL_API_SQLGETENVATTR = 1012
#ENDIF
%EQUATE `SQL_API_SQLGETFUNCTIONS = 44
%EQUATE `SQL_API_SQLGETINFO = 45
#IF %ODBCVER >= &H0300
%EQUATE `SQL_API_SQLGETSTMTATTR = 1014
#ENDIF
%EQUATE `SQL_API_SQLGETSTMTOPTION = 46
%EQUATE `SQL_API_SQLGETTYPEINFO = 47
%EQUATE `SQL_API_SQLNUMRESULTCOLS = 18
%EQUATE `SQL_API_SQLPARAMDATA = 48
%EQUATE `SQL_API_SQLPREPARE = 19
%EQUATE `SQL_API_SQLPUTDATA = 49
%EQUATE `SQL_API_SQLROWCOUNT = 20
#IF %ODBCVER >= &H0300
%EQUATE `SQL_API_SQLSETCONNECTATTR = 1016
#ENDIF
%EQUATE `SQL_API_SQLSETCONNECTOPTION = 50
%EQUATE `SQL_API_SQLSETCURSORNAME = 21
#IF %ODBCVER >= &H0300
%EQUATE `SQL_API_SQLSETDESCFIELD = 1017
%EQUATE `SQL_API_SQLSETDESCREC = 1018
%EQUATE `SQL_API_SQLSETENVATTR = 1019
#ENDIF
%EQUATE `SQL_API_SQLSETPARAM = 22
#IF %ODBCVER >= &H0300
%EQUATE `SQL_API_SQLSETSTMTATTR = 1020
#ENDIF
%EQUATE `SQL_API_SQLSETSTMTOPTION = 51
%EQUATE `SQL_API_SQLSPECIALCOLUMNS = 52
%EQUATE `SQL_API_SQLSTATISTICS = 53
%EQUATE `SQL_API_SQLTABLES = 54
%EQUATE `SQL_API_SQLTRANSACT = 23
#IF %ODBCVER >= &H0380
%EQUATE `SQL_API_SQLCANCELHANDLE = 1022
#ENDIF
'/* Information requested by SQLGetInfo() */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_MAX_DRIVER_CONNECTIONS = 0
%EQUATE `SQL_MAXIMUM_DRIVER_CONNECTIONS = %SQL_MAX_DRIVER_CONNECTIONS
%EQUATE `SQL_MAX_CONCURRENT_ACTIVITIES = 1
%EQUATE `SQL_MAXIMUM_CONCURRENT_ACTIVITIES = %SQL_MAX_CONCURRENT_ACTIVITIES
#ENDIF
%EQUATE `SQL_DATA_SOURCE_NAME = 2
%EQUATE `SQL_FETCH_DIRECTION = 8
%EQUATE `SQL_SERVER_NAME = 13
%EQUATE `SQL_SEARCH_PATTERN_ESCAPE = 14
%EQUATE `SQL_DBMS_NAME = 17
%EQUATE `SQL_DBMS_VER = 18
%EQUATE `SQL_ACCESSIBLE_TABLES = 19
%EQUATE `SQL_ACCESSIBLE_PROCEDURES = 20
%EQUATE `SQL_CURSOR_COMMIT_BEHAVIOR = 23
%EQUATE `SQL_DATA_SOURCE_READ_ONLY = 25
%EQUATE `SQL_DEFAULT_TXN_ISOLATION = 26
%EQUATE `SQL_IDENTIFIER_CASE = 28
%EQUATE `SQL_IDENTIFIER_QUOTE_CHAR = 29
%EQUATE `SQL_MAX_COLUMN_NAME_LEN = 30
%EQUATE `SQL_MAXIMUM_COLUMN_NAME_LENGTH = %SQL_MAX_COLUMN_NAME_LEN
%EQUATE `SQL_MAX_CURSOR_NAME_LEN = 31
%EQUATE `SQL_MAXIMUM_CURSOR_NAME_LENGTH = %SQL_MAX_CURSOR_NAME_LEN
%EQUATE `SQL_MAX_SCHEMA_NAME_LEN = 32
%EQUATE `SQL_MAXIMUM_SCHEMA_NAME_LENGTH = %SQL_MAX_SCHEMA_NAME_LEN
%EQUATE `SQL_MAX_CATALOG_NAME_LEN = 34
%EQUATE `SQL_MAXIMUM_CATALOG_NAME_LENGTH = %SQL_MAX_CATALOG_NAME_LEN
%EQUATE `SQL_MAX_TABLE_NAME_LEN = 35
%EQUATE `SQL_SCROLL_CONCURRENCY = 43
%EQUATE `SQL_TXN_CAPABLE = 46
%EQUATE `SQL_TRANSACTION_CAPABLE = %SQL_TXN_CAPABLE
%EQUATE `SQL_USER_NAME = 47
%EQUATE `SQL_TXN_ISOLATION_OPTION = 72
%EQUATE `SQL_TRANSACTION_ISOLATION_OPTION = %SQL_TXN_ISOLATION_OPTION
%EQUATE `SQL_INTEGRITY = 73
%EQUATE `SQL_GETDATA_EXTENSIONS = 81
%EQUATE `SQL_NULL_COLLATION = 85
%EQUATE `SQL_ALTER_TABLE = 86
%EQUATE `SQL_ORDER_BY_COLUMNS_IN_SELECT = 90
%EQUATE `SQL_SPECIAL_CHARACTERS = 94
%EQUATE `SQL_MAX_COLUMNS_IN_GROUP_BY = 97
%EQUATE `SQL_MAXIMUM_COLUMNS_IN_GROUP_BY = %SQL_MAX_COLUMNS_IN_GROUP_BY
%EQUATE `SQL_MAX_COLUMNS_IN_INDEX = 98
%EQUATE `SQL_MAXIMUM_COLUMNS_IN_INDEX = %SQL_MAX_COLUMNS_IN_INDEX
%EQUATE `SQL_MAX_COLUMNS_IN_ORDER_BY = 99
%EQUATE `SQL_MAXIMUM_COLUMNS_IN_ORDER_BY = %SQL_MAX_COLUMNS_IN_ORDER_BY
%EQUATE `SQL_MAX_COLUMNS_IN_SELECT = 100
%EQUATE `SQL_MAXIMUM_COLUMNS_IN_SELECT = %SQL_MAX_COLUMNS_IN_SELECT
%EQUATE `SQL_MAX_COLUMNS_IN_TABLE = 101
%EQUATE `SQL_MAX_INDEX_SIZE = 102
%EQUATE `SQL_MAXIMUM_INDEX_SIZE = %SQL_MAX_INDEX_SIZE
%EQUATE `SQL_MAX_ROW_SIZE = 104
%EQUATE `SQL_MAXIMUM_ROW_SIZE = %SQL_MAX_ROW_SIZE
%EQUATE `SQL_MAX_STATEMENT_LEN = 105
%EQUATE `SQL_MAXIMUM_STATEMENT_LENGTH = %SQL_MAX_STATEMENT_LEN
%EQUATE `SQL_MAX_TABLES_IN_SELECT = 106
%EQUATE `SQL_MAXIMUM_TABLES_IN_SELECT = %SQL_MAX_TABLES_IN_SELECT
%EQUATE `SQL_MAX_USER_NAME_LEN = 107
%EQUATE `SQL_MAXIMUM_USER_NAME_LENGTH = %SQL_MAX_USER_NAME_LEN
#IF %ODBCVER >= &H0300
%EQUATE `SQL_OJ_CAPABILITIES = 115
%EQUATE `SQL_OUTER_JOIN_CAPABILITIES = %SQL_OJ_CAPABILITIES
#ENDIF ' /* ODBCVER >= 0x0300 */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_XOPEN_CLI_YEAR = 10000
%EQUATE `SQL_CURSOR_SENSITIVITY = 10001
%EQUATE `SQL_DESCRIBE_PARAMETER = 10002
%EQUATE `SQL_CATALOG_NAME = 10003
%EQUATE `SQL_COLLATION_SEQ = 10004
%EQUATE `SQL_MAX_IDENTIFIER_LEN = 10005
%EQUATE `SQL_MAXIMUM_IDENTIFIER_LENGTH = %SQL_MAX_IDENTIFIER_LEN
#ENDIF ' /* ODBCVER >= 0x0300 */
'/* SQL_ALTER_TABLE bitmasks */
#IF %ODBCVER >= &H0200
%EQUATE `SQL_AT_ADD_COLUMN = &H00000001&
%EQUATE `SQL_AT_DROP_COLUMN = &H00000002&
#ENDIF ' /* ODBCVER >= 0x0200 */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_AT_ADD_CONSTRAINT = &H00000008&
'/* The following bitmasks are ODBC extensions and defined in sqlext.h
' #define SQL_AT_COLUMN_SINGLE 0x00000020L
' #define SQL_AT_ADD_COLUMN_DEFAULT 0x00000040L
' #define SQL_AT_ADD_COLUMN_COLLATION 0x00000080L
' #define SQL_AT_SET_COLUMN_DEFAULT 0x00000100L
' #define SQL_AT_DROP_COLUMN_DEFAULT 0x00000200L
' #define SQL_AT_DROP_COLUMN_CASCADE 0x00000400L
' #define SQL_AT_DROP_COLUMN_RESTRICT 0x00000800L
' #define SQL_AT_ADD_TABLE_CONSTRAINT 0x00001000L
' #define SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE 0x00002000L
' #define SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT 0x00004000L
' #define SQL_AT_CONSTRAINT_NAME_DEFINITION 0x00008000L
' #define SQL_AT_CONSTRAINT_INITIALLY_DEFERRED 0x00010000L
' #define SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00020000L
' #define SQL_AT_CONSTRAINT_DEFERRABLE 0x00040000L
' #define SQL_AT_CONSTRAINT_NON_DEFERRABLE 0x00080000L
'/
#ENDIF ' /* ODBCVER >= 0x0300 */
'/* SQL_ASYNC_MODE values */
#IF %ODBCVER >= &H0300
%EQUATE `SQL_AM_NONE = 0
%EQUATE `SQL_AM_CONNECTION = 1
%EQUATE `SQL_AM_STATEMENT = 2
#ENDIF
'/* SQL_CURSOR_COMMIT_BEHAVIOR values */
%EQUATE `SQL_CB_DELETE = 0
%EQUATE `SQL_CB_CLOSE = 1
%EQUATE `SQL_CB_PRESERVE = 2
'/* SQL_FETCH_DIRECTION bitmasks */
%EQUATE `SQL_FD_FETCH_NEXT = &H00000001&
%EQUATE `SQL_FD_FETCH_FIRST = &H00000002&
%EQUATE `SQL_FD_FETCH_LAST = &H00000004&
%EQUATE `SQL_FD_FETCH_PRIOR = &H00000008&
%EQUATE `SQL_FD_FETCH_ABSOLUTE = &H00000010&
%EQUATE `SQL_FD_FETCH_RELATIVE = &H00000020&
'/* SQL_GETDATA_EXTENSIONS bitmasks */
%EQUATE `SQL_GD_ANY_COLUMN = &H00000001&
%EQUATE `SQL_GD_ANY_ORDER = &H00000002&
'/* SQL_IDENTIFIER_CASE values */
%EQUATE `SQL_IC_UPPER = 1
%EQUATE `SQL_IC_LOWER = 2
%EQUATE `SQL_IC_SENSITIVE = 3
%EQUATE `SQL_IC_MIXED = 4
'/* SQL_OJ_CAPABILITIES bitmasks */
'/* NB: this means 'outer join', not what you may be thinking */
#IF %ODBCVER >= &H0201
%EQUATE `SQL_OJ_LEFT = &H00000001&
%EQUATE `SQL_OJ_RIGHT = &H00000002&
%EQUATE `SQL_OJ_FULL = &H00000004&
%EQUATE `SQL_OJ_NESTED = &H00000008&
%EQUATE `SQL_OJ_NOT_ORDERED = &H00000010&
%EQUATE `SQL_OJ_INNER = &H00000020&
%EQUATE `SQL_OJ_ALL_COMPARISON_OPS = &H00000040&
#ENDIF
'/* SQL_SCROLL_CONCURRENCY bitmasks */
%EQUATE `SQL_SCCO_READ_ONLY = &H00000001&
%EQUATE `SQL_SCCO_LOCK = &H00000002&
%EQUATE `SQL_SCCO_OPT_ROWVER = &H00000004&
%EQUATE `SQL_SCCO_OPT_VALUES = &H00000008&
'/* SQL_TXN_CAPABLE values */
%EQUATE `SQL_TC_NONE = 0
%EQUATE `SQL_TC_DML = 1
%EQUATE `SQL_TC_ALL = 2
%EQUATE `SQL_TC_DDL_COMMIT = 3
%EQUATE `SQL_TC_DDL_IGNORE = 4
'/* SQL_TXN_ISOLATION_OPTION bitmasks */
%EQUATE `SQL_TXN_READ_UNCOMMITTED = &H00000001&
%EQUATE `SQL_TRANSACTION_READ_UNCOMMITTED = %SQL_TXN_READ_UNCOMMITTED
%EQUATE `SQL_TXN_READ_COMMITTED = &H00000002&
%EQUATE `SQL_TRANSACTION_READ_COMMITTED = %SQL_TXN_READ_COMMITTED
%EQUATE `SQL_TXN_REPEATABLE_READ = &H00000004&
%EQUATE `SQL_TRANSACTION_REPEATABLE_READ = %SQL_TXN_REPEATABLE_READ
%EQUATE `SQL_TXN_SERIALIZABLE = &H00000008&
%EQUATE `SQL_TRANSACTION_SERIALIZABLE = %SQL_TXN_SERIALIZABLE
'/* SQL_NULL_COLLATION values */
%EQUATE `SQL_NC_HIGH = 0
%EQUATE `SQL_NC_LOW = 1
' In ODBC 3.x, the ODBC 2.x function SQLAllocConnect has been replaced by SQLAllocHandle.
DECLARE FUNCTION SQLAllocConnect LIB "odbc32.dll" ALIAS "SQLAllocConnect" ( BYVAL EnvironmentHandle AS QUAD , BYREF ConnectionHandle AS QUAD ) AS INTEGER ' SQLRETURN
' In ODBC 3.x, the ODBC 2.x function SQLAllocEnv has been replaced by SQLAllocHandle.
DECLARE FUNCTION SQLAllocEnv LIB "odbc32.dll" ALIAS "SQLAllocEnv" ( BYREF EnvironmentHandle AS QUAD ) AS INTEGER ' SQLRETURN
#IF %ODBCVER >= &H0300
DECLARE FUNCTION SQLAllocHandle LIB "odbc32.dll" ALIAS "SQLAllocHandle" ( BYVAL HandleType AS INTEGER , BYVAL InputHandle AS QUAD , BYREF OutputHandle AS QUAD ) AS INTEGER ' SQLRETURN
#ENDIF
DECLARE FUNCTION SQLAllocStmt LIB "odbc32.dll" ALIAS "SQLAllocStmt" ( BYVAL ConnectionHandle AS QUAD , BYREF StatementHandle AS QUAD ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLBindCol LIB "odbc32.dll" ALIAS "SQLBindCol" ( BYVAL StatementHandle AS QUAD , BYVAL ColumnNumber AS INTEGER , BYVAL TargetType AS INTEGER , BYREF TargetValue AS ANY , BYVAL BufferLength AS LONG , BYREF StrLen_or_Ind AS LONG ) AS INTEGER ' SQLRETURN
#IF %ODBCVER >= &H0300
DECLARE FUNCTION SQLBindParam LIB "odbc32.dll" ALIAS "SQLBindParam" ( BYVAL StatementHandle AS QUAD , BYVAL ParameterNumber AS INTEGER , BYVAL ValueType AS INTEGER , BYVAL ParameterType AS INTEGER , BYVAL LengthPrecision AS QUAD , BYVAL ParameterScale AS INTEGER , BYREF ParameterValue AS ANY , BYREF StrLen_or_Ind AS LONG ) AS INTEGER ' SQLRETURN
#ENDIF
DECLARE FUNCTION SQLCancel LIB "odbc32.dll" ALIAS "SQLCancel" ( BYVAL StatementHandle AS QUAD ) AS INTEGER ' SQLRETURN
#IF %ODBCVER >= &H0380
DECLARE FUNCTION SQLCancelHandle LIB "odbc32.dll" ALIAS "SQLCancelHandle" ( BYVAL HandleType AS INTEGER , BYVAL InputHandle AS QUAD ) AS INTEGER ' SQLRETURN
#ENDIF ' // ODBCVER >= 0x0380
#IF %ODBCVER >= &H0300
DECLARE FUNCTION SQLCloseCursor LIB "odbc32.dll" ALIAS "SQLCloseCursor" ( BYVAL StatementHandle AS QUAD ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLColAttribute LIB "odbc32.dll" ALIAS "SQLColAttribute" ( BYVAL StatementHandle AS QUAD , BYVAL ColumnNumber AS WORD , BYVAL FieldIdentifier AS WORD , BYREF CharacterAttribute AS ANY , BYVAL BufferLength AS INTEGER , BYREF StringLength AS INTEGER , BYREF NumericAttribute AS ANY ) AS INTEGER ' SQLRETURN
#ENDIF
DECLARE FUNCTION SQLColumns LIB "odbc32.dll" ALIAS "SQLColumns" ( BYVAL StatementHandle AS QUAD , BYREF CatalogName AS ASCIIZ , BYVAL NameLength1 AS INTEGER , BYREF SchemaName AS ASCIIZ , BYVAL NameLength2 AS INTEGER , BYREF TableName AS ASCIIZ , BYVAL NameLength3 AS INTEGER , BYREF ColumnName AS ASCIIZ , BYVAL NameLength4 AS INTEGER ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLConnect LIB "odbc32.dll" ALIAS "SQLConnect" ( BYVAL ConnectionHandle AS QUAD , BYREF ServerName AS ASCIIZ , BYVAL NameLength1 AS INTEGER , BYREF UserName AS ASCIIZ , BYVAL NameLength2 AS INTEGER , BYREF Authentication AS ASCIIZ , BYVAL NameLength3 AS INTEGER ) AS INTEGER ' SQLRETURN
#IF %ODBCVER >= &H0300
DECLARE FUNCTION SQLCopyDesc LIB "odbc32.dll" ALIAS "SQLCopyDesc" ( BYVAL SourceDescHandle AS QUAD , BYVAL TargetDescHandle AS QUAD ) AS INTEGER ' SQLRETURN
#ENDIF
DECLARE FUNCTION SQLDataSources LIB "odbc32.dll" ALIAS "SQLDataSources" ( BYVAL EnvironmentHandle AS QUAD , BYVAL Direction AS WORD , BYREF ServerName AS ASCIIZ , BYVAL BufferLength1 AS INTEGER , BYREF NameLength1 AS INTEGER , BYREF Description AS ASCIIZ , BYVAL BufferLength2 AS INTEGER , BYREF NameLength2 AS INTEGER ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLDescribeCol LIB "odbc32.dll" ALIAS "SQLDescribeCol" ( BYVAL StatementHandle AS QUAD , BYVAL ColumnNumber AS WORD , BYREF ColumnName AS ASCIIZ , BYVAL BufferLength AS INTEGER , BYREF NameLength AS INTEGER , BYREF DataType AS INTEGER , BYREF ColumnSize AS QUAD , BYREF DecimalDigits AS INTEGER , BYREF Nullable AS INTEGER ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLDisconnect LIB "odbc32.dll" ALIAS "SQLDisconnect" ( BYVAL ConnectionHandle AS QUAD ) AS INTEGER ' SQLRETURN
#IF %ODBCVER >= &H0300
DECLARE FUNCTION SQLEndTran LIB "odbc32.dll" ALIAS "SQLEndTran" ( BYVAL HandleType AS INTEGER , BYVAL Handle AS QUAD , BYVAL CompletionType AS INTEGER ) AS INTEGER ' SQLRETURN
#ENDIF
DECLARE FUNCTION SQLError LIB "odbc32.dll" ALIAS "SQLError" ( BYVAL EnvironmentHandle AS QUAD , BYVAL ConnectionHandle AS QUAD , BYVAL StatementHandle AS QUAD , BYREF Sqlstate AS ASCIIZ , BYREF NativeError AS LONG , BYREF MessageText AS ASCIIZ , BYVAL BufferLength AS INTEGER , BYREF TextLength AS INTEGER ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLExecDirect LIB "odbc32.dll" ALIAS "SQLExecDirect" ( BYVAL StatementHandle AS QUAD , BYREF StatementText AS ASCIIZ , BYVAL TextLength AS LONG ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLExecute LIB "odbc32.dll" ALIAS "SQLExecute" ( BYVAL StatementHandle AS QUAD ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLFetch LIB "odbc32.dll" ALIAS "SQLFetch" ( BYVAL StatementHandle AS QUAD ) AS INTEGER ' SQLRETURN
#IF %ODBCVER >= &H0300
DECLARE FUNCTION SQLFetchScroll LIB "odbc32.dll" ALIAS "SQLFetchScroll" ( BYVAL StatementHandle AS QUAD , BYVAL FetchOrientation AS INTEGER , BYVAL FetchOffset AS LONG ) AS INTEGER ' SQLRETURN
#ENDIF
DECLARE FUNCTION SQLFreeConnect LIB "odbc32.dll" ALIAS "SQLFreeConnect" ( BYVAL ConnectionHandle AS QUAD ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLFreeEnv LIB "odbc32.dll" ALIAS "SQLFreeEnv" ( BYVAL EnvironmentHandle AS QUAD ) AS INTEGER ' SQLRETURN
#IF %ODBCVER >= &H0300
DECLARE FUNCTION SQLFreeHandle LIB "odbc32.dll" ALIAS "SQLFreeHandle" ( BYVAL HandleType AS INTEGER , BYVAL Handle AS QUAD ) AS INTEGER ' SQLRETURN
#ENDIF
DECLARE FUNCTION SQLFreeStmt LIB "odbc32.dll" ALIAS "SQLFreeStmt" ( BYVAL StatementHandle AS QUAD , BYVAL Option AS WORD ) AS INTEGER ' SQLRETURN
#IF %ODBCVER >= &H0300
DECLARE FUNCTION SQLGetConnectAttr LIB "odbc32.dll" ALIAS "SQLGetConnectAttr" ( BYVAL ConnectionHandle AS QUAD , BYVAL Attribute AS LONG , BYREF Value AS ANY , BYVAL BufferLength AS LONG , BYREF StringLength AS LONG ) AS INTEGER ' SQLRETURN
#ENDIF
DECLARE FUNCTION SQLGetConnectOption LIB "odbc32.dll" ALIAS "SQLGetConnectOption" ( BYVAL ConnectionHandle AS QUAD , BYVAL Option AS WORD , BYREF Value AS ANY ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLGetCursorName LIB "odbc32.dll" ALIAS "SQLGetCursorName" ( BYVAL StatementHandle AS QUAD , BYREF CursorName AS ASCIIZ , BYVAL BufferLength AS INTEGER , BYREF NameLength AS INTEGER ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLGetData LIB "odbc32.dll" ALIAS "SQLGetData" ( BYVAL StatementHandle AS QUAD , BYVAL ColumnNumber AS WORD , BYVAL TargetType AS INTEGER , BYREF TargetValue AS ANY , BYVAL BufferLength AS LONG , BYREF StrLen_or_Ind AS LONG ) AS INTEGER ' SQLRETURN
#IF %ODBCVER >= &H0300
DECLARE FUNCTION SQLGetDescField LIB "odbc32.dll" ALIAS "SQLGetDescField" ( BYVAL DescriptorHandle AS QUAD , BYVAL RecNumber AS INTEGER , BYVAL FieldIdentifier AS INTEGER , BYREF Value AS ANY , BYVAL BufferLength AS LONG , BYREF StringLength AS LONG ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLGetDescRec LIB "odbc32.dll" ALIAS "SQLGetDescRec" ( BYVAL DescriptorHandle AS QUAD , BYVAL RecNumber AS INTEGER , BYREF Name AS ASCIIZ , BYVAL BufferLength AS INTEGER , BYREF StringLength AS INTEGER , BYREF Type AS INTEGER , BYREF SubType AS INTEGER , BYREF Length AS LONG , BYREF Precision AS INTEGER , BYREF Scale AS INTEGER , BYREF Nullable AS INTEGER ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLGetDiagField LIB "odbc32.dll" ALIAS "SQLGetDiagField" ( BYVAL HandleType AS INTEGER , BYVAL Handle AS QUAD , BYVAL RecNumber AS INTEGER , BYVAL DiagIdentifier AS INTEGER , BYREF DiagInfo AS ANY , BYVAL BufferLength AS INTEGER , BYREF StringLength AS INTEGER ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLGetDiagRec LIB "odbc32.dll" ALIAS "SQLGetDiagRec" ( BYVAL HandleType AS INTEGER , BYVAL Handle AS QUAD , BYVAL RecNumber AS INTEGER , BYREF Sqlstate AS ASCIIZ , BYREF NativeError AS LONG , BYREF MessageText AS ASCIIZ , BYVAL BufferLength AS INTEGER , BYREF TextLength AS INTEGER ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLGetEnvAttr LIB "odbc32.dll" ALIAS "SQLGetEnvAttr" ( BYVAL EnvironmentHandle AS QUAD , BYVAL Attribute AS LONG , BYREF Value AS ANY , BYVAL BufferLength AS LONG , BYREF StringLength AS LONG ) AS INTEGER ' SQLRETURN
#ENDIF ' /* ODBCVER >= 0x0300 */
DECLARE FUNCTION SQLGetFunctions LIB "odbc32.dll" ALIAS "SQLGetFunctions" ( BYVAL ConnectionHandle AS QUAD , BYVAL FunctionId AS WORD , BYREF Supported AS WORD ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLGetInfo LIB "odbc32.dll" ALIAS "SQLGetInfo" ( BYVAL ConnectionHandle AS QUAD , BYVAL InfoType AS WORD , BYREF InfoValue AS ANY , BYVAL BufferLength AS INTEGER , BYREF StringLength AS INTEGER ) AS INTEGER ' SQLRETURN
#IF %ODBCVER >= &H0300
DECLARE FUNCTION SQLGetStmtAttr LIB "odbc32.dll" ALIAS "SQLGetStmtAttr" ( BYVAL StatementHandle AS QUAD , BYVAL Attribute AS LONG , BYREF Value AS ANY , BYVAL BufferLength AS LONG , BYREF StringLength AS LONG ) AS INTEGER ' SQLRETURN
#ENDIF ' /* ODBCVER >= 0x0300 */
DECLARE FUNCTION SQLGetStmtOption LIB "odbc32.dll" ALIAS "SQLGetStmtOption" ( BYVAL StatementHandle AS QUAD , BYVAL Option AS WORD , BYREF Value AS ANY ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLGetTypeInfo LIB "odbc32.dll" ALIAS "SQLGetTypeInfo" ( BYVAL StatementHandle AS QUAD , BYVAL DataType AS INTEGER ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLNumResultCols LIB "odbc32.dll" ALIAS "SQLNumResultCols" ( BYVAL StatementHandle AS QUAD , BYREF ColumnCount AS INTEGER ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLParamData LIB "odbc32.dll" ALIAS "SQLParamData" ( BYVAL StatementHandle AS QUAD , BYREF Value AS ANY ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLPrepare LIB "odbc32.dll" ALIAS "SQLPrepare" ( BYVAL StatementHandle AS QUAD , BYREF StatementText AS ASCIIZ , BYVAL TextLength AS LONG ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLPutData LIB "odbc32.dll" ALIAS "SQLPutData" ( BYVAL StatementHandle AS QUAD , BYREF Data As ANY , BYVAL StrLen_or_Ind AS LONG ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLRowCount LIB "odbc32.dll" ALIAS "SQLRowCount" ( BYVAL StatementHandle AS QUAD , BYREF RowCount AS LONG ) AS INTEGER ' SQLRETURN
#IF %ODBCVER >= &H0300
DECLARE FUNCTION SQLSetConnectAttr LIB "odbc32.dll" ALIAS "SQLSetConnectAttr" ( BYVAL ConnectionHandle AS QUAD , BYVAL Attribute AS LONG , BYREF Value AS ANY , BYVAL StringLength AS LONG ) AS INTEGER ' SQLRETURN
#ENDIF ' /* ODBCVER >= 0x0300 */
DECLARE FUNCTION SQLSetConnectOption LIB "odbc32.dll" ALIAS "SQLSetConnectOption" ( BYVAL ConnectionHandle AS QUAD , BYVAL Option AS WORD , BYVAL Value AS QUAD ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLSetCursorName LIB "odbc32.dll" ALIAS "SQLSetCursorName" ( BYVAL StatementHandle AS QUAD , BYREF CursorName AS ASCIIZ , BYVAL NameLength AS INTEGER ) AS INTEGER ' SQLRETURN
#IF %ODBCVER >= &H0300
DECLARE FUNCTION SQLSetDescField LIB "odbc32.dll" ALIAS "SQLSetDescField" ( BYVAL DescriptorHandle AS QUAD , BYVAL RecNumber AS INTEGER , BYVAL FieldIdentifier AS INTEGER , BYREF Value AS ANY , BYVAL BufferLength AS LONG ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLSetDescRec LIB "odbc32.dll" ALIAS "SQLSetDescRec" ( BYVAL DescriptorHandle AS QUAD , BYVAL RecNumber AS INTEGER , BYVAL Type AS INTEGER , BYVAL SubType AS INTEGER , BYVAL Length AS LONG , BYVAL Precision AS INTEGER , BYVAL Scale AS INTEGER , BYREF Data AS ANY , BYREF StringLength AS LONG , BYREF Indicator AS LONG ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLSetEnvAttr LIB "odbc32.dll" ALIAS "SQLSetEnvAttr" ( BYVAL EnvironmentHandle AS QUAD , BYVAL Attribute AS LONG , BYREF Value AS ANY , BYVAL StringLength AS LONG ) AS INTEGER ' SQLRETURN
#ENDIF ' /* ODBCVER >= 0x0300 */
DECLARE FUNCTION SQLSetParam LIB "odbc32.dll" ALIAS "SQLSetParam" ( BYVAL StatementHandle AS QUAD , BYVAL ParameterNumber AS WORD , BYVAL ValueType AS INTEGER , BYVAL ParameterType AS INTEGER , BYVAL LengthPrecision AS QUAD , BYVAL ParameterScale AS INTEGER , BYREF ParameterValue AS ANY , BYREF StrLen_or_Ind AS LONG ) AS INTEGER ' SQLRETURN
#IF %ODBCVER >= &H0300
DECLARE FUNCTION SQLSetStmtAttr LIB "odbc32.dll" ALIAS "SQLSetStmtAttr" ( BYVAL StatementHandle AS QUAD , BYVAL Attribute AS LONG , BYREF Value AS ANY , BYVAL StringLength AS LONG ) AS INTEGER ' SQLRETURN
#ENDIF
DECLARE FUNCTION SQLSetStmtOption LIB "odbc32.dll" ALIAS "SQLSetStmtOption" ( BYVAL StatementHandle AS QUAD , BYVAL Option As WORD , BYVAL Value AS QUAD ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLSpecialColumns LIB "odbc32.dll" ALIAS "SQLSpecialColumns" ( BYVAL StatementHandle AS QUAD , BYVAL IdentifierType AS WORD , BYREF CatalogName AS ASCIIZ , BYVAL NameLength1 AS INTEGER , BYREF SchemaName AS ASCIIZ , BYVAL NameLength2 AS INTEGER , BYREF TableName AS ASCIIZ , BYVAL NameLength3 AS INTEGER , BYVAL Scope AS WORD , BYVAL Nullable AS WORD ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLStatistics LIB "odbc32.dll" ALIAS "SQLStatistics" ( BYVAL StatementHandle AS QUAD , BYREF CatalogName AS ASCIIZ , BYVAL NameLength1 AS INTEGER , BYREF SchemaName AS ASCIIZ , BYVAL NameLength2 AS INTEGER , BYREF TableName AS ASCIIZ , BYVAL NameLength3 AS INTEGER , BYVAL Unique AS WORD , BYVAL Reserved AS WORD ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLTables LIB "odbc32.dll" ALIAS "SQLTables" ( BYVAL StatementHandle AS QUAD , BYREF CatalogName AS ASCIIZ , BYVAL NameLength1 AS INTEGER , BYREF SchemaName AS ASCIIZ , BYVAL NameLength2 AS INTEGER , BYREF TableName AS ASCIIZ , BYVAL NameLength3 AS INTEGER , BYREF TableType AS ASCIIZ , BYVAL NameLength4 AS INTEGER ) AS INTEGER ' SQLRETURN
DECLARE FUNCTION SQLTransact LIB "odbc32.dll" ALIAS "SQLTransact" ( BYVAL EnvironmentHandle AS QUAD , BYVAL ConnectionHandle AS QUAD , BYVAL CompletionType AS WORD ) AS INTEGER ' SQLRETURN
#ENDIF
