' api_sqlext.sbp


#ifndef _INC_SQLEXT
#define _INC_SQLEXT

#ifndef _INC_SQL
#include <api_sql.sbp>
#endif


/* generally useful constants */
Const SQL_SPEC_MAJOR      = 3     	/* Major version of specification  */
Const SQL_SPEC_MINOR	    = 52     	/* Minor version of specification  */
Const SQL_SPEC_STRING    = "03.52"	/* String constant for version */

Const SQL_SQLSTATE_SIZE	 = 5	/* size of SQLSTATE */
Const SQL_MAX_DSN_LENGTH	 = 32	/* maximum data source name size */

Const SQL_MAX_OPTION_STRING_LENGTH     = 256

/* return code SQL_NO_DATA_FOUND is the same as SQL_NO_DATA */
Const SQL_NO_DATA_FOUND	 = SQL_NO_DATA

/* an end handle type */
Const SQL_HANDLE_SENV		 = 5


/* env attribute */
Const SQL_ATTR_ODBC_VERSION				 = 200
Const SQL_ATTR_CONNECTION_POOLING			 = 201
Const SQL_ATTR_CP_MATCH					 = 202


/* values for SQL_ATTR_CONNECTION_POOLING */
Const SQL_CP_OFF							 = 0
Const SQL_CP_ONE_PER_DRIVER				 = 1
Const SQL_CP_ONE_PER_HENV					 = 2
Const SQL_CP_DEFAULT						 = SQL_CP_OFF

/* values for SQL_ATTR_CP_MATCH */
Const SQL_CP_STRICT_MATCH					 = 0
Const SQL_CP_RELAXED_MATCH				 = 1
Const SQL_CP_MATCH_DEFAULT				 = SQL_CP_STRICT_MATCH		

/* values for SQL_ATTR_ODBC_VERSION */
Const SQL_OV_ODBC2						 = 2
Const SQL_OV_ODBC3						 = 3


/* connection attributes */
Const SQL_ACCESS_MODE                  = 101
Const SQL_AUTOCOMMIT                   = 102
Const SQL_LOGIN_TIMEOUT                = 103
Const SQL_OPT_TRACE                    = 104
Const SQL_OPT_TRACEFILE                = 105
Const SQL_TRANSLATE_DLL                = 106
Const SQL_TRANSLATE_OPTION             = 107
Const SQL_TXN_ISOLATION                = 108
Const SQL_CURRENT_QUALIFIER            = 109
Const SQL_ODBC_CURSORS                 = 110
Const SQL_QUIET_MODE                   = 111
Const SQL_PACKET_SIZE                  = 112

/* connection attributes with new names */
Const SQL_ATTR_ACCESS_MODE		 = SQL_ACCESS_MODE
Const SQL_ATTR_AUTOCOMMIT			 = SQL_AUTOCOMMIT
Const SQL_ATTR_CONNECTION_TIMEOUT	 = 113
Const SQL_ATTR_CURRENT_CATALOG	 = SQL_CURRENT_QUALIFIER
Const SQL_ATTR_DISCONNECT_BEHAVIOR	 = 114
Const SQL_ATTR_ENLIST_IN_DTC		 = 1207
Const SQL_ATTR_ENLIST_IN_XA		 = 1208
Const SQL_ATTR_LOGIN_TIMEOUT		 = SQL_LOGIN_TIMEOUT
Const SQL_ATTR_ODBC_CURSORS		 = SQL_ODBC_CURSORS
Const SQL_ATTR_PACKET_SIZE		 = SQL_PACKET_SIZE
Const SQL_ATTR_QUIET_MODE			 = SQL_QUIET_MODE
Const SQL_ATTR_TRACE				 = SQL_OPT_TRACE
Const SQL_ATTR_TRACEFILE			 = SQL_OPT_TRACEFILE
Const SQL_ATTR_TRANSLATE_LIB		 = SQL_TRANSLATE_DLL
Const SQL_ATTR_TRANSLATE_OPTION	 = SQL_TRANSLATE_OPTION
Const SQL_ATTR_TXN_ISOLATION		 = SQL_TXN_ISOLATION


Const SQL_ATTR_CONNECTION_DEAD	 = 1209	/* GetConnectAttr only */

/*	ODBC Driver Manager sets this connection attribute to a unicode driver 
	(which supports SQLConnectW) when the application is an ANSI application
	(which calls SQLConnect, SQLDriverConnect, or SQLBrowseConnect). 
	This is SetConnectAttr only and application does not set this attribute
	This attribute was introduced because some unicode driver's some APIs may 
	need to behave differently on ANSI or Unicode applications. A unicode 
	driver, which  has same behavior for both ANSI or Unicode applications,
	should return SQL_ERROR when the driver manager sets this connection 
	attribute. When a unicode driver returns SQL_SUCCESS on this attribute,
	the driver manager treates ANSI and Unicode connections differently in
	connection pooling.
*/
Const SQL_ATTR_ANSI_APP			 = 115


/* SQL_ACCESS_MODE options */
Const SQL_MODE_READ_WRITE              = 0
Const SQL_MODE_READ_ONLY               = 1
Const SQL_MODE_DEFAULT                 = SQL_MODE_READ_WRITE

/* SQL_AUTOCOMMIT options */
Const SQL_AUTOCOMMIT_OFF               = 0
Const SQL_AUTOCOMMIT_ON                = 1
Const SQL_AUTOCOMMIT_DEFAULT           = SQL_AUTOCOMMIT_ON

/* SQL_LOGIN_TIMEOUT options */
Const SQL_LOGIN_TIMEOUT_DEFAULT        = 15

/* SQL_OPT_TRACE options */
Const SQL_OPT_TRACE_OFF                = 0
Const SQL_OPT_TRACE_ON                 = 1
Const SQL_OPT_TRACE_DEFAULT            = SQL_OPT_TRACE_OFF
Const SQL_OPT_TRACE_FILE_DEFAULT       = "\SQL.LOG"

/* SQL_ODBC_CURSORS options */
Const SQL_CUR_USE_IF_NEEDED            = 0
Const SQL_CUR_USE_ODBC                 = 1
Const SQL_CUR_USE_DRIVER               = 2
Const SQL_CUR_DEFAULT                  = SQL_CUR_USE_DRIVER

/* values for SQL_ATTR_DISCONNECT_BEHAVIOR */
Const SQL_DB_RETURN_TO_POOL			 = 0
Const SQL_DB_DISCONNECT				 = 1
Const SQL_DB_DEFAULT					 = SQL_DB_RETURN_TO_POOL

/* values for SQL_ATTR_ENLIST_IN_DTC */
Const SQL_DTC_DONE					 = 0


/* values for SQL_ATTR_CONNECTION_DEAD */
Const SQL_CD_TRUE					 = 1		/* Connection is closed/dead */
Const SQL_CD_FALSE				 = 0		/* Connection is open/available */

/* values for SQL_ATTR_ANSI_APP */
Const SQL_AA_TRUE					 = 1	/* the application is an ANSI app */
Const SQL_AA_FALSE					 = 0	/* the application is a Unicode app */

/* statement attributes */
Const SQL_QUERY_TIMEOUT		 = 0
Const SQL_MAX_ROWS			 = 1
Const SQL_NOSCAN				 = 2
Const SQL_MAX_LENGTH			 = 3
Const SQL_ASYNC_ENABLE		 = 4	/* same as SQL_ATTR_ASYNC_ENABLE */	
Const SQL_BIND_TYPE			 = 5
Const SQL_CURSOR_TYPE			 = 6
Const SQL_CONCURRENCY			 = 7
Const SQL_KEYSET_SIZE			 = 8
Const SQL_ROWSET_SIZE			 = 9
Const SQL_SIMULATE_CURSOR		 = 10
Const SQL_RETRIEVE_DATA		 = 11
Const SQL_USE_BOOKMARKS		 = 12
Const SQL_GET_BOOKMARK		 = 13      /*      GetStmtOption Only */
Const SQL_ROW_NUMBER			 = 14      /*      GetStmtOption Only */

/* statement attributes for ODBC 3.0 */
Const SQL_ATTR_ASYNC_ENABLE				 = 4
Const SQL_ATTR_CONCURRENCY				 = SQL_CONCURRENCY
Const SQL_ATTR_CURSOR_TYPE				 = SQL_CURSOR_TYPE
Const SQL_ATTR_ENABLE_AUTO_IPD			 = 15
Const SQL_ATTR_FETCH_BOOKMARK_PTR			 = 16
Const SQL_ATTR_KEYSET_SIZE				 = SQL_KEYSET_SIZE
Const SQL_ATTR_MAX_LENGTH					 = SQL_MAX_LENGTH
Const SQL_ATTR_MAX_ROWS					 = SQL_MAX_ROWS
Const SQL_ATTR_NOSCAN						 = SQL_NOSCAN
Const SQL_ATTR_PARAM_BIND_OFFSET_PTR		 = 17
Const SQL_ATTR_PARAM_BIND_TYPE			 = 18
Const SQL_ATTR_PARAM_OPERATION_PTR		 = 19
Const SQL_ATTR_PARAM_STATUS_PTR			 = 20
Const SQL_ATTR_PARAMS_PROCESSED_PTR		 = 21
Const SQL_ATTR_PARAMSET_SIZE				 = 22
Const SQL_ATTR_QUERY_TIMEOUT				 = SQL_QUERY_TIMEOUT
Const SQL_ATTR_RETRIEVE_DATA				 = SQL_RETRIEVE_DATA
Const SQL_ATTR_ROW_BIND_OFFSET_PTR		 = 23
Const SQL_ATTR_ROW_BIND_TYPE				 = SQL_BIND_TYPE
Const SQL_ATTR_ROW_NUMBER					 = SQL_ROW_NUMBER	  	/*GetStmtAttr*/
Const SQL_ATTR_ROW_OPERATION_PTR			 = 24
Const SQL_ATTR_ROW_STATUS_PTR				 = 25
Const SQL_ATTR_ROWS_FETCHED_PTR			 = 26
Const SQL_ATTR_ROW_ARRAY_SIZE				 = 27	
Const SQL_ATTR_SIMULATE_CURSOR			 = SQL_SIMULATE_CURSOR
Const SQL_ATTR_USE_BOOKMARKS				 = SQL_USE_BOOKMARKS	




/* whether an attribute is a pointer or not */
Const SQL_IS_POINTER							 = (-4)
Const SQL_IS_UINTEGER							 = (-5)
Const SQL_IS_INTEGER							 = (-6)
Const SQL_IS_USMALLINT						 = (-7)
Const SQL_IS_SMALLINT							 = (-8)


/* the value of SQL_ATTR_PARAM_BIND_TYPE */
Const SQL_PARAM_BIND_BY_COLUMN			 = 0
Const SQL_PARAM_BIND_TYPE_DEFAULT			 = SQL_PARAM_BIND_BY_COLUMN


/* SQL_QUERY_TIMEOUT options */
Const SQL_QUERY_TIMEOUT_DEFAULT        = 0

/* SQL_MAX_ROWS options */
Const SQL_MAX_ROWS_DEFAULT             = 0

/* SQL_NOSCAN options */
Const SQL_NOSCAN_OFF                   = 0     /*      1.0 FALSE */
Const SQL_NOSCAN_ON                    = 1     /*      1.0 TRUE */
Const SQL_NOSCAN_DEFAULT               = SQL_NOSCAN_OFF

/* SQL_MAX_LENGTH options */
Const SQL_MAX_LENGTH_DEFAULT           = 0

/* values for SQL_ATTR_ASYNC_ENABLE */
Const SQL_ASYNC_ENABLE_OFF			 = 0
Const SQL_ASYNC_ENABLE_ON				 = 1
Const SQL_ASYNC_ENABLE_DEFAULT         = SQL_ASYNC_ENABLE_OFF

/* SQL_BIND_TYPE options */
Const SQL_BIND_BY_COLUMN               = 0
Const SQL_BIND_TYPE_DEFAULT            = SQL_BIND_BY_COLUMN  /* Default value */

/* SQL_CONCURRENCY options */
Const SQL_CONCUR_READ_ONLY             = 1
Const SQL_CONCUR_LOCK                  = 2
Const SQL_CONCUR_ROWVER                = 3
Const SQL_CONCUR_VALUES                = 4
Const SQL_CONCUR_DEFAULT               = SQL_CONCUR_READ_ONLY /* Default value */

/* SQL_CURSOR_TYPE options */
Const SQL_CURSOR_FORWARD_ONLY          = 0
Const SQL_CURSOR_KEYSET_DRIVEN         = 1
Const SQL_CURSOR_DYNAMIC               = 2
Const SQL_CURSOR_STATIC                = 3
Const SQL_CURSOR_TYPE_DEFAULT          = SQL_CURSOR_FORWARD_ONLY /* Default value */

/* SQL_ROWSET_SIZE options */
Const SQL_ROWSET_SIZE_DEFAULT          = 1

/* SQL_KEYSET_SIZE options */
Const SQL_KEYSET_SIZE_DEFAULT          = 0

/* SQL_SIMULATE_CURSOR options */
Const SQL_SC_NON_UNIQUE                = 0
Const SQL_SC_TRY_UNIQUE                = 1
Const SQL_SC_UNIQUE                    = 2

/* SQL_RETRIEVE_DATA options */
Const SQL_RD_OFF                       = 0
Const SQL_RD_ON                        = 1
Const SQL_RD_DEFAULT                   = SQL_RD_ON

/* SQL_USE_BOOKMARKS options */
Const SQL_UB_OFF                       = 0
Const SQL_UB_ON						 = 01
Const SQL_UB_DEFAULT                   = SQL_UB_OFF

/* New values for SQL_USE_BOOKMARKS attribute */
Const SQL_UB_FIXED					 = SQL_UB_ON
Const SQL_UB_VARIABLE					 = 2


/* SQLColAttributes defines */
Const SQL_COLUMN_COUNT                 = 0
Const SQL_COLUMN_NAME                  = 1
Const SQL_COLUMN_TYPE                  = 2
Const SQL_COLUMN_LENGTH                = 3
Const SQL_COLUMN_PRECISION             = 4
Const SQL_COLUMN_SCALE                 = 5
Const SQL_COLUMN_DISPLAY_SIZE          = 6
Const SQL_COLUMN_NULLABLE              = 7
Const SQL_COLUMN_UNSIGNED              = 8
Const SQL_COLUMN_MONEY                 = 9
Const SQL_COLUMN_UPDATABLE             = 10
Const SQL_COLUMN_AUTO_INCREMENT        = 11
Const SQL_COLUMN_CASE_SENSITIVE        = 12
Const SQL_COLUMN_SEARCHABLE            = 13
Const SQL_COLUMN_TYPE_NAME             = 14
Const SQL_COLUMN_TABLE_NAME            = 15
Const SQL_COLUMN_OWNER_NAME            = 16
Const SQL_COLUMN_QUALIFIER_NAME        = 17
Const SQL_COLUMN_LABEL                 = 18
Const SQL_COLATT_OPT_MAX               = SQL_COLUMN_LABEL


/* extended descriptor field */
Const SQL_DESC_ARRAY_SIZE						 = 20
Const SQL_DESC_ARRAY_STATUS_PTR				 = 21
Const SQL_DESC_AUTO_UNIQUE_VALUE				 = SQL_COLUMN_AUTO_INCREMENT
Const SQL_DESC_BASE_COLUMN_NAME				 = 22
Const SQL_DESC_BASE_TABLE_NAME				 = 23
Const SQL_DESC_BIND_OFFSET_PTR				 = 24
Const SQL_DESC_BIND_TYPE						 = 25
Const SQL_DESC_CASE_SENSITIVE					 = SQL_COLUMN_CASE_SENSITIVE
Const SQL_DESC_CATALOG_NAME					 = SQL_COLUMN_QUALIFIER_NAME
Const SQL_DESC_CONCISE_TYPE					 = SQL_COLUMN_TYPE
Const SQL_DESC_DATETIME_INTERVAL_PRECISION	 = 26
Const SQL_DESC_DISPLAY_SIZE					 = SQL_COLUMN_DISPLAY_SIZE
Const SQL_DESC_FIXED_PREC_SCALE				 = SQL_COLUMN_MONEY
Const SQL_DESC_LABEL							 = SQL_COLUMN_LABEL
Const SQL_DESC_LITERAL_PREFIX					 = 27
Const SQL_DESC_LITERAL_SUFFIX					 = 28
Const SQL_DESC_LOCAL_TYPE_NAME				 = 29
Const SQL_DESC_MAXIMUM_SCALE					 = 30
Const SQL_DESC_MINIMUM_SCALE					 = 31
Const SQL_DESC_NUM_PREC_RADIX					 = 32
Const SQL_DESC_PARAMETER_TYPE					 = 33
Const SQL_DESC_ROWS_PROCESSED_PTR				 = 34
Const SQL_DESC_ROWVER							 = 35
Const SQL_DESC_SCHEMA_NAME					 = SQL_COLUMN_OWNER_NAME
Const SQL_DESC_SEARCHABLE						 = SQL_COLUMN_SEARCHABLE
Const SQL_DESC_TYPE_NAME						 = SQL_COLUMN_TYPE_NAME
Const SQL_DESC_TABLE_NAME						 = SQL_COLUMN_TABLE_NAME
Const SQL_DESC_UNSIGNED						 = SQL_COLUMN_UNSIGNED
Const SQL_DESC_UPDATABLE						 = SQL_COLUMN_UPDATABLE


/* defines for diagnostics fields */
Const SQL_DIAG_CURSOR_ROW_COUNT			 = (-1249)
Const SQL_DIAG_ROW_NUMBER					 = (-1248)
Const SQL_DIAG_COLUMN_NUMBER				 = (-1247)	

/* SQL extended datatypes */
Const SQL_DATE                                 = 9
Const SQL_INTERVAL							 = 10

Const SQL_TIME                                 = 10
Const SQL_TIMESTAMP                            = 11
Const SQL_LONGVARCHAR                          = (-1)
Const SQL_BINARY                               = (-2)
Const SQL_VARBINARY                            = (-3)
Const SQL_LONGVARBINARY                        = (-4)
Const SQL_BIGINT                               = (-5)
Const SQL_TINYINT                              = (-6)
Const SQL_BIT                                  = (-7)
Const SQL_GUID				 = (-11)

/* interval code */
Const SQL_CODE_YEAR				 = 1
Const SQL_CODE_MONTH				 = 2
Const SQL_CODE_DAY				 = 3
Const SQL_CODE_HOUR				 = 4
Const SQL_CODE_MINUTE				 = 5
Const SQL_CODE_SECOND				 = 6
Const SQL_CODE_YEAR_TO_MONTH			 = 7
Const SQL_CODE_DAY_TO_HOUR			 = 8
Const SQL_CODE_DAY_TO_MINUTE			 = 9
Const SQL_CODE_DAY_TO_SECOND			 = 10
Const SQL_CODE_HOUR_TO_MINUTE			 = 11
Const SQL_CODE_HOUR_TO_SECOND			 = 12
Const SQL_CODE_MINUTE_TO_SECOND		 = 13

Const SQL_INTERVAL_YEAR					 = (100 + SQL_CODE_YEAR)
Const SQL_INTERVAL_MONTH					 = (100 + SQL_CODE_MONTH)
Const SQL_INTERVAL_DAY					 = (100 + SQL_CODE_DAY) 
Const SQL_INTERVAL_HOUR					 = (100 + SQL_CODE_HOUR) 
Const SQL_INTERVAL_MINUTE					 = (100 + SQL_CODE_MINUTE) 
Const SQL_INTERVAL_SECOND                	 = (100 + SQL_CODE_SECOND) 
Const SQL_INTERVAL_YEAR_TO_MONTH			 = (100 + SQL_CODE_YEAR_TO_MONTH)
Const SQL_INTERVAL_DAY_TO_HOUR			 = (100 + SQL_CODE_DAY_TO_HOUR) 
Const SQL_INTERVAL_DAY_TO_MINUTE			 = (100 + SQL_CODE_DAY_TO_MINUTE) 
Const SQL_INTERVAL_DAY_TO_SECOND			 = (100 + SQL_CODE_DAY_TO_SECOND) 
Const SQL_INTERVAL_HOUR_TO_MINUTE			 = (100 + SQL_CODE_HOUR_TO_MINUTE)
Const SQL_INTERVAL_HOUR_TO_SECOND			 = (100 + SQL_CODE_HOUR_TO_SECOND) 
Const SQL_INTERVAL_MINUTE_TO_SECOND		 = (100 + SQL_CODE_MINUTE_TO_SECOND)



/* C datatype to SQL datatype mapping      SQL types
                                           ------------------- */
Const SQL_C_CHAR     = SQL_CHAR             /* CHAR, VARCHAR, DECIMAL, NUMERIC */
Const SQL_C_LONG     = SQL_INTEGER          /* INTEGER                      */
Const SQL_C_SHORT    = SQL_SMALLINT         /* SMALLINT                     */
Const SQL_C_FLOAT    = SQL_REAL             /* REAL                         */
Const SQL_C_DOUBLE   = SQL_DOUBLE           /* FLOAT, DOUBLE                */
Const SQL_C_NUMERIC		 = SQL_NUMERIC

Const SQL_C_DEFAULT  = 99

Const SQL_SIGNED_OFFSET        = (-20)
Const SQL_UNSIGNED_OFFSET      = (-22)

/* C datatype to SQL datatype mapping */
Const SQL_C_DATE        = SQL_DATE
Const SQL_C_TIME        = SQL_TIME
Const SQL_C_TIMESTAMP   = SQL_TIMESTAMP
Const SQL_C_TYPE_DATE					 = SQL_TYPE_DATE
Const SQL_C_TYPE_TIME					 = SQL_TYPE_TIME
Const SQL_C_TYPE_TIMESTAMP			 = SQL_TYPE_TIMESTAMP
Const SQL_C_INTERVAL_YEAR				 = SQL_INTERVAL_YEAR
Const SQL_C_INTERVAL_MONTH			 = SQL_INTERVAL_MONTH
Const SQL_C_INTERVAL_DAY				 = SQL_INTERVAL_DAY
Const SQL_C_INTERVAL_HOUR				 = SQL_INTERVAL_HOUR
Const SQL_C_INTERVAL_MINUTE			 = SQL_INTERVAL_MINUTE
Const SQL_C_INTERVAL_SECOND			 = SQL_INTERVAL_SECOND
Const SQL_C_INTERVAL_YEAR_TO_MONTH	 = SQL_INTERVAL_YEAR_TO_MONTH
Const SQL_C_INTERVAL_DAY_TO_HOUR		 = SQL_INTERVAL_DAY_TO_HOUR
Const SQL_C_INTERVAL_DAY_TO_MINUTE	 = SQL_INTERVAL_DAY_TO_MINUTE
Const SQL_C_INTERVAL_DAY_TO_SECOND	 = SQL_INTERVAL_DAY_TO_SECOND
Const SQL_C_INTERVAL_HOUR_TO_MINUTE	 = SQL_INTERVAL_HOUR_TO_MINUTE
Const SQL_C_INTERVAL_HOUR_TO_SECOND	 = SQL_INTERVAL_HOUR_TO_SECOND
Const SQL_C_INTERVAL_MINUTE_TO_SECOND	 = SQL_INTERVAL_MINUTE_TO_SECOND

Const SQL_C_BINARY      = SQL_BINARY
Const SQL_C_BIT         = SQL_BIT
Const SQL_C_SBIGINT	 = (SQL_BIGINT+SQL_SIGNED_OFFSET)	   /* SIGNED BIGINT */
Const SQL_C_UBIGINT	 = (SQL_BIGINT+SQL_UNSIGNED_OFFSET)   /* UNSIGNED BIGINT */

Const SQL_C_TINYINT     = SQL_TINYINT
Const SQL_C_SLONG       = (SQL_C_LONG+SQL_SIGNED_OFFSET)    /* SIGNED INTEGER  */
Const SQL_C_SSHORT      = (SQL_C_SHORT+SQL_SIGNED_OFFSET)   /* SIGNED SMALLINT */
Const SQL_C_STINYINT    = (SQL_TINYINT+SQL_SIGNED_OFFSET)   /* SIGNED TINYINT  */
Const SQL_C_ULONG       = (SQL_C_LONG+SQL_UNSIGNED_OFFSET)  /* UNSIGNED INTEGER*/
Const SQL_C_USHORT      = (SQL_C_SHORT+SQL_UNSIGNED_OFFSET) /* UNSIGNED SMALLINT*/
Const SQL_C_UTINYINT    = (SQL_TINYINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED TINYINT*/

#ifdef _WIN64
Const SQL_C_BOOKMARK    = SQL_C_UBIGINT                     /* BOOKMARK        */
#else
Const SQL_C_BOOKMARK    = SQL_C_ULONG                       /* BOOKMARK        */
#endif


Const SQL_TYPE_NULL                    = 0

Const SQL_C_VARBOOKMARK		 = SQL_C_BINARY


/* define for SQL_DIAG_ROW_NUMBER and SQL_DIAG_COLUMN_NUMBER */
Const SQL_NO_ROW_NUMBER						 = (-1)
Const SQL_NO_COLUMN_NUMBER					 = (-1)
Const SQL_ROW_NUMBER_UNKNOWN					 = (-2)
Const SQL_COLUMN_NUMBER_UNKNOWN				 = (-2)

/* SQLBindParameter extensions */
Const SQL_DEFAULT_PARAM             = (-5)
Const SQL_IGNORE                    = (-6)
Const SQL_COLUMN_IGNORE			 = SQL_IGNORE

Const SQL_LEN_DATA_AT_EXEC_OFFSET   = (-100)
#define SQL_LEN_DATA_AT_EXEC(length) (-(length)+SQL_LEN_DATA_AT_EXEC_OFFSET)

/* binary length for driver specific attributes */
Const SQL_LEN_BINARY_ATTR_OFFSET	  = (-100)
#define SQL_LEN_BINARY_ATTR(length)	 (-(length)+SQL_LEN_BINARY_ATTR_OFFSET)

/* Defines for SQLBindParameter and
                           SQLProcedureColumns (returned in the result set) */
Const SQL_PARAM_TYPE_UNKNOWN            = 0
Const SQL_PARAM_INPUT                   = 1
Const SQL_PARAM_INPUT_OUTPUT            = 2
Const SQL_RESULT_COL                    = 3
Const SQL_PARAM_OUTPUT                  = 4
Const SQL_RETURN_VALUE                  = 5

/* Defines used by Driver Manager when mapping SQLSetParam to SQLBindParameter
*/
Const SQL_PARAM_TYPE_DEFAULT            = SQL_PARAM_INPUT_OUTPUT
Const SQL_SETPARAM_VALUE_MAX            = (-1)


Const SQL_COLATT_OPT_MIN               = SQL_COLUMN_COUNT

/* SQLColAttributes subdefines for SQL_COLUMN_UPDATABLE */
Const SQL_ATTR_READONLY                = 0
Const SQL_ATTR_WRITE                   = 1
Const SQL_ATTR_READWRITE_UNKNOWN       = 2

/* SQLColAttributes subdefines for SQL_COLUMN_SEARCHABLE */
/* These are also used by SQLGetInfo                     */
Const SQL_UNSEARCHABLE                 = 0
Const SQL_LIKE_ONLY                    = 1
Const SQL_ALL_EXCEPT_LIKE              = 2
Const SQL_SEARCHABLE                   = 3
Const SQL_PRED_SEARCHABLE				 = SQL_SEARCHABLE


/* Special return values for SQLGetData */
Const SQL_NO_TOTAL                     = (-4)

/********************************************/
/* SQLGetFunctions: additional values for   */
/* fFunction to represent functions that    */
/* are not in the X/Open spec.				*/
/********************************************/

Const SQL_API_SQLALLOCHANDLESTD	 = 73
Const SQL_API_SQLBULKOPERATIONS	 = 24
Const SQL_API_SQLBINDPARAMETER     = 72
Const SQL_API_SQLBROWSECONNECT     = 55    
Const SQL_API_SQLCOLATTRIBUTES     = 6 
Const SQL_API_SQLCOLUMNPRIVILEGES  = 56
Const SQL_API_SQLDESCRIBEPARAM     = 58
Const SQL_API_SQLDRIVERCONNECT	 = 41 
Const SQL_API_SQLDRIVERS           = 71
Const SQL_API_SQLEXTENDEDFETCH     = 59
Const SQL_API_SQLFOREIGNKEYS       = 60
Const SQL_API_SQLMORERESULTS       = 61
Const SQL_API_SQLNATIVESQL         = 62
Const SQL_API_SQLNUMPARAMS         = 63
Const SQL_API_SQLPARAMOPTIONS      = 64
Const SQL_API_SQLPRIMARYKEYS       = 65
Const SQL_API_SQLPROCEDURECOLUMNS  = 66
Const SQL_API_SQLPROCEDURES        = 67
Const SQL_API_SQLSETPOS            = 68
Const SQL_API_SQLSETSCROLLOPTIONS  = 69
Const SQL_API_SQLTABLEPRIVILEGES   = 70


/*--------------------------------------------*/
/* SQL_API_ALL_FUNCTIONS returns an array     */
/* of 'booleans' representing whether a       */
/* function is implemented by the driver.     */
/*                                            */
/* CAUTION: Only functions defined in ODBC    */
/* version 2.0 and earlier are returned, the  */
/* new high-range function numbers defined by */
/* X/Open break this scheme.   See the new    */
/* method -- SQL_API_ODBC3_ALL_FUNCTIONS      */
/*--------------------------------------------*/

Const SQL_API_ALL_FUNCTIONS        = 0		/* See CAUTION above */

/*----------------------------------------------*/
/* 2.X drivers export a dummy function with  	*/
/* ordinal number SQL_API_LOADBYORDINAL to speed*/
/* loading under the windows operating system.  */
/* 						*/
/* CAUTION: Loading by ordinal is not supported */
/* for 3.0 and above drivers.			*/
/*----------------------------------------------*/

Const SQL_API_LOADBYORDINAL        = 199		/* See CAUTION above */	

/*----------------------------------------------*/
/* SQL_API_ODBC3_ALL_FUNCTIONS                  */
/* This returns a bitmap, which allows us to    */
/* handle the higher-valued function numbers.   */
/* Use  SQL_FUNC_EXISTS(bitmap,function_number) */
/* to determine if the function exists.         */
/*----------------------------------------------*/


Const SQL_API_ODBC3_ALL_FUNCTIONS	 = 999
Const SQL_API_ODBC3_ALL_FUNCTIONS_SIZE	 = 250		/* array of 250 words */



/************************************************/
/* Extended definitions for SQLGetInfo			*/
/************************************************/

/*---------------------------------*/
/* Values in ODBC 2.0 that are not */
/* in the X/Open spec              */
/*---------------------------------*/

Const SQL_INFO_FIRST                        = 0		
Const SQL_ACTIVE_CONNECTIONS                = 0	/* MAX_DRIVER_CONNECTIONS */
Const SQL_ACTIVE_STATEMENTS                 = 1	/* MAX_CONCURRENT_ACTIVITIES */
Const SQL_DRIVER_HDBC                       = 3
Const SQL_DRIVER_HENV                       = 4
Const SQL_DRIVER_HSTMT                      = 5
Const SQL_DRIVER_NAME                       = 6
Const SQL_DRIVER_VER                        = 7
Const SQL_ODBC_API_CONFORMANCE              = 9
Const SQL_ODBC_VER                         = 10
Const SQL_ROW_UPDATES                      = 11
Const SQL_ODBC_SAG_CLI_CONFORMANCE         = 12
Const SQL_ODBC_SQL_CONFORMANCE             = 15
Const SQL_PROCEDURES                       = 21
Const SQL_CONCAT_NULL_BEHAVIOR             = 22
Const SQL_CURSOR_ROLLBACK_BEHAVIOR         = 24
Const SQL_EXPRESSIONS_IN_ORDERBY           = 27
Const SQL_MAX_OWNER_NAME_LEN               = 32	/* MAX_SCHEMA_NAME_LEN */
Const SQL_MAX_PROCEDURE_NAME_LEN           = 33
Const SQL_MAX_QUALIFIER_NAME_LEN           = 34	/* MAX_CATALOG_NAME_LEN */
Const SQL_MULT_RESULT_SETS                 = 36
Const SQL_MULTIPLE_ACTIVE_TXN              = 37
Const SQL_OUTER_JOINS                      = 38
Const SQL_OWNER_TERM                       = 39
Const SQL_PROCEDURE_TERM                   = 40
Const SQL_QUALIFIER_NAME_SEPARATOR         = 41
Const SQL_QUALIFIER_TERM                   = 42
Const SQL_SCROLL_OPTIONS                   = 44
Const SQL_TABLE_TERM                       = 45
Const SQL_CONVERT_FUNCTIONS                = 48
Const SQL_NUMERIC_FUNCTIONS                = 49
Const SQL_STRING_FUNCTIONS                 = 50
Const SQL_SYSTEM_FUNCTIONS                 = 51
Const SQL_TIMEDATE_FUNCTIONS               = 52
Const SQL_CONVERT_BIGINT                   = 53
Const SQL_CONVERT_BINARY                   = 54
Const SQL_CONVERT_BIT                      = 55
Const SQL_CONVERT_CHAR                     = 56
Const SQL_CONVERT_DATE                     = 57
Const SQL_CONVERT_DECIMAL                  = 58
Const SQL_CONVERT_DOUBLE                   = 59
Const SQL_CONVERT_FLOAT                    = 60
Const SQL_CONVERT_INTEGER                  = 61
Const SQL_CONVERT_LONGVARCHAR              = 62
Const SQL_CONVERT_NUMERIC                  = 63
Const SQL_CONVERT_REAL                     = 64
Const SQL_CONVERT_SMALLINT                 = 65
Const SQL_CONVERT_TIME                     = 66
Const SQL_CONVERT_TIMESTAMP                = 67
Const SQL_CONVERT_TINYINT                  = 68
Const SQL_CONVERT_VARBINARY                = 69
Const SQL_CONVERT_VARCHAR                  = 70
Const SQL_CONVERT_LONGVARBINARY            = 71
Const SQL_ODBC_SQL_OPT_IEF                 = 73		/* SQL_INTEGRITY */
Const SQL_CORRELATION_NAME                 = 74
Const SQL_NON_NULLABLE_COLUMNS             = 75
Const SQL_DRIVER_HLIB                      = 76
Const SQL_DRIVER_ODBC_VER                  = 77
Const SQL_LOCK_TYPES                       = 78
Const SQL_POS_OPERATIONS                   = 79
Const SQL_POSITIONED_STATEMENTS            = 80
Const SQL_BOOKMARK_PERSISTENCE             = 82
Const SQL_STATIC_SENSITIVITY               = 83
Const SQL_FILE_USAGE                       = 84
Const SQL_COLUMN_ALIAS                     = 87
Const SQL_GROUP_BY                         = 88
Const SQL_KEYWORDS                         = 89
Const SQL_OWNER_USAGE                      = 91
Const SQL_QUALIFIER_USAGE                  = 92
Const SQL_QUOTED_IDENTIFIER_CASE           = 93
Const SQL_SUBQUERIES                       = 95
Const SQL_UNION                            = 96
Const SQL_MAX_ROW_SIZE_INCLUDES_LONG       = 103
Const SQL_MAX_CHAR_LITERAL_LEN             = 108
Const SQL_TIMEDATE_ADD_INTERVALS           = 109
Const SQL_TIMEDATE_DIFF_INTERVALS          = 110
Const SQL_NEED_LONG_DATA_LEN               = 111
Const SQL_MAX_BINARY_LITERAL_LEN           = 112
Const SQL_LIKE_ESCAPE_CLAUSE               = 113
Const SQL_QUALIFIER_LOCATION               = 114



/*-----------------------------------------------*/
/* 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.				 */
/*-----------------------------------------------*/

Const SQL_ACTIVE_ENVIRONMENTS					 = 116
Const SQL_ALTER_DOMAIN						 = 117

Const SQL_SQL_CONFORMANCE						 = 118
Const SQL_DATETIME_LITERALS					 = 119

Const SQL_ASYNC_MODE							 = 10021	/* new X/Open spec */
Const SQL_BATCH_ROW_COUNT						 = 120
Const SQL_BATCH_SUPPORT						 = 121
Const SQL_CATALOG_LOCATION					 = SQL_QUALIFIER_LOCATION
Const SQL_CATALOG_NAME_SEPARATOR				 = SQL_QUALIFIER_NAME_SEPARATOR
Const SQL_CATALOG_TERM						 = SQL_QUALIFIER_TERM
Const SQL_CATALOG_USAGE						 = SQL_QUALIFIER_USAGE
Const SQL_CONVERT_WCHAR						 = 122
Const SQL_CONVERT_INTERVAL_DAY_TIME			 = 123
Const SQL_CONVERT_INTERVAL_YEAR_MONTH			 = 124
Const SQL_CONVERT_WLONGVARCHAR				 = 125
Const SQL_CONVERT_WVARCHAR					 = 126
Const SQL_CREATE_ASSERTION					 = 127
Const SQL_CREATE_CHARACTER_SET				 = 128
Const SQL_CREATE_COLLATION					 = 129
Const SQL_CREATE_DOMAIN						 = 130
Const SQL_CREATE_SCHEMA						 = 131
Const SQL_CREATE_TABLE						 = 132
Const SQL_CREATE_TRANSLATION					 = 133
Const SQL_CREATE_VIEW							 = 134
Const SQL_DRIVER_HDESC						 = 135
Const SQL_DROP_ASSERTION						 = 136
Const SQL_DROP_CHARACTER_SET					 = 137
Const SQL_DROP_COLLATION						 = 138
Const SQL_DROP_DOMAIN							 = 139
Const SQL_DROP_SCHEMA							 = 140
Const SQL_DROP_TABLE							 = 141
Const SQL_DROP_TRANSLATION					 = 142
Const SQL_DROP_VIEW							 = 143
Const SQL_DYNAMIC_CURSOR_ATTRIBUTES1			 = 144
Const SQL_DYNAMIC_CURSOR_ATTRIBUTES2			 = 145
Const SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1		 = 146		
Const SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2		 = 147
Const SQL_INDEX_KEYWORDS						 = 148
Const SQL_INFO_SCHEMA_VIEWS					 = 149
Const SQL_KEYSET_CURSOR_ATTRIBUTES1			 = 150
Const SQL_KEYSET_CURSOR_ATTRIBUTES2			 = 151
Const SQL_MAX_ASYNC_CONCURRENT_STATEMENTS		 = 10022	/* new X/Open spec */
Const SQL_ODBC_INTERFACE_CONFORMANCE			 = 152
Const SQL_PARAM_ARRAY_ROW_COUNTS     			 = 153
Const SQL_PARAM_ARRAY_SELECTS     			 = 154
Const SQL_SCHEMA_TERM							 = SQL_OWNER_TERM
Const SQL_SCHEMA_USAGE						 = SQL_OWNER_USAGE
Const SQL_SQL92_DATETIME_FUNCTIONS			 = 155
Const SQL_SQL92_FOREIGN_KEY_DELETE_RULE		 = 156		
Const SQL_SQL92_FOREIGN_KEY_UPDATE_RULE		 = 157		
Const SQL_SQL92_GRANT							 = 158
Const SQL_SQL92_NUMERIC_VALUE_FUNCTIONS		 = 159
Const SQL_SQL92_PREDICATES					 = 160
Const SQL_SQL92_RELATIONAL_JOIN_OPERATORS		 = 161
Const SQL_SQL92_REVOKE						 = 162
Const SQL_SQL92_ROW_VALUE_CONSTRUCTOR			 = 163
Const SQL_SQL92_STRING_FUNCTIONS				 = 164
Const SQL_SQL92_VALUE_EXPRESSIONS				 = 165
Const SQL_STANDARD_CLI_CONFORMANCE			 = 166
Const SQL_STATIC_CURSOR_ATTRIBUTES1			 = 167	
Const SQL_STATIC_CURSOR_ATTRIBUTES2			 = 168

Const SQL_AGGREGATE_FUNCTIONS					 = 169
Const SQL_DDL_INDEX							 = 170
Const SQL_DM_VER								 = 171
Const SQL_INSERT_STATEMENT					 = 172
Const SQL_CONVERT_GUID						 = 173		
Const SQL_UNION_STATEMENT						 = SQL_UNION


Const SQL_DTC_TRANSITION_COST					 = 1750

/* SQL_ALTER_TABLE bitmasks */
/* the following 5 bitmasks are defined in sql.h
*Const SQL_AT_ADD_COLUMN                   	 = &H00000001
*Const SQL_AT_DROP_COLUMN                  	 = &H00000002
*Const SQL_AT_ADD_CONSTRAINT               	 = &H00000008
*/
Const SQL_AT_ADD_COLUMN_SINGLE				 = &H00000020	
Const SQL_AT_ADD_COLUMN_DEFAULT				 = &H00000040
Const SQL_AT_ADD_COLUMN_COLLATION				 = &H00000080
Const SQL_AT_SET_COLUMN_DEFAULT				 = &H00000100
Const SQL_AT_DROP_COLUMN_DEFAULT				 = &H00000200
Const SQL_AT_DROP_COLUMN_CASCADE				 = &H00000400
Const SQL_AT_DROP_COLUMN_RESTRICT				 = &H00000800
Const SQL_AT_ADD_TABLE_CONSTRAINT				 = &H00001000		
Const SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE	 = &H00002000		
Const SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT	 = &H00004000		
Const SQL_AT_CONSTRAINT_NAME_DEFINITION		 = &H00008000
Const SQL_AT_CONSTRAINT_INITIALLY_DEFERRED	 = &H00010000
Const SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE	 = &H00020000
Const SQL_AT_CONSTRAINT_DEFERRABLE			 = &H00040000
Const SQL_AT_CONSTRAINT_NON_DEFERRABLE		 = &H00080000

/* SQL_CONVERT_*  return value bitmasks */

Const SQL_CVT_CHAR                         = &H00000001
Const SQL_CVT_NUMERIC                      = &H00000002
Const SQL_CVT_DECIMAL                      = &H00000004
Const SQL_CVT_INTEGER                      = &H00000008
Const SQL_CVT_SMALLINT                     = &H00000010
Const SQL_CVT_FLOAT                        = &H00000020
Const SQL_CVT_REAL                         = &H00000040
Const SQL_CVT_DOUBLE                       = &H00000080
Const SQL_CVT_VARCHAR                      = &H00000100
Const SQL_CVT_LONGVARCHAR                  = &H00000200
Const SQL_CVT_BINARY                       = &H00000400
Const SQL_CVT_VARBINARY                    = &H00000800
Const SQL_CVT_BIT                          = &H00001000
Const SQL_CVT_TINYINT                      = &H00002000
Const SQL_CVT_BIGINT                       = &H00004000
Const SQL_CVT_DATE                         = &H00008000
Const SQL_CVT_TIME                         = &H00010000
Const SQL_CVT_TIMESTAMP                    = &H00020000
Const SQL_CVT_LONGVARBINARY                = &H00040000
Const SQL_CVT_INTERVAL_YEAR_MONTH	    	 = &H00080000
Const SQL_CVT_INTERVAL_DAY_TIME	    	 = &H00100000
Const SQL_CVT_WCHAR						 = &H00200000
Const SQL_CVT_WLONGVARCHAR				 = &H00400000
Const SQL_CVT_WVARCHAR					 = &H00800000
Const SQL_CVT_GUID						 = &H01000000




/* SQL_CONVERT_FUNCTIONS functions */
Const SQL_FN_CVT_CONVERT                   = &H00000001
Const SQL_FN_CVT_CAST						 = &H00000002



/* SQL_STRING_FUNCTIONS functions */

Const SQL_FN_STR_CONCAT                    = &H00000001
Const SQL_FN_STR_INSERT                    = &H00000002
Const SQL_FN_STR_LEFT                      = &H00000004
Const SQL_FN_STR_LTRIM                     = &H00000008
Const SQL_FN_STR_LENGTH                    = &H00000010
Const SQL_FN_STR_LOCATE                    = &H00000020
Const SQL_FN_STR_LCASE                     = &H00000040
Const SQL_FN_STR_REPEAT                    = &H00000080
Const SQL_FN_STR_REPLACE                   = &H00000100
Const SQL_FN_STR_RIGHT                     = &H00000200
Const SQL_FN_STR_RTRIM                     = &H00000400
Const SQL_FN_STR_SUBSTRING                 = &H00000800
Const SQL_FN_STR_UCASE                     = &H00001000
Const SQL_FN_STR_ASCII                     = &H00002000
Const SQL_FN_STR_CHAR                      = &H00004000
Const SQL_FN_STR_DIFFERENCE                = &H00008000
Const SQL_FN_STR_LOCATE_2                  = &H00010000
Const SQL_FN_STR_SOUNDEX                   = &H00020000
Const SQL_FN_STR_SPACE                     = &H00040000
Const SQL_FN_STR_BIT_LENGTH				 = &H00080000
Const SQL_FN_STR_CHAR_LENGTH				 = &H00100000
Const SQL_FN_STR_CHARACTER_LENGTH			 = &H00200000
Const SQL_FN_STR_OCTET_LENGTH				 = &H00400000
Const SQL_FN_STR_POSITION					 = &H00800000


/* SQL_SQL92_STRING_FUNCTIONS */
Const SQL_SSF_CONVERT						 = &H00000001	
Const SQL_SSF_LOWER						 = &H00000002
Const SQL_SSF_UPPER						 = &H00000004
Const SQL_SSF_SUBSTRING					 = &H00000008
Const SQL_SSF_TRANSLATE					 = &H00000010
Const SQL_SSF_TRIM_BOTH					 = &H00000020
Const SQL_SSF_TRIM_LEADING				 = &H00000040
Const SQL_SSF_TRIM_TRAILING				 = &H00000080

/* SQL_NUMERIC_FUNCTIONS functions */

Const SQL_FN_NUM_ABS                       = &H00000001
Const SQL_FN_NUM_ACOS                      = &H00000002
Const SQL_FN_NUM_ASIN                      = &H00000004
Const SQL_FN_NUM_ATAN                      = &H00000008
Const SQL_FN_NUM_ATAN2                     = &H00000010
Const SQL_FN_NUM_CEILING                   = &H00000020
Const SQL_FN_NUM_COS                       = &H00000040
Const SQL_FN_NUM_COT                       = &H00000080
Const SQL_FN_NUM_EXP                       = &H00000100
Const SQL_FN_NUM_FLOOR                     = &H00000200
Const SQL_FN_NUM_LOG                       = &H00000400
Const SQL_FN_NUM_MOD                       = &H00000800
Const SQL_FN_NUM_SIGN                      = &H00001000
Const SQL_FN_NUM_SIN                       = &H00002000
Const SQL_FN_NUM_SQRT                      = &H00004000
Const SQL_FN_NUM_TAN                       = &H00008000
Const SQL_FN_NUM_PI                        = &H00010000
Const SQL_FN_NUM_RAND                      = &H00020000
Const SQL_FN_NUM_DEGREES                   = &H00040000
Const SQL_FN_NUM_LOG10                     = &H00080000
Const SQL_FN_NUM_POWER                     = &H00100000
Const SQL_FN_NUM_RADIANS                   = &H00200000
Const SQL_FN_NUM_ROUND                     = &H00400000
Const SQL_FN_NUM_TRUNCATE                  = &H00800000

/* SQL_SQL92_NUMERIC_VALUE_FUNCTIONS */
Const SQL_SNVF_BIT_LENGTH					 = &H00000001
Const SQL_SNVF_CHAR_LENGTH				 = &H00000002
Const SQL_SNVF_CHARACTER_LENGTH			 = &H00000004
Const SQL_SNVF_EXTRACT					 = &H00000008
Const SQL_SNVF_OCTET_LENGTH				 = &H00000010
Const SQL_SNVF_POSITION					 = &H00000020


/* SQL_TIMEDATE_FUNCTIONS functions */

Const SQL_FN_TD_NOW                        = &H00000001
Const SQL_FN_TD_CURDATE                    = &H00000002
Const SQL_FN_TD_DAYOFMONTH                 = &H00000004
Const SQL_FN_TD_DAYOFWEEK                  = &H00000008
Const SQL_FN_TD_DAYOFYEAR                  = &H00000010
Const SQL_FN_TD_MONTH                      = &H00000020
Const SQL_FN_TD_QUARTER                    = &H00000040
Const SQL_FN_TD_WEEK                       = &H00000080
Const SQL_FN_TD_YEAR                       = &H00000100
Const SQL_FN_TD_CURTIME                    = &H00000200
Const SQL_FN_TD_HOUR                       = &H00000400
Const SQL_FN_TD_MINUTE                     = &H00000800
Const SQL_FN_TD_SECOND                     = &H00001000
Const SQL_FN_TD_TIMESTAMPADD               = &H00002000
Const SQL_FN_TD_TIMESTAMPDIFF              = &H00004000
Const SQL_FN_TD_DAYNAME                    = &H00008000
Const SQL_FN_TD_MONTHNAME                  = &H00010000
Const SQL_FN_TD_CURRENT_DATE				 = &H00020000
Const SQL_FN_TD_CURRENT_TIME				 = &H00040000
Const SQL_FN_TD_CURRENT_TIMESTAMP			 = &H00080000
Const SQL_FN_TD_EXTRACT					 = &H00100000


/* SQL_SQL92_DATETIME_FUNCTIONS */
Const SQL_SDF_CURRENT_DATE				 = &H00000001
Const SQL_SDF_CURRENT_TIME				 = &H00000002
Const SQL_SDF_CURRENT_TIMESTAMP			 = &H00000004

/* SQL_SYSTEM_FUNCTIONS functions */

Const SQL_FN_SYS_USERNAME                  = &H00000001
Const SQL_FN_SYS_DBNAME                    = &H00000002
Const SQL_FN_SYS_IFNULL                    = &H00000004

/* SQL_TIMEDATE_ADD_INTERVALS and SQL_TIMEDATE_DIFF_INTERVALS functions */

Const SQL_FN_TSI_FRAC_SECOND               = &H00000001
Const SQL_FN_TSI_SECOND                    = &H00000002
Const SQL_FN_TSI_MINUTE                    = &H00000004
Const SQL_FN_TSI_HOUR                      = &H00000008
Const SQL_FN_TSI_DAY                       = &H00000010
Const SQL_FN_TSI_WEEK                      = &H00000020
Const SQL_FN_TSI_MONTH                     = &H00000040
Const SQL_FN_TSI_QUARTER                   = &H00000080
Const SQL_FN_TSI_YEAR                      = &H00000100

/* bitmasks for SQL_DYNAMIC_CURSOR_ATTRIBUTES1,
 * SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1, 
 * SQL_KEYSET_CURSOR_ATTRIBUTES1, and SQL_STATIC_CURSOR_ATTRIBUTES1 
 */
/* supported SQLFetchScroll FetchOrientation's */
Const SQL_CA1_NEXT						 = &H00000001
Const SQL_CA1_ABSOLUTE					 = &H00000002
Const SQL_CA1_RELATIVE					 = &H00000004
Const SQL_CA1_BOOKMARK					 = &H00000008

/* supported SQLSetPos LockType's */
Const SQL_CA1_LOCK_NO_CHANGE				 = &H00000040
Const SQL_CA1_LOCK_EXCLUSIVE				 = &H00000080
Const SQL_CA1_LOCK_UNLOCK					 = &H00000100

/* supported SQLSetPos Operations */
Const SQL_CA1_POS_POSITION				 = &H00000200
Const SQL_CA1_POS_UPDATE					 = &H00000400
Const SQL_CA1_POS_DELETE					 = &H00000800
Const SQL_CA1_POS_REFRESH					 = &H00001000

/* positioned updates and deletes */
Const SQL_CA1_POSITIONED_UPDATE			 = &H00002000
Const SQL_CA1_POSITIONED_DELETE			 = &H00004000
Const SQL_CA1_SELECT_FOR_UPDATE			 = &H00008000

/* supported SQLBulkOperations operations */
Const SQL_CA1_BULK_ADD					 = &H00010000
Const SQL_CA1_BULK_UPDATE_BY_BOOKMARK		 = &H00020000
Const SQL_CA1_BULK_DELETE_BY_BOOKMARK		 = &H00040000
Const SQL_CA1_BULK_FETCH_BY_BOOKMARK		 = &H00080000


/* bitmasks for SQL_DYNAMIC_CURSOR_ATTRIBUTES2,
 * SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2, 
 * SQL_KEYSET_CURSOR_ATTRIBUTES2, and SQL_STATIC_CURSOR_ATTRIBUTES2 
 */
/* supported values for SQL_ATTR_SCROLL_CONCURRENCY */
Const SQL_CA2_READ_ONLY_CONCURRENCY		 = &H00000001
Const SQL_CA2_LOCK_CONCURRENCY			 = &H00000002
Const SQL_CA2_OPT_ROWVER_CONCURRENCY		 = &H00000004
Const SQL_CA2_OPT_VALUES_CONCURRENCY		 = &H00000008

/* sensitivity of the cursor to its own inserts, deletes, and updates */
Const SQL_CA2_SENSITIVITY_ADDITIONS		 = &H00000010
Const SQL_CA2_SENSITIVITY_DELETIONS		 = &H00000020
Const SQL_CA2_SENSITIVITY_UPDATES			 = &H00000040

/* semantics of SQL_ATTR_MAX_ROWS */
Const SQL_CA2_MAX_ROWS_SELECT				 = &H00000080
Const SQL_CA2_MAX_ROWS_INSERT				 = &H00000100
Const SQL_CA2_MAX_ROWS_DELETE				 = &H00000200
Const SQL_CA2_MAX_ROWS_UPDATE				 = &H00000400
Const SQL_CA2_MAX_ROWS_CATALOG			 = &H00000800
Const SQL_CA2_MAX_ROWS_AFFECTS_ALL		 = (SQL_CA2_MAX_ROWS_SELECT or _
					SQL_CA2_MAX_ROWS_INSERT or SQL_CA2_MAX_ROWS_DELETE or _
					SQL_CA2_MAX_ROWS_UPDATE or SQL_CA2_MAX_ROWS_CATALOG)

/* semantics of SQL_DIAG_CURSOR_ROW_COUNT */
Const SQL_CA2_CRC_EXACT					 = &H00001000
Const SQL_CA2_CRC_APPROXIMATE				 = &H00002000

/* the kinds of positioned statements that can be simulated */
Const SQL_CA2_SIMULATE_NON_UNIQUE			 = &H00004000
Const SQL_CA2_SIMULATE_TRY_UNIQUE			 = &H00008000
Const SQL_CA2_SIMULATE_UNIQUE				 = &H00010000


/* SQL_ODBC_API_CONFORMANCE values */

Const SQL_OAC_NONE                         = &H0000
Const SQL_OAC_LEVEL1                       = &H0001
Const SQL_OAC_LEVEL2                       = &H0002

/* SQL_ODBC_SAG_CLI_CONFORMANCE values */

Const SQL_OSCC_NOT_COMPLIANT               = &H0000
Const SQL_OSCC_COMPLIANT                   = &H0001

/* SQL_ODBC_SQL_CONFORMANCE values */

Const SQL_OSC_MINIMUM                      = &H0000
Const SQL_OSC_CORE                         = &H0001
Const SQL_OSC_EXTENDED                     = &H0002


/* SQL_CONCAT_NULL_BEHAVIOR values */

Const SQL_CB_NULL                          = &H0000
Const SQL_CB_NON_NULL                      = &H0001

/* SQL_SCROLL_OPTIONS masks */

Const SQL_SO_FORWARD_ONLY                  = &H00000001
Const SQL_SO_KEYSET_DRIVEN                 = &H00000002
Const SQL_SO_DYNAMIC                       = &H00000004
Const SQL_SO_MIXED                         = &H00000008
Const SQL_SO_STATIC                        = &H00000010

/* SQL_FETCH_DIRECTION masks */

/* SQL_FETCH_RESUME is no longer supported
Const SQL_FD_FETCH_RESUME                  = &H00000040 
*/
Const SQL_FD_FETCH_BOOKMARK                = &H00000080

/* SQL_TXN_ISOLATION_OPTION masks */
/* SQL_TXN_VERSIONING is no longer supported
Const SQL_TXN_VERSIONING                   = &H00000010
*/

/* SQL_CORRELATION_NAME values */

Const SQL_CN_NONE                          = &H0000
Const SQL_CN_DIFFERENT                     = &H0001
Const SQL_CN_ANY                           = &H0002

/* SQL_NON_NULLABLE_COLUMNS values */

Const SQL_NNC_NULL                         = &H0000
Const SQL_NNC_NON_NULL                     = &H0001

/* SQL_NULL_COLLATION values */

Const SQL_NC_START                         = &H0002
Const SQL_NC_END                           = &H0004

/* SQL_FILE_USAGE values */

Const SQL_FILE_NOT_SUPPORTED               = &H0000
Const SQL_FILE_TABLE                       = &H0001
Const SQL_FILE_QUALIFIER                   = &H0002
Const SQL_FILE_CATALOG					 = SQL_FILE_QUALIFIER	' ODBC 3.0


/* SQL_GETDATA_EXTENSIONS values */

Const SQL_GD_BLOCK                         = &H00000004
Const SQL_GD_BOUND                         = &H00000008

/* SQL_POSITIONED_STATEMENTS masks */

Const SQL_PS_POSITIONED_DELETE             = &H00000001
Const SQL_PS_POSITIONED_UPDATE             = &H00000002
Const SQL_PS_SELECT_FOR_UPDATE             = &H00000004

/* SQL_GROUP_BY values */

Const SQL_GB_NOT_SUPPORTED                 = &H0000
Const SQL_GB_GROUP_BY_EQUALS_SELECT        = &H0001
Const SQL_GB_GROUP_BY_CONTAINS_SELECT      = &H0002
Const SQL_GB_NO_RELATION                   = &H0003
Const SQL_GB_COLLATE						 = &H0004



/* SQL_OWNER_USAGE masks */

Const SQL_OU_DML_STATEMENTS                = &H00000001
Const SQL_OU_PROCEDURE_INVOCATION          = &H00000002
Const SQL_OU_TABLE_DEFINITION              = &H00000004
Const SQL_OU_INDEX_DEFINITION              = &H00000008
Const SQL_OU_PRIVILEGE_DEFINITION          = &H00000010

/* SQL_SCHEMA_USAGE masks */
Const SQL_SU_DML_STATEMENTS			 = SQL_OU_DML_STATEMENTS 
Const SQL_SU_PROCEDURE_INVOCATION		 = SQL_OU_PROCEDURE_INVOCATION
Const SQL_SU_TABLE_DEFINITION			 = SQL_OU_TABLE_DEFINITION
Const SQL_SU_INDEX_DEFINITION			 = SQL_OU_INDEX_DEFINITION
Const SQL_SU_PRIVILEGE_DEFINITION		 = SQL_OU_PRIVILEGE_DEFINITION


/* SQL_QUALIFIER_USAGE masks */

Const SQL_QU_DML_STATEMENTS                = &H00000001
Const SQL_QU_PROCEDURE_INVOCATION          = &H00000002
Const SQL_QU_TABLE_DEFINITION              = &H00000004
Const SQL_QU_INDEX_DEFINITION              = &H00000008
Const SQL_QU_PRIVILEGE_DEFINITION          = &H00000010

/* SQL_CATALOG_USAGE masks */
Const SQL_CU_DML_STATEMENTS			 = SQL_QU_DML_STATEMENTS
Const SQL_CU_PROCEDURE_INVOCATION		 = SQL_QU_PROCEDURE_INVOCATION 
Const SQL_CU_TABLE_DEFINITION			 = SQL_QU_TABLE_DEFINITION
Const SQL_CU_INDEX_DEFINITION			 = SQL_QU_INDEX_DEFINITION 
Const SQL_CU_PRIVILEGE_DEFINITION		 = SQL_QU_PRIVILEGE_DEFINITION 


/* SQL_SUBQUERIES masks */

Const SQL_SQ_COMPARISON                    = &H00000001
Const SQL_SQ_EXISTS                        = &H00000002
Const SQL_SQ_IN                            = &H00000004
Const SQL_SQ_QUANTIFIED                    = &H00000008
Const SQL_SQ_CORRELATED_SUBQUERIES         = &H00000010

/* SQL_UNION masks */

Const SQL_U_UNION                          = &H00000001
Const SQL_U_UNION_ALL                      = &H00000002

/* SQL_BOOKMARK_PERSISTENCE values */

Const SQL_BP_CLOSE                         = &H00000001
Const SQL_BP_DELETE                        = &H00000002
Const SQL_BP_DROP                          = &H00000004
Const SQL_BP_TRANSACTION                   = &H00000008
Const SQL_BP_UPDATE                        = &H00000010
Const SQL_BP_OTHER_HSTMT                   = &H00000020
Const SQL_BP_SCROLL                        = &H00000040

/* SQL_STATIC_SENSITIVITY values */

Const SQL_SS_ADDITIONS                     = &H00000001
Const SQL_SS_DELETIONS                     = &H00000002
Const SQL_SS_UPDATES                       = &H00000004

/* SQL_VIEW values */
Const SQL_CV_CREATE_VIEW					 = &H00000001
Const SQL_CV_CHECK_OPTION					 = &H00000002
Const SQL_CV_CASCADED						 = &H00000004
Const SQL_CV_LOCAL						 = &H00000008

/* SQL_LOCK_TYPES masks */

Const SQL_LCK_NO_CHANGE                    = &H00000001
Const SQL_LCK_EXCLUSIVE                    = &H00000002
Const SQL_LCK_UNLOCK                       = &H00000004

/* SQL_POS_OPERATIONS masks */

Const SQL_POS_POSITION                     = &H00000001
Const SQL_POS_REFRESH                      = &H00000002
Const SQL_POS_UPDATE                       = &H00000004
Const SQL_POS_DELETE                       = &H00000008
Const SQL_POS_ADD                          = &H00000010

/* SQL_QUALIFIER_LOCATION values */

Const SQL_QL_START                         = &H0001
Const SQL_QL_END                           = &H0002

/* Here start return values for ODBC 3.0 SQLGetInfo */

/* SQL_AGGREGATE_FUNCTIONS bitmasks */
Const SQL_AF_AVG						 = &H00000001
Const SQL_AF_COUNT					 = &H00000002
Const SQL_AF_MAX						 = &H00000004
Const SQL_AF_MIN						 = &H00000008
Const SQL_AF_SUM						 = &H00000010
Const SQL_AF_DISTINCT					 = &H00000020
Const SQL_AF_ALL						 = &H00000040	

/* SQL_SQL_CONFORMANCE bit masks */
Const SQL_SC_SQL92_ENTRY				 = &H00000001
Const SQL_SC_FIPS127_2_TRANSITIONAL	 = &H00000002
Const SQL_SC_SQL92_INTERMEDIATE		 = &H00000004
Const SQL_SC_SQL92_FULL				 = &H00000008

/* SQL_DATETIME_LITERALS masks */
Const SQL_DL_SQL92_DATE						 = &H00000001
Const SQL_DL_SQL92_TIME						 = &H00000002
Const SQL_DL_SQL92_TIMESTAMP					 = &H00000004
Const SQL_DL_SQL92_INTERVAL_YEAR				 = &H00000008
Const SQL_DL_SQL92_INTERVAL_MONTH				 = &H00000010
Const SQL_DL_SQL92_INTERVAL_DAY				 = &H00000020
Const SQL_DL_SQL92_INTERVAL_HOUR				 = &H00000040
Const SQL_DL_SQL92_INTERVAL_MINUTE			 = &H00000080
Const SQL_DL_SQL92_INTERVAL_SECOND			 = &H00000100
Const SQL_DL_SQL92_INTERVAL_YEAR_TO_MONTH		 = &H00000200
Const SQL_DL_SQL92_INTERVAL_DAY_TO_HOUR		 = &H00000400
Const SQL_DL_SQL92_INTERVAL_DAY_TO_MINUTE		 = &H00000800
Const SQL_DL_SQL92_INTERVAL_DAY_TO_SECOND		 = &H00001000
Const SQL_DL_SQL92_INTERVAL_HOUR_TO_MINUTE	 = &H00002000
Const SQL_DL_SQL92_INTERVAL_HOUR_TO_SECOND	 = &H00004000
Const SQL_DL_SQL92_INTERVAL_MINUTE_TO_SECOND	 = &H00008000

/* SQL_CATALOG_LOCATION values */
Const SQL_CL_START						 = SQL_QL_START
Const SQL_CL_END							 = SQL_QL_END

/* values for SQL_BATCH_ROW_COUNT */
Const SQL_BRC_PROCEDURES			 = &H0000001
Const SQL_BRC_EXPLICIT			 = &H0000002
Const SQL_BRC_ROLLED_UP			 = &H0000004

/* bitmasks for SQL_BATCH_SUPPORT */
Const SQL_BS_SELECT_EXPLICIT				 = &H00000001
Const SQL_BS_ROW_COUNT_EXPLICIT			 = &H00000002
Const SQL_BS_SELECT_PROC					 = &H00000004
Const SQL_BS_ROW_COUNT_PROC				 = &H00000008

/* Values for SQL_PARAM_ARRAY_ROW_COUNTS getinfo */
Const SQL_PARC_BATCH		 = 1
Const SQL_PARC_NO_BATCH	 = 2

/* values for SQL_PARAM_ARRAY_SELECTS */
Const SQL_PAS_BATCH				 = 1
Const SQL_PAS_NO_BATCH			 = 2		
Const SQL_PAS_NO_SELECT			 = 3

/* Bitmasks for SQL_INDEX_KEYWORDS */
Const SQL_IK_NONE							 = &H00000000
Const SQL_IK_ASC							 = &H00000001
Const SQL_IK_DESC							 = &H00000002
Const SQL_IK_ALL							 = (SQL_IK_ASC or SQL_IK_DESC)

/* Bitmasks for SQL_INFO_SCHEMA_VIEWS */

Const SQL_ISV_ASSERTIONS					 = &H00000001
Const SQL_ISV_CHARACTER_SETS				 = &H00000002
Const SQL_ISV_CHECK_CONSTRAINTS			 = &H00000004
Const SQL_ISV_COLLATIONS					 = &H00000008
Const SQL_ISV_COLUMN_DOMAIN_USAGE			 = &H00000010
Const SQL_ISV_COLUMN_PRIVILEGES			 = &H00000020
Const SQL_ISV_COLUMNS						 = &H00000040
Const SQL_ISV_CONSTRAINT_COLUMN_USAGE		 = &H00000080
Const SQL_ISV_CONSTRAINT_TABLE_USAGE		 = &H00000100
Const SQL_ISV_DOMAIN_CONSTRAINTS			 = &H00000200
Const SQL_ISV_DOMAINS						 = &H00000400
Const SQL_ISV_KEY_COLUMN_USAGE			 = &H00000800
Const SQL_ISV_REFERENTIAL_CONSTRAINTS		 = &H00001000
Const SQL_ISV_SCHEMATA					 = &H00002000
Const SQL_ISV_SQL_LANGUAGES				 = &H00004000
Const SQL_ISV_TABLE_CONSTRAINTS			 = &H00008000
Const SQL_ISV_TABLE_PRIVILEGES			 = &H00010000
Const SQL_ISV_TABLES						 = &H00020000
Const SQL_ISV_TRANSLATIONS				 = &H00040000
Const SQL_ISV_USAGE_PRIVILEGES			 = &H00080000
Const SQL_ISV_VIEW_COLUMN_USAGE			 = &H00100000
Const SQL_ISV_VIEW_TABLE_USAGE			 = &H00200000
Const SQL_ISV_VIEWS						 = &H00400000


/* Bitmasks for SQL_ALTER_DOMAIN */
Const SQL_AD_CONSTRAINT_NAME_DEFINITION			 = &H00000001	
Const SQL_AD_ADD_DOMAIN_CONSTRAINT	 			 = &H00000002
Const SQL_AD_DROP_DOMAIN_CONSTRAINT	 			 = &H00000004
Const SQL_AD_ADD_DOMAIN_DEFAULT   	 			 = &H00000008
Const SQL_AD_DROP_DOMAIN_DEFAULT   	 			 = &H00000010
Const SQL_AD_ADD_CONSTRAINT_INITIALLY_DEFERRED	 = &H00000020
Const SQL_AD_ADD_CONSTRAINT_INITIALLY_IMMEDIATE	 = &H00000040
Const SQL_AD_ADD_CONSTRAINT_DEFERRABLE			 = &H00000080
Const SQL_AD_ADD_CONSTRAINT_NON_DEFERRABLE		 = &H00000100


/* SQL_CREATE_SCHEMA bitmasks */
Const SQL_CS_CREATE_SCHEMA				 = &H00000001
Const SQL_CS_AUTHORIZATION				 = &H00000002
Const SQL_CS_DEFAULT_CHARACTER_SET		 = &H00000004

/* SQL_CREATE_TRANSLATION bitmasks */
Const SQL_CTR_CREATE_TRANSLATION			 = &H00000001

/* SQL_CREATE_ASSERTION bitmasks */
Const SQL_CA_CREATE_ASSERTION					 = &H00000001
Const SQL_CA_CONSTRAINT_INITIALLY_DEFERRED	 = &H00000010
Const SQL_CA_CONSTRAINT_INITIALLY_IMMEDIATE	 = &H00000020
Const SQL_CA_CONSTRAINT_DEFERRABLE			 = &H00000040
Const SQL_CA_CONSTRAINT_NON_DEFERRABLE		 = &H00000080

/* SQL_CREATE_CHARACTER_SET bitmasks */
Const SQL_CCS_CREATE_CHARACTER_SET		 = &H00000001
Const SQL_CCS_COLLATE_CLAUSE				 = &H00000002
Const SQL_CCS_LIMITED_COLLATION			 = &H00000004

/* SQL_CREATE_COLLATION bitmasks */
Const SQL_CCOL_CREATE_COLLATION			 = &H00000001

/* SQL_CREATE_DOMAIN bitmasks */
Const SQL_CDO_CREATE_DOMAIN					 = &H00000001
Const SQL_CDO_DEFAULT							 = &H00000002
Const SQL_CDO_CONSTRAINT						 = &H00000004
Const SQL_CDO_COLLATION						 = &H00000008
Const SQL_CDO_CONSTRAINT_NAME_DEFINITION		 = &H00000010
Const SQL_CDO_CONSTRAINT_INITIALLY_DEFERRED	 = &H00000020
Const SQL_CDO_CONSTRAINT_INITIALLY_IMMEDIATE	 = &H00000040
Const SQL_CDO_CONSTRAINT_DEFERRABLE			 = &H00000080
Const SQL_CDO_CONSTRAINT_NON_DEFERRABLE		 = &H00000100

/* SQL_CREATE_TABLE bitmasks */
Const SQL_CT_CREATE_TABLE						 = &H00000001
Const SQL_CT_COMMIT_PRESERVE					 = &H00000002
Const SQL_CT_COMMIT_DELETE					 = &H00000004
Const SQL_CT_GLOBAL_TEMPORARY					 = &H00000008
Const SQL_CT_LOCAL_TEMPORARY					 = &H00000010
Const SQL_CT_CONSTRAINT_INITIALLY_DEFERRED	 = &H00000020
Const SQL_CT_CONSTRAINT_INITIALLY_IMMEDIATE	 = &H00000040
Const SQL_CT_CONSTRAINT_DEFERRABLE			 = &H00000080
Const SQL_CT_CONSTRAINT_NON_DEFERRABLE		 = &H00000100
Const SQL_CT_COLUMN_CONSTRAINT				 = &H00000200
Const SQL_CT_COLUMN_DEFAULT					 = &H00000400
Const SQL_CT_COLUMN_COLLATION					 = &H00000800
Const SQL_CT_TABLE_CONSTRAINT					 = &H00001000
Const SQL_CT_CONSTRAINT_NAME_DEFINITION		 = &H00002000

/* SQL_DDL_INDEX bitmasks */
Const SQL_DI_CREATE_INDEX						 = &H00000001
Const SQL_DI_DROP_INDEX						 = &H00000002

/* SQL_DROP_COLLATION bitmasks */
Const SQL_DC_DROP_COLLATION					 = &H00000001

/* SQL_DROP_DOMAIN bitmasks */
Const SQL_DD_DROP_DOMAIN						 = &H00000001
Const SQL_DD_RESTRICT							 = &H00000002
Const SQL_DD_CASCADE							 = &H00000004

/* SQL_DROP_SCHEMA bitmasks */
Const SQL_DS_DROP_SCHEMA						 = &H00000001
Const SQL_DS_RESTRICT							 = &H00000002
Const SQL_DS_CASCADE							 = &H00000004

/* SQL_DROP_CHARACTER_SET bitmasks */
Const SQL_DCS_DROP_CHARACTER_SET				 = &H00000001

/* SQL_DROP_ASSERTION bitmasks */
Const SQL_DA_DROP_ASSERTION					 = &H00000001

/* SQL_DROP_TABLE bitmasks */
Const SQL_DT_DROP_TABLE						 = &H00000001
Const SQL_DT_RESTRICT							 = &H00000002
Const SQL_DT_CASCADE							 = &H00000004

/* SQL_DROP_TRANSLATION bitmasks */
Const SQL_DTR_DROP_TRANSLATION				 = &H00000001

/* SQL_DROP_VIEW bitmasks */
Const SQL_DV_DROP_VIEW						 = &H00000001
Const SQL_DV_RESTRICT							 = &H00000002
Const SQL_DV_CASCADE							 = &H00000004

/* SQL_INSERT_STATEMENT bitmasks */
Const SQL_IS_INSERT_LITERALS					 = &H00000001
Const SQL_IS_INSERT_SEARCHED					 = &H00000002
Const SQL_IS_SELECT_INTO						 = &H00000004

/* SQL_ODBC_INTERFACE_CONFORMANCE values */
Const SQL_OIC_CORE							 = 1
Const SQL_OIC_LEVEL1							 = 2
Const SQL_OIC_LEVEL2							 = 3

/* SQL_SQL92_FOREIGN_KEY_DELETE_RULE bitmasks */
Const SQL_SFKD_CASCADE						 = &H00000001
Const SQL_SFKD_NO_ACTION						 = &H00000002
Const SQL_SFKD_SET_DEFAULT					 = &H00000004
Const SQL_SFKD_SET_NULL						 = &H00000008

/* SQL_SQL92_FOREIGN_KEY_UPDATE_RULE bitmasks */
Const SQL_SFKU_CASCADE						 = &H00000001
Const SQL_SFKU_NO_ACTION						 = &H00000002
Const SQL_SFKU_SET_DEFAULT					 = &H00000004
Const SQL_SFKU_SET_NULL						 = &H00000008

/* SQL_SQL92_GRANT	bitmasks */
Const SQL_SG_USAGE_ON_DOMAIN					 = &H00000001
Const SQL_SG_USAGE_ON_CHARACTER_SET			 = &H00000002
Const SQL_SG_USAGE_ON_COLLATION				 = &H00000004
Const SQL_SG_USAGE_ON_TRANSLATION				 = &H00000008
Const SQL_SG_WITH_GRANT_OPTION				 = &H00000010
Const SQL_SG_DELETE_TABLE						 = &H00000020
Const SQL_SG_INSERT_TABLE						 = &H00000040
Const SQL_SG_INSERT_COLUMN					 = &H00000080
Const SQL_SG_REFERENCES_TABLE					 = &H00000100
Const SQL_SG_REFERENCES_COLUMN				 = &H00000200
Const SQL_SG_SELECT_TABLE						 = &H00000400
Const SQL_SG_UPDATE_TABLE						 = &H00000800
Const SQL_SG_UPDATE_COLUMN					 = &H00001000	

/* SQL_SQL92_PREDICATES bitmasks */
Const SQL_SP_EXISTS							 = &H00000001
Const SQL_SP_ISNOTNULL						 = &H00000002
Const SQL_SP_ISNULL							 = &H00000004
Const SQL_SP_MATCH_FULL						 = &H00000008
Const SQL_SP_MATCH_PARTIAL					 = &H00000010
Const SQL_SP_MATCH_UNIQUE_FULL				 = &H00000020
Const SQL_SP_MATCH_UNIQUE_PARTIAL				 = &H00000040
Const SQL_SP_OVERLAPS							 = &H00000080
Const SQL_SP_UNIQUE							 = &H00000100
Const SQL_SP_LIKE								 = &H00000200
Const SQL_SP_IN								 = &H00000400
Const SQL_SP_BETWEEN							 = &H00000800
Const SQL_SP_COMPARISON						 = &H00001000
Const SQL_SP_QUANTIFIED_COMPARISON			 = &H00002000

/* SQL_SQL92_RELATIONAL_JOIN_OPERATORS bitmasks */
Const SQL_SRJO_CORRESPONDING_CLAUSE			 = &H00000001
Const SQL_SRJO_CROSS_JOIN						 = &H00000002
Const SQL_SRJO_EXCEPT_JOIN					 = &H00000004
Const SQL_SRJO_FULL_OUTER_JOIN				 = &H00000008
Const SQL_SRJO_INNER_JOIN						 = &H00000010
Const SQL_SRJO_INTERSECT_JOIN					 = &H00000020
Const SQL_SRJO_LEFT_OUTER_JOIN				 = &H00000040
Const SQL_SRJO_NATURAL_JOIN					 = &H00000080
Const SQL_SRJO_RIGHT_OUTER_JOIN				 = &H00000100
Const SQL_SRJO_UNION_JOIN						 = &H00000200

/* SQL_SQL92_REVOKE bitmasks */
Const SQL_SR_USAGE_ON_DOMAIN					 = &H00000001
Const SQL_SR_USAGE_ON_CHARACTER_SET			 = &H00000002
Const SQL_SR_USAGE_ON_COLLATION				 = &H00000004
Const SQL_SR_USAGE_ON_TRANSLATION				 = &H00000008
Const SQL_SR_GRANT_OPTION_FOR					 = &H00000010
Const SQL_SR_CASCADE							 = &H00000020
Const SQL_SR_RESTRICT							 = &H00000040
Const SQL_SR_DELETE_TABLE						 = &H00000080
Const SQL_SR_INSERT_TABLE						 = &H00000100
Const SQL_SR_INSERT_COLUMN					 = &H00000200
Const SQL_SR_REFERENCES_TABLE					 = &H00000400
Const SQL_SR_REFERENCES_COLUMN				 = &H00000800
Const SQL_SR_SELECT_TABLE						 = &H00001000
Const SQL_SR_UPDATE_TABLE						 = &H00002000
Const SQL_SR_UPDATE_COLUMN					 = &H00004000

/* SQL_SQL92_ROW_VALUE_CONSTRUCTOR bitmasks */
Const SQL_SRVC_VALUE_EXPRESSION				 = &H00000001
Const SQL_SRVC_NULL							 = &H00000002
Const SQL_SRVC_DEFAULT						 = &H00000004
Const SQL_SRVC_ROW_SUBQUERY					 = &H00000008

/* SQL_SQL92_VALUE_EXPRESSIONS bitmasks */
Const SQL_SVE_CASE							 = &H00000001
Const SQL_SVE_CAST							 = &H00000002
Const SQL_SVE_COALESCE						 = &H00000004
Const SQL_SVE_NULLIF							 = &H00000008

/* SQL_STANDARD_CLI_CONFORMANCE bitmasks */
Const SQL_SCC_XOPEN_CLI_VERSION1				 = &H00000001
Const SQL_SCC_ISO92_CLI						 = &H00000002

/* SQL_UNION_STATEMENT bitmasks */
Const SQL_US_UNION							 = SQL_U_UNION
Const SQL_US_UNION_ALL						 = SQL_U_UNION_ALL



/* SQL_DTC_TRANSITION_COST bitmasks */
Const SQL_DTC_ENLIST_EXPENSIVE				 = &H00000001
Const SQL_DTC_UNENLIST_EXPENSIVE				 = &H00000002

/* additional SQLDataSources fetch directions */
Const SQL_FETCH_FIRST_USER				 = 31
Const SQL_FETCH_FIRST_SYSTEM				 = 32



/* Defines for SQLSetPos */
Const SQL_ENTIRE_ROWSET             = 0

/* Operations in SQLSetPos */
Const SQL_POSITION                  = 0               /*      1.0 FALSE */
Const SQL_REFRESH                   = 1               /*      1.0 TRUE */
Const SQL_UPDATE                    = 2
Const SQL_DELETE                    = 3

/* Operations in SQLBulkOperations */
Const SQL_ADD                       = 4
Const SQL_SETPOS_MAX_OPTION_VALUE			 = SQL_ADD
Const SQL_UPDATE_BY_BOOKMARK		  = 5
Const SQL_DELETE_BY_BOOKMARK		  = 6
Const SQL_FETCH_BY_BOOKMARK		  = 7


/* Lock options in SQLSetPos */
Const SQL_LOCK_NO_CHANGE            = 0               /*      1.0 FALSE */
Const SQL_LOCK_EXCLUSIVE            = 1               /*      1.0 TRUE */
Const SQL_LOCK_UNLOCK               = 2

Const SQL_SETPOS_MAX_LOCK_VALUE		 = SQL_LOCK_UNLOCK

/* 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)

/* Column types and scopes in SQLSpecialColumns.  */
Const SQL_BEST_ROWID                   = 1
Const SQL_ROWVER                       = 2

/* Defines for SQLSpecialColumns (returned in the result set) 
   SQL_PC_UNKNOWN and SQL_PC_PSEUDO are defined in sql.h */
Const SQL_PC_NOT_PSEUDO                = 1

/* Defines for SQLStatistics */
Const SQL_QUICK                        = 0
Const SQL_ENSURE                       = 1

/* Defines for SQLStatistics (returned in the result set) 
   SQL_INDEX_CLUSTERED, SQL_INDEX_HASHED, and SQL_INDEX_OTHER are
   defined in sql.h */
Const SQL_TABLE_STAT                   = 0


/* Defines for SQLTables */
Const SQL_ALL_CATALOGS				 = "%"
Const SQL_ALL_SCHEMAS					 = "%"
Const SQL_ALL_TABLE_TYPES				 = "%"


/* Options for SQLDriverConnect */
Const SQL_DRIVER_NOPROMPT              = 0
Const SQL_DRIVER_COMPLETE              = 1
Const SQL_DRIVER_PROMPT                = 2
Const SQL_DRIVER_COMPLETE_REQUIRED     = 3


Declare Function SQLDriverConnect Lib "odbc32.dll" (
    hdbc As SQLHDBC,
    hwnd As HWND,
    szConnStrIn As *SQLCHAR,
    cbConnStrIn As SQLSMALLINT,
    szConnStrOut As *SQLCHAR,
    cbConnStrOutMax As SQLSMALLINT,
    ByRef pcbConnStrOut As SQLSMALLINT,
    fDriverCompletion As SQLUSMALLINT) As SQLRETURN


/* Level 2 Functions                             */

/* SQLExtendedFetch "fFetchType" values */
Const SQL_FETCH_BOOKMARK                = 8

/* SQLExtendedFetch "rgfRowStatus" element values */
Const SQL_ROW_SUCCESS                   = 0
Const SQL_ROW_DELETED                   = 1
Const SQL_ROW_UPDATED                   = 2
Const SQL_ROW_NOROW                     = 3
Const SQL_ROW_ADDED                     = 4
Const SQL_ROW_ERROR                     = 5
Const SQL_ROW_SUCCESS_WITH_INFO		  = 6
Const SQL_ROW_PROCEED					  = 0
Const SQL_ROW_IGNORE					  = 1

/* value for SQL_DESC_ARRAY_STATUS_PTR */
Const SQL_PARAM_SUCCESS				 = 0
Const SQL_PARAM_SUCCESS_WITH_INFO		 = 6
Const SQL_PARAM_ERROR					 = 5
Const SQL_PARAM_UNUSED				 = 7
Const SQL_PARAM_DIAG_UNAVAILABLE		 = 1

Const SQL_PARAM_PROCEED				 = 0
Const SQL_PARAM_IGNORE				 = 1


/* Defines for SQLForeignKeys (UPDATE_RULE and DELETE_RULE) */
Const SQL_CASCADE                       = 0
Const SQL_RESTRICT                      = 1
Const SQL_SET_NULL                      = 2
Const SQL_NO_ACTION			  = 3
Const SQL_SET_DEFAULT			  = 4

/* Note that the following are in a different column of SQLForeignKeys than */
/* the previous #defines.   These are for DEFERRABILITY.                    */

Const SQL_INITIALLY_DEFERRED			 = 5
Const SQL_INITIALLY_IMMEDIATE			 = 6
Const SQL_NOT_DEFERRABLE			 = 7


/* Defines for SQLProcedures (returned in the result set) */
Const SQL_PT_UNKNOWN                    = 0
Const SQL_PT_PROCEDURE                  = 1
Const SQL_PT_FUNCTION                   = 2


Declare Function SQLBrowseConnect Lib "odbc32.dll" (
    hdbc As SQLHDBC,
    szConnStrIn As *SQLCHAR,
    cbConnStrIn As SQLSMALLINT,
    szConnStrOut As *SQLCHAR,
    cbConnStrOutMax As SQLSMALLINT,
    ByRef pcbConnStrOut As SQLSMALLINT) As SQLRETURN

Declare Function SQLBulkOperations Lib "odbc32.dll" (
	StatementHandle As SQLHSTMT,
	Operation As SQLSMALLINT) As SQLRETURN


Declare Function SQLColAttributes Lib "odbc32.dll" (
    hstmt As SQLHSTMT,
    icol As SQLUSMALLINT,
    fDescType As SQLUSMALLINT,
    rgbDesc As SQLPOINTER,
    cbDescMax As SQLSMALLINT,
    ByRef cbDesc As SQLSMALLINT,
    ByRef fDesc As SQLLEN) As SQLRETURN

Declare Function SQLColumnPrivileges Lib "odbc32.dll" (
    hstmt As SQLHSTMT,
    szCatalogName As *SQLCHAR,
    cbCatalogName As SQLSMALLINT,
    szSchemaName As *SQLCHAR,
    cbSchemaName As SQLSMALLINT,
    szTableName As *SQLCHAR,
    cbTableName As SQLSMALLINT,
    szColumnName As *SQLCHAR,
    cbColumnName As SQLSMALLINT) As SQLRETURN

Declare Function SQLDescribeParam Lib "odbc32.dll" (
    hstmt As SQLHSTMT,
    ipar As SQLUSMALLINT,
    pfSqlType As *SQLSMALLINT,
    pcbParamDef As *SQLULEN,
    pibScale As *SQLSMALLINT,
    pfNullable As *SQLSMALLINT) As SQLRETURN

Declare Function SQLExtendedFetch Lib "odbc32.dll" (
    hstmt As SQLHSTMT,
    fFetchType As SQLUSMALLINT,
    irow As SQLLEN,
    pcrow As *SQLULEN,
    rgfRowStatus As *SQLUSMALLINT) As SQLRETURN

Declare Function SQLForeignKeys Lib "odbc32.dll" (
    hstmt As SQLHSTMT,
    szPkCatalogName As *SQLCHAR,
    cbPkCatalogName As SQLSMALLINT,
    szPkSchemaName As *SQLCHAR,
    cbPkSchemaName As SQLSMALLINT,
    szPkTableName As *SQLCHAR,
    cbPkTableName As SQLSMALLINT,
    szFkCatalogName As *SQLCHAR,
    cbFkCatalogName As SQLSMALLINT,
    szFkSchemaName As *SQLCHAR,
    cbFkSchemaName As SQLSMALLINT,
    szFkTableName As *SQLCHAR,
    cbFkTableName As SQLSMALLINT) As SQLRETURN

Declare Function SQLMoreResults Lib "odbc32.dll" (
    hstmt As SQLHSTMT) As SQLRETURN

Declare Function SQLNativeSql Lib "odbc32.dll" (
    hdbc As SQLHDBC,
    szSqlStrIn As *SQLCHAR,
    cbSqlStrIn As SQLINTEGER,
    szSqlStr As *SQLCHAR,
    cbSqlStrMax As SQLINTEGER,
    pcbSqlStr As *SQLINTEGER) As SQLRETURN

Declare Function SQLNumParams Lib "odbc32.dll" (
    hstmt As SQLHSTMT,
    pcpar As *SQLSMALLINT) As SQLRETURN

Declare Function SQLParamOptions Lib "odbc32.dll" (
    hstmt As SQLHSTMT,
    crow As SQLULEN,
    pirow As *SQLULEN) As SQLRETURN

Declare Function SQLPrimaryKeys Lib "odbc32.dll" (
    hstmt As SQLHSTMT,
    szCatalogName As *SQLCHAR,
    cbCatalogName As SQLSMALLINT,
    szSchemaName As *SQLCHAR,
    cbSchemaName As SQLSMALLINT,
    szTableName As *SQLCHAR,
    cbTableName As SQLSMALLINT) As SQLRETURN

Declare Function SQLProcedureColumns Lib "odbc32.dll" (
    hstmt As SQLHSTMT,
    szCatalogName As *SQLCHAR,
    cbCatalogName As SQLSMALLINT,
    szSchemaName As *SQLCHAR,
    cbSchemaName As SQLSMALLINT,
    szProcName As *SQLCHAR,
    cbProcName As SQLSMALLINT,
    szColumnName As *SQLCHAR,
    cbColumnName As SQLSMALLINT) As SQLRETURN

Declare Function SQLProcedures Lib "odbc32.dll" (
    hstmt As SQLHSTMT,
    szCatalogName As *SQLCHAR,
    cbCatalogName As SQLSMALLINT,
    szSchemaName As *SQLCHAR,
    cbSchemaName As SQLSMALLINT,
    szProcName As *SQLCHAR,
    cbProcName As SQLSMALLINT) As SQLRETURN



Declare Function SQLSetPos Lib "odbc32.dll" (
    hstmt As SQLHSTMT,
    irow As SQLSETPOSIROW,
    fOption As SQLUSMALLINT,
    fLock As SQLUSMALLINT) As SQLRETURN

Declare Function SQLTablePrivileges Lib "odbc32.dll" (
    hstmt As SQLHSTMT,
    szCatalogName As *SQLCHAR,
    cbCatalogName As SQLSMALLINT,
    szSchemaName As *SQLCHAR,
    cbSchemaName As SQLSMALLINT,
    szTableName As *SQLCHAR,
    cbTableName As SQLSMALLINT) As SQLRETURN

Declare Function SQLDrivers Lib "odbc32.dll" (
    henv As SQLHENV,
    fDirection As SQLUSMALLINT,
    szDriverDesc As *SQLCHAR,
    cbDriverDescMax As SQLSMALLINT,
    pcbDriverDesc As *SQLSMALLINT,
    szDriverAttributes As *SQLCHAR,
    cbDrvrAttrMax As SQLSMALLINT,
    pcbDrvrAttr As *SQLSMALLINT) As SQLRETURN

Declare Function SQLBindParameter Lib "odbc32.dll" (
    hstmt As SQLHSTMT,
    ipar As SQLUSMALLINT,
    fParamType As SQLSMALLINT,
    fCType As SQLSMALLINT,
    fSqlType As SQLSMALLINT,
    cbColDef As SQLULEN,
    ibScale As SQLSMALLINT,
    rgbValue As SQLPOINTER,
    cbValueMax As SQLLEN,
    pcbValue As *SQLLEN) As SQLRETURN





Declare Function SQLAllocHandleStd Lib "odbc32.dll" (
	fHandleType As SQLSMALLINT,
	hInput As SQLHANDLE,
	phOutput As *SQLHANDLE) As SQLRETURN

/*      Deprecated defines from prior versions of ODBC */
Const SQL_DATABASE_NAME                = 16    /* Use SQLGetConnectOption/SQL_CURRENT_QUALIFIER */
Const SQL_FD_FETCH_PREV                = SQL_FD_FETCH_PRIOR
Const SQL_FETCH_PREV                   = SQL_FETCH_PRIOR
Const SQL_CONCUR_TIMESTAMP             = SQL_CONCUR_ROWVER
Const SQL_SCCO_OPT_TIMESTAMP           = SQL_SCCO_OPT_ROWVER
Const SQL_CC_DELETE                    = SQL_CB_DELETE
Const SQL_CR_DELETE                    = SQL_CB_DELETE
Const SQL_CC_CLOSE                     = SQL_CB_CLOSE
Const SQL_CR_CLOSE                     = SQL_CB_CLOSE
Const SQL_CC_PRESERVE                  = SQL_CB_PRESERVE
Const SQL_CR_PRESERVE                  = SQL_CB_PRESERVE
/* SQL_FETCH_RESUME is not supported by 2.0+ drivers 
Const SQL_FETCH_RESUME                 = 7    
*/
Const SQL_SCROLL_FORWARD_ONLY          = 0    /*-SQL_CURSOR_FORWARD_ONLY */
Const SQL_SCROLL_KEYSET_DRIVEN         = (-1) /*-SQL_CURSOR_KEYSET_DRIVEN */
Const SQL_SCROLL_DYNAMIC               = (-2) /*-SQL_CURSOR_DYNAMIC */
Const SQL_SCROLL_STATIC                = (-3) /*-SQL_CURSOR_STATIC */


Declare Function SQLSetScrollOptions Lib "odbc32.dll" (    /*      Use SQLSetStmtOptions */
    hstmt As SQLHSTMT,
    fConcurrency As SQLUSMALLINT,
    crowKeyset As SQLLEN,
    crowRowset As SQLUSMALLINT) As SQLRETURN

			

/* Functions for setting the connection pooling failure detection code */
/* The "TryWait" value is the time (in seconds) that the DM will wait  */
/* between detecting that a connection is dead (using                  */
/* SQL_ATTR_CONNECTION_DEAD) and retrying the connection.  During that */
/* interval, connection requests will get "The server appears to be    */
/* dead" error returns.                                                */ 


Declare Function ODBCSetTryWaitValue Lib "odbc32.dll" (dwValue As DWORD) As BOOL	/* In seconds */
Declare Function ODBCGetTryWaitValue Lib "odbc32.dll" () As DWord			/* In Milliseconds(!) */


/* the flags in ODBC_VS_ARGS */
Const ODBC_VS_FLAG_UNICODE_ARG	 = &H00000001	/* the argument is unicode */
Const ODBC_VS_FLAG_UNICODE_COR	 = &H00000002	/* the correlation is unicode */
Const ODBC_VS_FLAG_RETCODE		 = &H00000004	/* RetCode field is set */
Const ODBC_VS_FLAG_STOP		 = &H00000008	/* Stop firing visual studio analyzer events */

TypeDef RETCODE = Integer
Type ODBC_VS_ARGS
	pguidEvent As *GUID
	dwFlags As DWord
	'Union
		'wszArg As *WCHAR
		szArg As LPSTR
	'End Union
	'Union
		'wszCorrelation As *WCHAR
		szCorrelation As LPSTR
	'End Union
	RetCode As RETCODE
End Type


#endif /* _INC_SQLEXT */
