1186 lines
39 KiB
C
1186 lines
39 KiB
C
|
#ifndef UCI_H
|
||
|
#define UCI_H
|
||
|
/******************************************************************************
|
||
|
*
|
||
|
* Header file for UCI (Universe Call Interface)
|
||
|
*
|
||
|
* Module %M% Version %I% Date %H%
|
||
|
*
|
||
|
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
|
||
|
* This is unpublished proprietary source code of Ardent Software Inc.
|
||
|
* The copyright notice above does not evidence any actual or intented
|
||
|
* publication of such source code.
|
||
|
*
|
||
|
*******************************************************************************
|
||
|
*
|
||
|
* Maintenence log - insert most recent change descriptions at top
|
||
|
*
|
||
|
* Date.... GTAR# WHO Description.........................................
|
||
|
* 03/30/99 24764 CSM Add internl conn optn for licensing Ardent UCI applns
|
||
|
* 03/25/99 24411 JBG Add SQLParamOptions
|
||
|
* 03/02/99 24554 CSM Add wide data types for SQL Server 7 catalog funcs
|
||
|
* 03/02/99 24605 CSM Jun Zhang changes for OLEDB support
|
||
|
* 02/12/99 24502 CSM Add SQL_FETCH_FIRST,NEXT,SQL_USE_* for OLEDB
|
||
|
* 11/19/98 24000 CSM Add internal connect options for licensing UVODBC
|
||
|
* 10/14/98 23801 SAP Change copyrights.
|
||
|
* 10/02/98 23765 CSM Add dev subkey option to SetConnectOption for license
|
||
|
* 04/28/98 22967 CSM Add SQLNumParams for UCI
|
||
|
* 07/08/97 21049 AGM Add SQL_MAX_DSN_LENGTH for DataStage
|
||
|
* 06/19/97 20748 MJC Add SQL_UVNLS_LOCALE for SQLSetConnectOption
|
||
|
* 06/04/97 20748 MJC Improve Map/Locale
|
||
|
* 06/04/97 20748 MJC Add Mark characters
|
||
|
* 06/03/97 20748 MJC Add Map/Locale
|
||
|
* 10/30/96 19512 ENF SQLParamOptions changes
|
||
|
* 08/08/96 18994 ENF Add SQL_EMPTY_NULL and SQL_TX_PRIVATE
|
||
|
* 08/05/96 18854 ENF Use __SQL to determine stand-alone-ness
|
||
|
* 08/05/96 18854 PEJ Recode AUTOCOMMIT definitions for HPUX 9 compiler
|
||
|
* 08/01/96 18854 ENF Define AUTOCOMMIT optios for SetConnectOptions
|
||
|
* 08/01/96 18854 ENF Declare SetConnectOptions for real ODBC calls
|
||
|
* 07/26/96 18854 ENF Fix redefinitions of SQL_NULL stuff for UCI calls
|
||
|
* 07/25/96 18758 MJC Add UCI/SQL_COLUMN_PRINT_RESULT as 1004
|
||
|
* 07/24/96 18854 ENF Add SQLBindParameter() for Windows
|
||
|
* 07/23/96 18854 ENF Add SQL_TIMESTAMP_PRECISION
|
||
|
* 07/23/96 18854 ENF Move definition of 'signed' before its use
|
||
|
* 07/23/96 18854 DTM Changes for ODBC middleware project
|
||
|
* 07/23/96 18854 ENF Fix definition of SQL_NULL HENV,HDBC,HSTMT
|
||
|
* 07/22/96 18854 ENF Changes for ODBC middleware project
|
||
|
* 06/06/96 18162 ENF Add code for truncated parameter marker
|
||
|
* 04/01/96 18162 ENF Add OUTPUT, INPUT_OUTPUT parameter definitions
|
||
|
* 08/24/95 17197 AGM Initial changes for Windows 95
|
||
|
* 07/28/95 16490 RM Port SGI
|
||
|
* 06/14/95 15871 RM Added SQLGetInfo stuff from sqlext.h
|
||
|
* 05/31/95 16466 FRA Port SGI
|
||
|
* 05/19/95 16489 FRA Port to IBM RS6000
|
||
|
* 05/09/95 16358 AGM Don't define ULONG on NT as it's already defined!
|
||
|
* 03/08/95 15871 RM Added UCI_DATUM, C_ARRAY structures
|
||
|
* 02/09/95 15871 ENF Add constants for GetFunctions
|
||
|
* 01/31/95 15871 ENF Initial submission
|
||
|
*
|
||
|
*****************************************************************************/
|
||
|
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
extern "C" { /* Assume C declarations for C++ */
|
||
|
#endif /* __cplusplus */
|
||
|
|
||
|
|
||
|
#ifdef UV
|
||
|
#define PRI_RO
|
||
|
#define PUB_RO
|
||
|
#undef Rmalloc
|
||
|
#undef Rcalloc
|
||
|
#undef Rfree
|
||
|
#undef MMAP
|
||
|
#undef Ienable
|
||
|
#undef Idisable
|
||
|
#endif
|
||
|
|
||
|
/* SQL portable types for C */
|
||
|
#define signed
|
||
|
typedef int SDWORD;
|
||
|
typedef unsigned int UDWORD;
|
||
|
typedef signed int SLONG;
|
||
|
|
||
|
#ifndef __SQL
|
||
|
typedef int RETCODE;
|
||
|
#else
|
||
|
typedef signed short RETCODE;
|
||
|
#endif
|
||
|
|
||
|
typedef int UCIRETCODE;
|
||
|
|
||
|
typedef unsigned char UCHAR;
|
||
|
typedef signed char SCHAR;
|
||
|
typedef short int SWORD;
|
||
|
typedef unsigned short int UWORD;
|
||
|
typedef signed short SSHORT;
|
||
|
typedef unsigned short USHORT;
|
||
|
typedef double SDOUBLE;
|
||
|
typedef void * PTR;
|
||
|
|
||
|
typedef void * HENV;
|
||
|
typedef void * HDBC;
|
||
|
typedef void * HSTMT;
|
||
|
|
||
|
|
||
|
#ifndef h_typedef
|
||
|
typedef struct tagSTRING
|
||
|
{
|
||
|
UDWORD len;
|
||
|
UCHAR *text;
|
||
|
} STRING;
|
||
|
#endif
|
||
|
|
||
|
typedef struct tagDATE_STRUCT
|
||
|
{
|
||
|
SWORD year;
|
||
|
UWORD month;
|
||
|
UWORD day;
|
||
|
} DATE_STRUCT;
|
||
|
|
||
|
typedef struct tagTIME_STRUCT
|
||
|
{
|
||
|
UWORD hour;
|
||
|
UWORD minute;
|
||
|
UWORD second;
|
||
|
} TIME_STRUCT;
|
||
|
|
||
|
typedef struct tagUCI_DATUM
|
||
|
{
|
||
|
SDWORD fIndicator;
|
||
|
union
|
||
|
{
|
||
|
double dbl;
|
||
|
float flt;
|
||
|
SCHAR sbyte;
|
||
|
UCHAR ubyte;
|
||
|
SWORD sword;
|
||
|
UWORD uword;
|
||
|
SDWORD sdword;
|
||
|
UDWORD udword;
|
||
|
STRING string;
|
||
|
DATE_STRUCT date;
|
||
|
TIME_STRUCT time;
|
||
|
} uValue;
|
||
|
} UCI_DATUM;
|
||
|
|
||
|
typedef struct tagC_ARRAY
|
||
|
{
|
||
|
UWORD cDcount;
|
||
|
UWORD cStorage;
|
||
|
SWORD fCType;
|
||
|
SWORD fSqlType;
|
||
|
SWORD fParamType;
|
||
|
SWORD ibScale;
|
||
|
UDWORD cbColDef;
|
||
|
UCI_DATUM Data[1];
|
||
|
} C_ARRAY;
|
||
|
|
||
|
/* start macros for uci_convert */
|
||
|
#ifndef UDWORD_MAX
|
||
|
#define UDWORD_MAX ((UDWORD) (~0))
|
||
|
#endif
|
||
|
#ifndef SDWORD_MAX
|
||
|
#define SDWORD_MAX ((SDWORD) (UDWORD_MAX >> 1))
|
||
|
#endif
|
||
|
#ifndef SDWORD_MIN
|
||
|
#define SDWORD_MIN ((SDWORD) (-SDWORD_MAX -1))
|
||
|
#endif
|
||
|
#ifndef UWORD_MAX
|
||
|
#define UWORD_MAX ((UWORD) (~0))
|
||
|
#endif
|
||
|
#ifndef SWORD_MAX
|
||
|
#define SWORD_MAX ((SWORD) (UWORD_MAX >> 1))
|
||
|
#endif
|
||
|
#ifndef SWORD_MIN
|
||
|
#define SWORD_MIN ((SWORD) (-SWORD_MAX -1))
|
||
|
#endif
|
||
|
#ifndef UCHAR_MAX
|
||
|
#define UCHAR_MAX ((UCHAR) (~0))
|
||
|
#endif
|
||
|
#ifndef SCHAR_MAX
|
||
|
#define SCHAR_MAX ((SCHAR) (UCHAR_MAX >> 1))
|
||
|
#endif
|
||
|
#ifndef SCHAR_MIN
|
||
|
#define SCHAR_MIN ((SCHAR) (-SCHAR_MAX -1))
|
||
|
#endif
|
||
|
|
||
|
#ifndef FLOAT_PRECISION
|
||
|
#define FLOAT_PRECISION 15
|
||
|
#endif
|
||
|
|
||
|
#ifndef DBL_DIG
|
||
|
#define DBL_DIG FLOAT_PRECISION
|
||
|
#endif
|
||
|
#ifndef FLT_DIG
|
||
|
#define FLT_DIG 6
|
||
|
#endif
|
||
|
#ifndef MAX_FLT
|
||
|
#define MAX_FLT 3.402823466e+38 /* for 80x87 chip! */
|
||
|
#endif
|
||
|
#ifndef MIN_FLT
|
||
|
#define MIN_FLT 1.175494351e-38 /* for 80x87 chip! */
|
||
|
#endif
|
||
|
|
||
|
#define MAX_DATE 2933628 /* 31 Dec 9999 */
|
||
|
#define MIN_DATE -718432 /* 01 Jan 0001 */
|
||
|
#define MAX_TIME 60*60*24-1
|
||
|
#define MIN_TIME 0
|
||
|
|
||
|
#define True 1
|
||
|
#define False 0
|
||
|
#define NUMODBMSG 100
|
||
|
#ifndef SQLNUL
|
||
|
#define SQLNUL (UCHAR)'\200'
|
||
|
#endif
|
||
|
#define ISSQLNULL(s) (((s).len == 1) && ((s).text[0] == SQLNUL))
|
||
|
/* end macros for uci_convert */
|
||
|
|
||
|
/***********************************
|
||
|
* SQL Error RETCODES and defines.
|
||
|
**********************************/
|
||
|
|
||
|
#define SQL_ERROR -1
|
||
|
#define SQL_INVALID_HANDLE -2
|
||
|
#define SQL_NTS (-3)
|
||
|
#define SQL_NEED_DATA 99
|
||
|
#define SQL_NO_DATA_FOUND 100
|
||
|
#define SQL_SUCCESS 0
|
||
|
#define SQL_SUCCESS_WITH_INFO 1
|
||
|
|
||
|
#define SQL_MAX_DSN_LENGTH 32
|
||
|
|
||
|
/* The UCI definitions for NULL variables */
|
||
|
#define UCI_NULL_HENV -1
|
||
|
#define UCI_NULL_HDBC -1
|
||
|
#define UCI_NULL_HSTMT -1
|
||
|
#define UCI_NULL_DATA -1
|
||
|
|
||
|
/* The REAL ODBC defintions for null variables */
|
||
|
#ifdef __SQL
|
||
|
#define SQL_NULL_HENV 0
|
||
|
#define SQL_NULL_HDBC 0
|
||
|
#define SQL_NULL_HSTMT 0
|
||
|
#define SQL_NULL_DATA -1
|
||
|
#else
|
||
|
#define SQL_NULL_HENV UCI_NULL_HENV
|
||
|
#define SQL_NULL_HDBC UCI_NULL_HDBC
|
||
|
#define SQL_NULL_HSTMT UCI_NULL_HSTMT
|
||
|
#define SQL_NULL_DATA UCI_NULL_DATA
|
||
|
#endif /* __SQL */
|
||
|
|
||
|
#define SQL_BAD_DATA -2
|
||
|
#define SQL_TRUNCATED_PARAM_DATA -999
|
||
|
|
||
|
/******************************
|
||
|
* uniVerse additions for
|
||
|
* SQLBindParameter
|
||
|
******************************/
|
||
|
#define SQL_UV_DEFAULT_PARAMETER 0
|
||
|
#define SQL_PARAM_INPUT 1
|
||
|
#define SQL_PARAM_INPUT_OUTPUT 2
|
||
|
#define SQL_PARAM_OUTPUT 4
|
||
|
|
||
|
/******************************
|
||
|
* SQLColAttributes defines
|
||
|
******************************/
|
||
|
#define UCI_COLUMN_COUNT 1
|
||
|
#define UCI_COLUMN_NAME 2
|
||
|
#define UCI_COLUMN_TYPE 3
|
||
|
#define UCI_COLUMN_LENGTH 4
|
||
|
#define UCI_COLUMN_PRECISION 5
|
||
|
#define UCI_COLUMN_SCALE 6
|
||
|
#define UCI_COLUMN_DISPLAY_SIZE 7
|
||
|
#define UCI_COLUMN_NULLABLE 8
|
||
|
#define UCI_COLUMN_UNSIGNED 9
|
||
|
#define UCI_COLUMN_MONEY 10
|
||
|
#define UCI_COLUMN_UPDATABLE 11
|
||
|
#define UCI_COLUMN_AUTO_INCREMENT 12
|
||
|
#define UCI_COLUMN_CASE_SENSITIVE 13
|
||
|
#define UCI_COLUMN_SEARCHABLE 14
|
||
|
#define UCI_COLUMN_TYPE_NAME 15
|
||
|
#define UCI_COLUMN_TABLE_NAME 16
|
||
|
#define UCI_COLUMN_OWNER_NAME 17
|
||
|
#define UCI_COLUMN_QUALIFIER_NAME 18
|
||
|
#define UCI_COLUMN_LABEL 19
|
||
|
|
||
|
#ifndef __SQL
|
||
|
#define SQL_COLUMN_COUNT UCI_COLUMN_COUNT
|
||
|
#define SQL_COLUMN_NAME UCI_COLUMN_NAME
|
||
|
#define SQL_COLUMN_TYPE UCI_COLUMN_TYPE
|
||
|
#define SQL_COLUMN_LENGTH UCI_COLUMN_LENGTH
|
||
|
#define SQL_COLUMN_PRECISION UCI_COLUMN_PRECISION
|
||
|
#define SQL_COLUMN_SCALE UCI_COLUMN_SCALE
|
||
|
#define SQL_COLUMN_DISPLAY_SIZE UCI_COLUMN_DISPLAY_SIZE
|
||
|
#define SQL_COLUMN_NULLABLE UCI_COLUMN_NULLABLE
|
||
|
#define SQL_COLUMN_UNSIGNED UCI_COLUMN_UNSIGNED
|
||
|
#define SQL_COLUMN_MONEY UCI_COLUMN_MONEY
|
||
|
#define SQL_COLUMN_UPDATABLE UCI_COLUMN_UPDATABLE
|
||
|
#define SQL_COLUMN_AUTO_INCREMENT UCI_COLUMN_AUTO_INCREMENT
|
||
|
#define SQL_COLUMN_CASE_SENSITIVE UCI_COLUMN_CASE_SENSITIVE
|
||
|
#define SQL_COLUMN_SEARCHABLE UCI_COLUMN_SEARCHABLE
|
||
|
#define SQL_COLUMN_TYPE_NAME UCI_COLUMN_TYPE_NAME
|
||
|
#define SQL_COLUMN_TABLE_NAME UCI_COLUMN_TABLE_NAME
|
||
|
#define SQL_COLUMN_OWNER_NAME UCI_COLUMN_OWNER_NAME
|
||
|
#define SQL_COLUMN_QUALIFIER_NAME UCI_COLUMN_QUALIFIER_NAME
|
||
|
#define SQL_COLUMN_LABEL UCI_COLUMN_LABEL
|
||
|
#else
|
||
|
#define SQL_COLUMN_COUNT 0
|
||
|
#define SQL_COLUMN_NAME 1
|
||
|
#define SQL_COLUMN_TYPE 2
|
||
|
#define SQL_COLUMN_LENGTH 3
|
||
|
#define SQL_COLUMN_PRECISION 4
|
||
|
#define SQL_COLUMN_SCALE 5
|
||
|
#define SQL_COLUMN_DISPLAY_SIZE 6
|
||
|
#define SQL_COLUMN_NULLABLE 7
|
||
|
#define SQL_COLUMN_UNSIGNED 8
|
||
|
#define SQL_COLUMN_MONEY 9
|
||
|
#define SQL_COLUMN_UPDATABLE 10
|
||
|
#define SQL_COLUMN_AUTO_INCREMENT 11
|
||
|
#define SQL_COLUMN_CASE_SENSITIVE 12
|
||
|
#define SQL_COLUMN_SEARCHABLE 13
|
||
|
#define SQL_COLUMN_TYPE_NAME 14
|
||
|
#define SQL_COLUMN_TABLE_NAME 15
|
||
|
#define SQL_COLUMN_OWNER_NAME 16
|
||
|
#define SQL_COLUMN_QUALIFIER_NAME 17
|
||
|
#define SQL_COLUMN_LABEL 18
|
||
|
#endif /* __SQL */
|
||
|
|
||
|
/* SQLColAttributes subdefines for SQL_COLUMN_UPDATABLE */
|
||
|
#define SQL_ATTR_READONLY 0
|
||
|
#define SQL_ATTR_WRITE 1
|
||
|
#define SQL_ATTR_READWRITE_UNKNOWN 2
|
||
|
|
||
|
/* SQLColAttributes subdefines for SQL_COLUMN_SEARCHABLE */
|
||
|
|
||
|
#define SQL_UNSEARCHABLE 0
|
||
|
#define SQL_LIKE_ONLY 1
|
||
|
#define SQL_ALL_EXCEPT_LIKE 2
|
||
|
#define SQL_SEARCHABLE 3
|
||
|
|
||
|
|
||
|
#define UCI_COLUMN_MULTI_VALUED 1001
|
||
|
#define UCI_COLUMN_FORMAT 1002
|
||
|
#define UCI_COLUMN_CONVERSION 1003
|
||
|
#define UCI_COLUMN_PRINT_RESULT 1004
|
||
|
|
||
|
#define SQL_COLUMN_MULTI_VALUED UCI_COLUMN_MULTI_VALUED
|
||
|
#define SQL_COLUMN_FORMAT UCI_COLUMN_FORMAT
|
||
|
#define SQL_COLUMN_CONVERSION UCI_COLUMN_CONVERSION
|
||
|
#define SQL_COLUMN_PRINT_RESULT UCI_COLUMN_PRINT_RESULT
|
||
|
|
||
|
/******************************
|
||
|
* SQLDataSources defines
|
||
|
******************************/
|
||
|
#define SQL_FETCH_FIRST 0L
|
||
|
#define SQL_FETCH_NEXT 1L
|
||
|
|
||
|
/******************************
|
||
|
* SQLUseCfgFile defines
|
||
|
******************************/
|
||
|
#define SQL_USE_REGISTRY 0L
|
||
|
#define SQL_USE_FILE 1L
|
||
|
|
||
|
/******************************
|
||
|
* SQLSetConnectOption defines
|
||
|
******************************/
|
||
|
#define SQL_ACCESS_MODE 101
|
||
|
#define SQL_AUTOCOMMIT 102
|
||
|
#define SQL_TXN_ISOLATION 108
|
||
|
|
||
|
#define SQL_MODE_READ_WRITE 0UL
|
||
|
#define SQL_MODE_READ_ONLY 1UL
|
||
|
|
||
|
/* SQL_AUTOCOMMIT options */
|
||
|
|
||
|
#ifdef HPUX90
|
||
|
#define SQL_AUTOCOMMIT_OFF 0L
|
||
|
#define SQL_AUTOCOMMIT_ON 1L
|
||
|
#else
|
||
|
#define SQL_AUTOCOMMIT_OFF 0UL
|
||
|
#define SQL_AUTOCOMMIT_ON 1UL
|
||
|
#endif
|
||
|
|
||
|
#define SQL_AUTOCOMMIT_DEFAULT SQL_AUTOCOMMIT_ON
|
||
|
|
||
|
/* These are defined specifically for use with the BASIC versions */
|
||
|
#define SQL_USE_ODBC_PRECISION 999
|
||
|
#define SQL_TRUNC_ROUND 998
|
||
|
#define SQL_SEND_TRUNC_ROUND 997
|
||
|
#define SQL_OS_UID 996
|
||
|
#define SQL_OS_PWD 995
|
||
|
#define SQL_DATEFORM 994
|
||
|
#define SQL_DATEPREC 993
|
||
|
|
||
|
/* uniVerse options for SQLSetConnectOption/SQLGetConnectOption */
|
||
|
#define SQL_MAX_ROWSIZE 1001
|
||
|
#define SQL_DATA_MODEL 1002
|
||
|
|
||
|
#define SQL_1NF_MODE_ON 1
|
||
|
#define SQL_1NF_MODE_OFF 0
|
||
|
|
||
|
#define SQL_EMPTY_NULL 1003
|
||
|
#define SQL_EMPTY_NULL_ON 1
|
||
|
#define SQL_EMPTY_NULL_OFF 0
|
||
|
|
||
|
#define SQL_TX_PRIVATE 1004
|
||
|
#define SQL_TX_PRIVATE_ON 1
|
||
|
#define SQL_TX_PRIVATE_OFF 0
|
||
|
|
||
|
#define SQL_UVNLS_MAP 1005
|
||
|
#define SQL_UVNLS_LOCALE 1006
|
||
|
#define SQL_UVNLS_LC_TIME 1007
|
||
|
#define SQL_UVNLS_LC_NUMERIC 1008
|
||
|
#define SQL_UVNLS_LC_MONETARY 1009
|
||
|
#define SQL_UVNLS_LC_CTYPE 1010
|
||
|
#define SQL_UVNLS_LC_COLLATE 1011
|
||
|
#define SQL_UVNLS_LC_ALL 1012
|
||
|
|
||
|
#define SQL_UVNLS_SQL_NULL 1013
|
||
|
#define SQL_UVNLS_TEXT_MARK 1014
|
||
|
#define SQL_UVNLS_SUBVALUE_MARK 1015
|
||
|
#define SQL_UVNLS_VALUE_MARK 1016
|
||
|
#define SQL_UVNLS_FIELD_MARK 1017
|
||
|
#define SQL_UVNLS_ITEM_MARK 1018
|
||
|
|
||
|
#define SQL_LIC_DEV_SUBKEY 1019 /* Licensing device sub-key */
|
||
|
#define SQL_INTERNAL1 1020
|
||
|
#define SQL_INTERNAL2 1021
|
||
|
|
||
|
#define MAXSUBKEYLEN 24
|
||
|
#define MINMDILEN 37
|
||
|
|
||
|
#define SENDDEVINFO 0x0000
|
||
|
#define DONTSENDDEVINFO 0x0001
|
||
|
#define UVODBC_CLIENT 0x0002
|
||
|
#define UDODBC_CLIENT 0x0004
|
||
|
#define OLEDB_CLIENT 0x0008
|
||
|
|
||
|
/******************************
|
||
|
* SQLFreeStmt option defines
|
||
|
******************************/
|
||
|
#define UCI_CLOSE 1
|
||
|
#define UCI_DROP 2
|
||
|
#define UCI_UNBIND 3
|
||
|
#define UCI_RESET_PARAMS 4
|
||
|
|
||
|
#ifndef __SQL
|
||
|
#define SQL_CLOSE UCI_CLOSE
|
||
|
#define SQL_DROP UCI_DROP
|
||
|
#define SQL_UNBIND UCI_UNBIND
|
||
|
#define SQL_RESET_PARAMS UCI_RESET_PARAMS
|
||
|
#else
|
||
|
#define SQL_CLOSE 0
|
||
|
#define SQL_DROP 1
|
||
|
#define SQL_UNBIND 2
|
||
|
#define SQL_RESET_PARAMS 3
|
||
|
#endif /* __SQL */
|
||
|
|
||
|
/******************************
|
||
|
* SQLTransact defines
|
||
|
******************************/
|
||
|
#define UCI_COMMIT 1
|
||
|
#define UCI_ROLLBACK 2
|
||
|
|
||
|
#ifndef __SQL
|
||
|
#define SQL_COMMIT UCI_COMMIT
|
||
|
#define SQL_ROLLBACK UCI_ROLLBACK
|
||
|
#else
|
||
|
#define SQL_COMMIT 0
|
||
|
#define SQL_ROLLBACK 1
|
||
|
#endif /* __SQL */
|
||
|
|
||
|
#define SQL_BEGIN_TRANSACTION 3
|
||
|
|
||
|
/**********************************
|
||
|
* Define all SQL data types
|
||
|
* and those that we support
|
||
|
**********************************/
|
||
|
#define SQL_CHAR 1
|
||
|
#define SQL_NUMERIC 2
|
||
|
#define SQL_DECIMAL 3
|
||
|
#define SQL_INTEGER 4
|
||
|
#define SQL_SMALLINT 5
|
||
|
#define SQL_FLOAT 6
|
||
|
#define SQL_REAL 7
|
||
|
#define SQL_DOUBLE 8
|
||
|
#define SQL_DATE 9
|
||
|
#define SQL_TIME 10
|
||
|
#define SQL_TIMESTAMP 11
|
||
|
#define SQL_VARCHAR 12
|
||
|
#define SQL_STRING 13
|
||
|
#define SQL_LONGVARCHAR -1
|
||
|
#define SQL_BINARY -2
|
||
|
#define SQL_VARBINARY -3
|
||
|
#define SQL_LONGVARBINARY -4
|
||
|
#define SQL_BIGINT -5
|
||
|
#define SQL_TINYINT -6
|
||
|
#define SQL_BIT -7
|
||
|
#define SQL_WCHAR -8
|
||
|
#define SQL_WVARCHAR -9
|
||
|
#define SQL_WLONGVARCHAR -10
|
||
|
|
||
|
#define NUM_SQL_TYPES 23
|
||
|
|
||
|
/**************************************
|
||
|
valid 'C' and BASIC data types
|
||
|
***************************************/
|
||
|
#define SQL_SIGNED_OFFSET (-20)
|
||
|
#define SQL_UNSIGNED_OFFSET (-22)
|
||
|
|
||
|
#define SQL_C_CHAR SQL_CHAR
|
||
|
#define SQL_C_LONG SQL_INTEGER
|
||
|
#define SQL_C_SHORT SQL_SMALLINT
|
||
|
#define SQL_C_FLOAT SQL_REAL
|
||
|
#define SQL_C_DOUBLE SQL_DOUBLE
|
||
|
#define SQL_C_DATE SQL_DATE
|
||
|
#define SQL_C_DEFAULT 99
|
||
|
|
||
|
#define SQL_C_STRING SQL_STRING
|
||
|
|
||
|
#define SQL_C_TIME SQL_TIME
|
||
|
#define SQL_C_BINARY SQL_BINARY
|
||
|
#define SQL_C_TINYINT SQL_TINYINT
|
||
|
#define SQL_C_SLONG SQL_C_LONG+SQL_SIGNED_OFFSET
|
||
|
#define SQL_C_SSHORT SQL_C_SHORT+SQL_SIGNED_OFFSET
|
||
|
#define SQL_C_STINYINT SQL_TINYINT+SQL_SIGNED_OFFSET
|
||
|
#define SQL_C_ULONG SQL_C_LONG+SQL_UNSIGNED_OFFSET
|
||
|
#define SQL_C_USHORT SQL_C_SHORT+SQL_UNSIGNED_OFFSET
|
||
|
#define SQL_C_UTINYINT SQL_TINYINT+SQL_UNSIGNED_OFFSET
|
||
|
|
||
|
/* These are specific for BASIC run machine */
|
||
|
#define SQL_B_BASIC 100
|
||
|
#define SQL_B_INTDATE 101
|
||
|
#define SQL_B_NUMBER 102
|
||
|
#define SQL_B_INTTIME 103
|
||
|
#define SQL_B_CHAR SQL_CHAR
|
||
|
#define SQL_B_DEFAULT SQL_C_DEFAULT
|
||
|
|
||
|
|
||
|
/**************************************
|
||
|
* Define ODBC conception of precision
|
||
|
* for the various data types
|
||
|
**************************************/
|
||
|
#define SQL_CHAR_PRECISION 254
|
||
|
#define SQL_VARCHAR_PRECISION 254
|
||
|
#define SQL_DECIMAL_PRECISION 15
|
||
|
#define SQL_NUMERIC_PRECISION 15
|
||
|
#define SQL_SMALLINT_PRECISION 5
|
||
|
#define SQL_INTEGER_PRECISION 10
|
||
|
#define SQL_REAL_PRECISION 7
|
||
|
#define SQL_FLOAT_PRECISION 15
|
||
|
#define SQL_DOUBLE_PRECISION 15
|
||
|
#define SQL_DATE_PRECISION 10
|
||
|
#define SQL_TIME_PRECISION 8
|
||
|
#define SQL_TIMESTAMP_PRECISION 23
|
||
|
|
||
|
/**************************************
|
||
|
* Define ODBC conception of display size
|
||
|
* for the various data types
|
||
|
**************************************/
|
||
|
#define SQL_CHAR_DSPSIZE 0
|
||
|
#define SQL_VARCHAR_DSPSIZE 0
|
||
|
#define SQL_DECIMAL_DSPSIZE 2 /* Means add 2 to precision */
|
||
|
#define SQL_NUMERIC_DSPSIZE 2 /* Means add 2 to precision */
|
||
|
#define SQL_SMALLINT_DSPSIZE 6
|
||
|
#define SQL_INTEGER_DSPSIZE 11
|
||
|
#define SQL_REAL_DSPSIZE 13
|
||
|
#define SQL_FLOAT_DSPSIZE 22
|
||
|
#define SQL_DOUBLE_DSPSIZE 22
|
||
|
#define SQL_DATE_DSPSIZE 10
|
||
|
#define SQL_TIME_DSPSIZE 8
|
||
|
|
||
|
/**************************************
|
||
|
* Define return valued for
|
||
|
* Describe and ColAttributes
|
||
|
**************************************/
|
||
|
#define SQL_NO_NULLS 0
|
||
|
#define SQL_NULLABLE 1
|
||
|
#define SQL_NULLABLE_UNKNOWN 2
|
||
|
|
||
|
/**************************************
|
||
|
* Defines for SQLGetFunctions
|
||
|
**************************************/
|
||
|
|
||
|
#define SQL_API_SQLALLOCCONNECT 1 /* Core Functions */
|
||
|
#define SQL_API_SQLALLOCENV 2
|
||
|
#define SQL_API_SQLALLOCSTMT 3
|
||
|
#define SQL_API_SQLBINDCOL 4
|
||
|
#define SQL_API_SQLCANCEL 5
|
||
|
#define SQL_API_SQLCOLATTRIBUTES 6
|
||
|
#define SQL_API_SQLCONNECT 7
|
||
|
#define SQL_API_SQLDESCRIBECOL 8
|
||
|
#define SQL_API_SQLDISCONNECT 9
|
||
|
#define SQL_API_SQLERROR 10
|
||
|
#define SQL_API_SQLEXECDIRECT 11
|
||
|
#define SQL_API_SQLEXECUTE 12
|
||
|
#define SQL_API_SQLFETCH 13
|
||
|
#define SQL_API_SQLFREECONNECT 14
|
||
|
#define SQL_API_SQLFREEENV 15
|
||
|
#define SQL_API_SQLFREESTMT 16
|
||
|
#define SQL_API_SQLGETCURSORNAME 17
|
||
|
#define SQL_API_SQLNUMRESULTCOLS 18
|
||
|
#define SQL_API_SQLPREPARE 19
|
||
|
#define SQL_API_SQLROWCOUNT 20
|
||
|
#define SQL_API_SQLSETCURSORNAME 21
|
||
|
#define SQL_API_SQLSETPARAM 22
|
||
|
#define SQL_API_SQLTRANSACT 23
|
||
|
|
||
|
#define SQL_API_SQLCOLUMNS 40 /* Level 1 Functions */
|
||
|
#define SQL_API_SQLDRIVERCONNECT 41
|
||
|
#define SQL_API_SQLGETCONNECTOPTION 42
|
||
|
#define SQL_API_SQLGETDATA 43
|
||
|
#define SQL_API_SQLGETFUNCTIONS 44
|
||
|
#define SQL_API_SQLGETINFO 45
|
||
|
#define SQL_API_SQLGETSTMTOPTION 46
|
||
|
#define SQL_API_SQLGETTYPEINFO 47
|
||
|
#define SQL_API_SQLPARAMDATA 48
|
||
|
#define SQL_API_SQLPUTDATA 49
|
||
|
#define SQL_API_SQLSETCONNECTOPTION 50
|
||
|
#define SQL_API_SQLSETSTMTOPTION 51
|
||
|
#define SQL_API_SQLSPECIALCOLUMNS 52
|
||
|
#define SQL_API_SQLSTATISTICS 53
|
||
|
#define SQL_API_SQLTABLES 54
|
||
|
|
||
|
#define SQL_API_SQLBROWSECONNECT 55 /* Level 2 Functions */
|
||
|
#define SQL_API_SQLCOLUMNPRIVILEGES 56
|
||
|
#define SQL_API_SQLDATASOURCES 57
|
||
|
#define SQL_API_SQLDESCRIBEPARAM 58
|
||
|
#define SQL_API_SQLEXTENDEDFETCH 59
|
||
|
#define SQL_API_SQLFOREIGNKEYS 60
|
||
|
#define SQL_API_SQLMORERESULTS 61
|
||
|
#define SQL_API_SQLNATIVESQL 62
|
||
|
#define SQL_API_SQLNUMPARAMS 63
|
||
|
#define SQL_API_SQLPARAMOPTIONS 64
|
||
|
#define SQL_API_SQLPRIMARYKEYS 65
|
||
|
#define SQL_API_SQLPROCEDURECOLUMNS 66
|
||
|
#define SQL_API_SQLPROCEDURES 67
|
||
|
#define SQL_API_SQLSETPOS 68
|
||
|
#define SQL_API_SQLSETSCROLLOPTIONS 69
|
||
|
#define SQL_API_SQLTABLEPRIVILEGES 70
|
||
|
|
||
|
#define SQL_API_SQLDRIVERS 71 /* SDK 2.0 Additions */
|
||
|
#define SQL_API_SQLBINDPARAMETER 72
|
||
|
#define SQL_EXT_API_LAST SQL_API_SQLBINDPARAMETER
|
||
|
|
||
|
#define SQL_API_ALL_FUNCTIONS 0
|
||
|
|
||
|
/**************************************
|
||
|
* Defines for SQLGetInfo
|
||
|
**************************************/
|
||
|
|
||
|
#define SQL_INFO_FIRST 0
|
||
|
#define SQL_ACTIVE_CONNECTIONS 0
|
||
|
#define SQL_ACTIVE_STATEMENTS 1
|
||
|
#define SQL_DATA_SOURCE_NAME 2
|
||
|
#define SQL_DRIVER_HDBC 3
|
||
|
#define SQL_DRIVER_HENV 4
|
||
|
#define SQL_DRIVER_HSTMT 5
|
||
|
#define SQL_DRIVER_NAME 6
|
||
|
#define SQL_DRIVER_VER 7
|
||
|
#define SQL_FETCH_DIRECTION 8
|
||
|
#define SQL_ODBC_API_CONFORMANCE 9
|
||
|
#define SQL_ODBC_VER 10
|
||
|
#define SQL_ROW_UPDATES 11
|
||
|
#define SQL_ODBC_SAG_CLI_CONFORMANCE 12
|
||
|
#define SQL_SERVER_NAME 13
|
||
|
#define SQL_SEARCH_PATTERN_ESCAPE 14
|
||
|
#define SQL_ODBC_SQL_CONFORMANCE 15
|
||
|
#define SQL_DATABASE_NAME 16
|
||
|
#define SQL_DBMS_NAME 17
|
||
|
#define SQL_DBMS_VER 18
|
||
|
#define SQL_ACCESSIBLE_TABLES 19
|
||
|
#define SQL_ACCESSIBLE_PROCEDURES 20
|
||
|
#define SQL_PROCEDURES 21
|
||
|
#define SQL_CONCAT_NULL_BEHAVIOR 22
|
||
|
#define SQL_CURSOR_COMMIT_BEHAVIOR 23
|
||
|
#define SQL_CURSOR_ROLLBACK_BEHAVIOR 24
|
||
|
#define SQL_DATA_SOURCE_READ_ONLY 25
|
||
|
#define SQL_DEFAULT_TXN_ISOLATION 26
|
||
|
#define SQL_EXPRESSIONS_IN_ORDERBY 27
|
||
|
#define SQL_IDENTIFIER_CASE 28
|
||
|
#define SQL_IDENTIFIER_QUOTE_CHAR 29
|
||
|
#define SQL_MAX_COLUMN_NAME_LEN 30
|
||
|
#define SQL_MAX_CURSOR_NAME_LEN 31
|
||
|
#define SQL_MAX_OWNER_NAME_LEN 32
|
||
|
#define SQL_MAX_PROCEDURE_NAME_LEN 33
|
||
|
#define SQL_MAX_QUALIFIER_NAME_LEN 34
|
||
|
#define SQL_MAX_TABLE_NAME_LEN 35
|
||
|
#define SQL_MULT_RESULT_SETS 36
|
||
|
#define SQL_MULTIPLE_ACTIVE_TXN 37
|
||
|
#define SQL_OUTER_JOINS 38
|
||
|
#define SQL_OWNER_TERM 39
|
||
|
#define SQL_PROCEDURE_TERM 40
|
||
|
#define SQL_QUALIFIER_NAME_SEPARATOR 41
|
||
|
#define SQL_QUALIFIER_TERM 42
|
||
|
#define SQL_SCROLL_CONCURRENCY 43
|
||
|
#define SQL_SCROLL_OPTIONS 44
|
||
|
#define SQL_TABLE_TERM 45
|
||
|
#define SQL_TXN_CAPABLE 46
|
||
|
#define SQL_USER_NAME 47
|
||
|
#define SQL_CONVERT_FUNCTIONS 48
|
||
|
#define SQL_NUMERIC_FUNCTIONS 49
|
||
|
#define SQL_STRING_FUNCTIONS 50
|
||
|
#define SQL_SYSTEM_FUNCTIONS 51
|
||
|
#define SQL_TIMEDATE_FUNCTIONS 52
|
||
|
#define SQL_CONVERT_BIGINT 53
|
||
|
#define SQL_CONVERT_BINARY 54
|
||
|
#define SQL_CONVERT_BIT 55
|
||
|
#define SQL_CONVERT_CHAR 56
|
||
|
#define SQL_CONVERT_DATE 57
|
||
|
#define SQL_CONVERT_DECIMAL 58
|
||
|
#define SQL_CONVERT_DOUBLE 59
|
||
|
#define SQL_CONVERT_FLOAT 60
|
||
|
#define SQL_CONVERT_INTEGER 61
|
||
|
#define SQL_CONVERT_LONGVARCHAR 62
|
||
|
#define SQL_CONVERT_NUMERIC 63
|
||
|
#define SQL_CONVERT_REAL 64
|
||
|
#define SQL_CONVERT_SMALLINT 65
|
||
|
#define SQL_CONVERT_TIME 66
|
||
|
#define SQL_CONVERT_TIMESTAMP 67
|
||
|
#define SQL_CONVERT_TINYINT 68
|
||
|
#define SQL_CONVERT_VARBINARY 69
|
||
|
#define SQL_CONVERT_VARCHAR 70
|
||
|
#define SQL_CONVERT_LONGVARBINARY 71
|
||
|
#define SQL_TXN_ISOLATION_OPTION 72
|
||
|
#define SQL_ODBC_SQL_OPT_IEF 73
|
||
|
|
||
|
/*** ODBC SDK 1.0 Additions ***/
|
||
|
#define SQL_CORRELATION_NAME 74
|
||
|
#define SQL_NON_NULLABLE_COLUMNS 75
|
||
|
|
||
|
/*** ODBC SDK 2.0 Additions ***/
|
||
|
#define SQL_DRIVER_HLIB 76
|
||
|
#define SQL_DRIVER_ODBC_VER 77
|
||
|
#define SQL_LOCK_TYPES 78
|
||
|
#define SQL_POS_OPERATIONS 79
|
||
|
#define SQL_POSITIONED_STATEMENTS 80
|
||
|
#define SQL_GETDATA_EXTENSIONS 81
|
||
|
#define SQL_BOOKMARK_PERSISTENCE 82
|
||
|
#define SQL_STATIC_SENSITIVITY 83
|
||
|
#define SQL_FILE_USAGE 84
|
||
|
#define SQL_NULL_COLLATION 85
|
||
|
#define SQL_ALTER_TABLE 86
|
||
|
#define SQL_COLUMN_ALIAS 87
|
||
|
#define SQL_GROUP_BY 88
|
||
|
#define SQL_KEYWORDS 89
|
||
|
#define SQL_ORDER_BY_COLUMNS_IN_SELECT 90
|
||
|
#define SQL_OWNER_USAGE 91
|
||
|
#define SQL_QUALIFIER_USAGE 92
|
||
|
#define SQL_QUOTED_IDENTIFIER_CASE 93
|
||
|
#define SQL_SPECIAL_CHARACTERS 94
|
||
|
#define SQL_SUBQUERIES 95
|
||
|
#define SQL_UNION 96
|
||
|
#define SQL_MAX_COLUMNS_IN_GROUP_BY 97
|
||
|
#define SQL_MAX_COLUMNS_IN_INDEX 98
|
||
|
#define SQL_MAX_COLUMNS_IN_ORDER_BY 99
|
||
|
#define SQL_MAX_COLUMNS_IN_SELECT 100
|
||
|
#define SQL_MAX_COLUMNS_IN_TABLE 101
|
||
|
#define SQL_MAX_INDEX_SIZE 102
|
||
|
#define SQL_MAX_ROW_SIZE_INCLUDES_LONG 103
|
||
|
#define SQL_MAX_ROW_SIZE 104
|
||
|
#define SQL_MAX_STATEMENT_LEN 105
|
||
|
#define SQL_MAX_TABLES_IN_SELECT 106
|
||
|
#define SQL_MAX_USER_NAME_LEN 107
|
||
|
#define SQL_MAX_CHAR_LITERAL_LEN 108
|
||
|
#define SQL_TIMEDATE_ADD_INTERVALS 109
|
||
|
#define SQL_TIMEDATE_DIFF_INTERVALS 110
|
||
|
#define SQL_NEED_LONG_DATA_LEN 111
|
||
|
#define SQL_MAX_BINARY_LITERAL_LEN 112
|
||
|
#define SQL_LIKE_ESCAPE_CLAUSE 113
|
||
|
#define SQL_QUALIFIER_LOCATION 114
|
||
|
|
||
|
#define SQL_INFO_DRIVER_START 1000
|
||
|
#define SQL_INFO_LAST SQL_QUALIFIER_LOCATION
|
||
|
|
||
|
/* SQL_CONVERT_* return value bitmasks */
|
||
|
|
||
|
#define SQL_CVT_CHAR 0x00000001L
|
||
|
#define SQL_CVT_NUMERIC 0x00000002L
|
||
|
#define SQL_CVT_DECIMAL 0x00000004L
|
||
|
#define SQL_CVT_INTEGER 0x00000008L
|
||
|
#define SQL_CVT_SMALLINT 0x00000010L
|
||
|
#define SQL_CVT_FLOAT 0x00000020L
|
||
|
#define SQL_CVT_REAL 0x00000040L
|
||
|
#define SQL_CVT_DOUBLE 0x00000080L
|
||
|
#define SQL_CVT_VARCHAR 0x00000100L
|
||
|
#define SQL_CVT_LONGVARCHAR 0x00000200L
|
||
|
#define SQL_CVT_BINARY 0x00000400L
|
||
|
#define SQL_CVT_VARBINARY 0x00000800L
|
||
|
#define SQL_CVT_BIT 0x00001000L
|
||
|
#define SQL_CVT_TINYINT 0x00002000L
|
||
|
#define SQL_CVT_BIGINT 0x00004000L
|
||
|
#define SQL_CVT_DATE 0x00008000L
|
||
|
#define SQL_CVT_TIME 0x00010000L
|
||
|
#define SQL_CVT_TIMESTAMP 0x00020000L
|
||
|
#define SQL_CVT_LONGVARBINARY 0x00040000L
|
||
|
|
||
|
/* SQL_CONVERT_FUNCTIONS functions */
|
||
|
#define SQL_FN_CVT_CONVERT 0x00000001L
|
||
|
|
||
|
/* SQL_STRING_FUNCTIONS functions */
|
||
|
|
||
|
#define SQL_FN_STR_CONCAT 0x00000001L
|
||
|
#define SQL_FN_STR_INSERT 0x00000002L
|
||
|
#define SQL_FN_STR_LEFT 0x00000004L
|
||
|
#define SQL_FN_STR_LTRIM 0x00000008L
|
||
|
#define SQL_FN_STR_LENGTH 0x00000010L
|
||
|
#define SQL_FN_STR_LOCATE 0x00000020L
|
||
|
#define SQL_FN_STR_LCASE 0x00000040L
|
||
|
#define SQL_FN_STR_REPEAT 0x00000080L
|
||
|
#define SQL_FN_STR_REPLACE 0x00000100L
|
||
|
#define SQL_FN_STR_RIGHT 0x00000200L
|
||
|
#define SQL_FN_STR_RTRIM 0x00000400L
|
||
|
#define SQL_FN_STR_SUBSTRING 0x00000800L
|
||
|
#define SQL_FN_STR_UCASE 0x00001000L
|
||
|
#define SQL_FN_STR_ASCII 0x00002000L
|
||
|
#define SQL_FN_STR_CHAR 0x00004000L
|
||
|
#define SQL_FN_STR_DIFFERENCE 0x00008000L
|
||
|
#define SQL_FN_STR_LOCATE_2 0x00010000L
|
||
|
#define SQL_FN_STR_SOUNDEX 0x00020000L
|
||
|
#define SQL_FN_STR_SPACE 0x00040000L
|
||
|
|
||
|
/* SQL_NUMERIC_FUNCTIONS functions */
|
||
|
|
||
|
#define SQL_FN_NUM_ABS 0x00000001L
|
||
|
#define SQL_FN_NUM_ACOS 0x00000002L
|
||
|
#define SQL_FN_NUM_ASIN 0x00000004L
|
||
|
#define SQL_FN_NUM_ATAN 0x00000008L
|
||
|
#define SQL_FN_NUM_ATAN2 0x00000010L
|
||
|
#define SQL_FN_NUM_CEILING 0x00000020L
|
||
|
#define SQL_FN_NUM_COS 0x00000040L
|
||
|
#define SQL_FN_NUM_COT 0x00000080L
|
||
|
#define SQL_FN_NUM_EXP 0x00000100L
|
||
|
#define SQL_FN_NUM_FLOOR 0x00000200L
|
||
|
#define SQL_FN_NUM_LOG 0x00000400L
|
||
|
#define SQL_FN_NUM_MOD 0x00000800L
|
||
|
#define SQL_FN_NUM_SIGN 0x00001000L
|
||
|
#define SQL_FN_NUM_SIN 0x00002000L
|
||
|
#define SQL_FN_NUM_SQRT 0x00004000L
|
||
|
#define SQL_FN_NUM_TAN 0x00008000L
|
||
|
#define SQL_FN_NUM_PI 0x00010000L
|
||
|
#define SQL_FN_NUM_RAND 0x00020000L
|
||
|
#define SQL_FN_NUM_DEGREES 0x00040000L
|
||
|
#define SQL_FN_NUM_LOG10 0x00080000L
|
||
|
#define SQL_FN_NUM_POWER 0x00100000L
|
||
|
#define SQL_FN_NUM_RADIANS 0x00200000L
|
||
|
#define SQL_FN_NUM_ROUND 0x00400000L
|
||
|
#define SQL_FN_NUM_TRUNCATE 0x00800000L
|
||
|
|
||
|
/* SQL_TIMEDATE_FUNCTIONS functions */
|
||
|
|
||
|
#define SQL_FN_TD_NOW 0x00000001L
|
||
|
#define SQL_FN_TD_CURDATE 0x00000002L
|
||
|
#define SQL_FN_TD_DAYOFMONTH 0x00000004L
|
||
|
#define SQL_FN_TD_DAYOFWEEK 0x00000008L
|
||
|
#define SQL_FN_TD_DAYOFYEAR 0x00000010L
|
||
|
#define SQL_FN_TD_MONTH 0x00000020L
|
||
|
#define SQL_FN_TD_QUARTER 0x00000040L
|
||
|
#define SQL_FN_TD_WEEK 0x00000080L
|
||
|
#define SQL_FN_TD_YEAR 0x00000100L
|
||
|
#define SQL_FN_TD_CURTIME 0x00000200L
|
||
|
#define SQL_FN_TD_HOUR 0x00000400L
|
||
|
#define SQL_FN_TD_MINUTE 0x00000800L
|
||
|
#define SQL_FN_TD_SECOND 0x00001000L
|
||
|
#define SQL_FN_TD_TIMESTAMPADD 0x00002000L
|
||
|
#define SQL_FN_TD_TIMESTAMPDIFF 0x00004000L
|
||
|
#define SQL_FN_TD_DAYNAME 0x00008000L
|
||
|
#define SQL_FN_TD_MONTHNAME 0x00010000L
|
||
|
|
||
|
/* SQL_SYSTEM_FUNCTIONS functions */
|
||
|
|
||
|
#define SQL_FN_SYS_USERNAME 0x00000001L
|
||
|
#define SQL_FN_SYS_DBNAME 0x00000002L
|
||
|
#define SQL_FN_SYS_IFNULL 0x00000004L
|
||
|
|
||
|
/* SQL_TIMEDATE_ADD_INTERVALS and SQL_TIMEDATE_DIFF_INTERVALS functions */
|
||
|
|
||
|
#define SQL_FN_TSI_FRAC_SECOND 0x00000001L
|
||
|
#define SQL_FN_TSI_SECOND 0x00000002L
|
||
|
#define SQL_FN_TSI_MINUTE 0x00000004L
|
||
|
#define SQL_FN_TSI_HOUR 0x00000008L
|
||
|
#define SQL_FN_TSI_DAY 0x00000010L
|
||
|
#define SQL_FN_TSI_WEEK 0x00000020L
|
||
|
#define SQL_FN_TSI_MONTH 0x00000040L
|
||
|
#define SQL_FN_TSI_QUARTER 0x00000080L
|
||
|
#define SQL_FN_TSI_YEAR 0x00000100L
|
||
|
|
||
|
/* SQL_ODBC_API_CONFORMANCE values */
|
||
|
|
||
|
#define SQL_OAC_NONE 0x0000
|
||
|
#define SQL_OAC_LEVEL1 0x0001
|
||
|
#define SQL_OAC_LEVEL2 0x0002
|
||
|
|
||
|
/* SQL_ODBC_SAG_CLI_CONFORMANCE values */
|
||
|
|
||
|
#define SQL_OSCC_NOT_COMPLIANT 0x0000
|
||
|
#define SQL_OSCC_COMPLIANT 0x0001
|
||
|
|
||
|
/* SQL_ODBC_SQL_CONFORMANCE values */
|
||
|
|
||
|
#define SQL_OSC_MINIMUM 0x0000
|
||
|
#define SQL_OSC_CORE 0x0001
|
||
|
#define SQL_OSC_EXTENDED 0x0002
|
||
|
|
||
|
/* SQL_CONCAT_NULL_BEHAVIOR values */
|
||
|
|
||
|
#define SQL_CB_NULL 0x0000
|
||
|
#define SQL_CB_NON_NULL 0x0001
|
||
|
|
||
|
/* SQL_CURSOR_COMMIT_BEHAVIOR and SQL_CURSOR_ROLLBACK_BEHAVIOR values */
|
||
|
|
||
|
#define SQL_CB_DELETE 0x0000
|
||
|
#define SQL_CB_CLOSE 0x0001
|
||
|
#define SQL_CB_PRESERVE 0x0002
|
||
|
|
||
|
/* SQL_IDENTIFIER_CASE values */
|
||
|
|
||
|
#define SQL_IC_UPPER 0x0001
|
||
|
#define SQL_IC_LOWER 0x0002
|
||
|
#define SQL_IC_SENSITIVE 0x0003
|
||
|
#define SQL_IC_MIXED 0x0004
|
||
|
|
||
|
/* SQL_TXN_CAPABLE values */
|
||
|
|
||
|
#define SQL_TC_NONE 0x0000
|
||
|
#define SQL_TC_DML 0x0001
|
||
|
#define SQL_TC_ALL 0x0002
|
||
|
#define SQL_TC_DDL_COMMIT 0x0003
|
||
|
#define SQL_TC_DDL_IGNORE 0x0004
|
||
|
|
||
|
/* SQL_SCROLL_OPTIONS masks */
|
||
|
|
||
|
#define SQL_SO_FORWARD_ONLY 0x00000001L
|
||
|
#define SQL_SO_KEYSET_DRIVEN 0x00000002L
|
||
|
#define SQL_SO_DYNAMIC 0x00000004L
|
||
|
#define SQL_SO_MIXED 0x00000008L
|
||
|
#define SQL_SO_STATIC 0x00000010L
|
||
|
|
||
|
/* SQL_SCROLL_CONCURRENCY masks */
|
||
|
|
||
|
#define SQL_SCCO_READ_ONLY 0x00000001L
|
||
|
#define SQL_SCCO_LOCK 0x00000002L
|
||
|
#define SQL_SCCO_OPT_ROWVER 0x00000004L
|
||
|
#define SQL_SCCO_OPT_VALUES 0x00000008L
|
||
|
|
||
|
/* SQL_FETCH_DIRECTION masks */
|
||
|
|
||
|
#define SQL_FD_FETCH_NEXT 0x00000001L
|
||
|
#define SQL_FD_FETCH_FIRST 0x00000002L
|
||
|
#define SQL_FD_FETCH_LAST 0x00000004L
|
||
|
#define SQL_FD_FETCH_PRIOR 0x00000008L
|
||
|
#define SQL_FD_FETCH_ABSOLUTE 0x00000010L
|
||
|
#define SQL_FD_FETCH_RELATIVE 0x00000020L
|
||
|
#define SQL_FD_FETCH_RESUME 0x00000040L
|
||
|
#define SQL_FD_FETCH_BOOKMARK 0x00000080L
|
||
|
|
||
|
/* SQL_TXN_ISOLATION_OPTION masks */
|
||
|
|
||
|
#define SQL_TXN_READ_UNCOMMITTED 0x00000001L
|
||
|
#define SQL_TXN_READ_COMMITTED 0x00000002L
|
||
|
#define SQL_TXN_REPEATABLE_READ 0x00000004L
|
||
|
#define SQL_TXN_SERIALIZABLE 0x00000008L
|
||
|
#define SQL_TXN_VERSIONING 0x00000010L
|
||
|
#define SQL_TXN_CURRENT 0x0000002aL
|
||
|
|
||
|
/* SQL_CORRELATION_NAME values */
|
||
|
|
||
|
#define SQL_CN_NONE 0x0000
|
||
|
#define SQL_CN_DIFFERENT 0x0001
|
||
|
#define SQL_CN_ANY 0x0002
|
||
|
|
||
|
/* SQL_NON_NULLABLE_COLUMNS values */
|
||
|
|
||
|
#define SQL_NNC_NULL 0x0000
|
||
|
#define SQL_NNC_NON_NULL 0x0001
|
||
|
|
||
|
/* SQL_NULL_COLLATION values */
|
||
|
|
||
|
#define SQL_NC_HIGH 0x0000
|
||
|
#define SQL_NC_LOW 0x0001
|
||
|
#define SQL_NC_START 0x0002
|
||
|
#define SQL_NC_END 0x0004
|
||
|
|
||
|
/* SQL_FILE_USAGE values */
|
||
|
|
||
|
#define SQL_FILE_NOT_SUPPORTED 0x0000
|
||
|
#define SQL_FILE_TABLE 0x0001
|
||
|
#define SQL_FILE_QUALIFIER 0x0002
|
||
|
|
||
|
/* SQL_GETDATA_EXTENSIONS values */
|
||
|
|
||
|
#define SQL_GD_ANY_COLUMN 0x00000001L
|
||
|
#define SQL_GD_ANY_ORDER 0x00000002L
|
||
|
#define SQL_GD_BLOCK 0x00000004L
|
||
|
#define SQL_GD_BOUND 0x00000008L
|
||
|
|
||
|
/* SQL_ALTER_TABLE values */
|
||
|
|
||
|
#define SQL_AT_ADD_COLUMN 0x00000001L
|
||
|
#define SQL_AT_DROP_COLUMN 0x00000002L
|
||
|
|
||
|
/* SQL_POSITIONED_STATEMENTS masks */
|
||
|
|
||
|
#define SQL_PS_POSITIONED_DELETE 0x00000001L
|
||
|
#define SQL_PS_POSITIONED_UPDATE 0x00000002L
|
||
|
#define SQL_PS_SELECT_FOR_UPDATE 0x00000004L
|
||
|
|
||
|
/* SQL_GROUP_BY values */
|
||
|
|
||
|
#define SQL_GB_NOT_SUPPORTED 0x0000
|
||
|
#define SQL_GB_GROUP_BY_EQUALS_SELECT 0x0001
|
||
|
#define SQL_GB_GROUP_BY_CONTAINS_SELECT 0x0002
|
||
|
#define SQL_GB_NO_RELATION 0x0003
|
||
|
|
||
|
/* SQL_OWNER_USAGE masks */
|
||
|
|
||
|
#define SQL_OU_DML_STATEMENTS 0x00000001L
|
||
|
#define SQL_OU_PROCEDURE_INVOCATION 0x00000002L
|
||
|
#define SQL_OU_TABLE_DEFINITION 0x00000004L
|
||
|
#define SQL_OU_INDEX_DEFINITION 0x00000008L
|
||
|
#define SQL_OU_PRIVILEGE_DEFINITION 0x00000010L
|
||
|
|
||
|
/* SQL_QUALIFIER_USAGE masks */
|
||
|
|
||
|
#define SQL_QU_DML_STATEMENTS 0x00000001L
|
||
|
#define SQL_QU_PROCEDURE_INVOCATION 0x00000002L
|
||
|
#define SQL_QU_TABLE_DEFINITION 0x00000004L
|
||
|
#define SQL_QU_INDEX_DEFINITION 0x00000008L
|
||
|
#define SQL_QU_PRIVILEGE_DEFINITION 0x00000010L
|
||
|
|
||
|
/* SQL_SUBQUERIES masks */
|
||
|
|
||
|
#define SQL_SQ_COMPARISON 0x00000001L
|
||
|
#define SQL_SQ_EXISTS 0x00000002L
|
||
|
#define SQL_SQ_IN 0x00000004L
|
||
|
#define SQL_SQ_QUANTIFIED 0x00000008L
|
||
|
#define SQL_SQ_CORRELATED_SUBQUERIES 0x00000010L
|
||
|
|
||
|
/* SQL_UNION masks */
|
||
|
|
||
|
#define SQL_U_UNION 0x00000001L
|
||
|
#define SQL_U_UNION_ALL 0x00000002L
|
||
|
|
||
|
/* SQL_BOOKMARK_PERSISTENCE values */
|
||
|
|
||
|
#define SQL_BP_CLOSE 0x00000001L
|
||
|
#define SQL_BP_DELETE 0x00000002L
|
||
|
#define SQL_BP_DROP 0x00000004L
|
||
|
#define SQL_BP_TRANSACTION 0x00000008L
|
||
|
#define SQL_BP_UPDATE 0x00000010L
|
||
|
#define SQL_BP_OTHER_HSTMT 0x00000020L
|
||
|
#define SQL_BP_SCROLL 0x00000040L
|
||
|
|
||
|
/* SQL_STATIC_SENSITIVITY values */
|
||
|
|
||
|
#define SQL_SS_ADDITIONS 0x00000001L
|
||
|
#define SQL_SS_DELETIONS 0x00000002L
|
||
|
#define SQL_SS_UPDATES 0x00000004L
|
||
|
|
||
|
/* SQL_LOCK_TYPESL masks */
|
||
|
|
||
|
#define SQL_LCK_NO_CHANGE 0x00000001L
|
||
|
#define SQL_LCK_EXCLUSIVE 0x00000002L
|
||
|
#define SQL_LCK_UNLOCK 0x00000004L
|
||
|
|
||
|
/* SQL_POS_OPERATIONS masks */
|
||
|
|
||
|
#define SQL_POS_POSITION 0x00000001L
|
||
|
#define SQL_POS_REFRESH 0x00000002L
|
||
|
#define SQL_POS_UPDATE 0x00000004L
|
||
|
#define SQL_POS_DELETE 0x00000008L
|
||
|
#define SQL_POS_ADD 0x00000010L
|
||
|
|
||
|
/* SQL_QUALIFIER_LOCATION values */
|
||
|
|
||
|
#define SQL_QL_START 0x0001L
|
||
|
#define SQL_QL_END 0x0002L
|
||
|
|
||
|
/* SQL_OJ_CAPABILITIES values */
|
||
|
|
||
|
#define SQL_OJ_LEFT 0x00000001L
|
||
|
#define SQL_OJ_RIGHT 0x00000002L
|
||
|
#define SQL_OJ_FULL 0x00000004L
|
||
|
#define SQL_OJ_NESTED 0x00000008L
|
||
|
#define SQL_OJ_NOT_ORDERED 0x00000010L
|
||
|
#define SQL_OJ_INNER 0x00000020L
|
||
|
#define SQL_OJ_ALL_COMPARISON_OPS 0x00000040L
|
||
|
|
||
|
/* Definitions for SQLParamOptions extensions for BCI/ODBC */
|
||
|
#define UCI_PARAMOPTIONS_SET 0
|
||
|
#define UCI_PARAMOPTIONS_READ 1
|
||
|
|
||
|
/* Begin function prototypes for this module */
|
||
|
#ifdef WIN32
|
||
|
#define SQL_API __stdcall
|
||
|
#else
|
||
|
#define SQL_API
|
||
|
#define FAR
|
||
|
#endif
|
||
|
|
||
|
#ifndef __SQL /* For stand-alone UCI calls */
|
||
|
extern RETCODE SQLAllocConnect();
|
||
|
extern RETCODE SQLAllocEnv();
|
||
|
extern RETCODE SQLAllocStmt();
|
||
|
extern RETCODE SQLBindCol();
|
||
|
extern RETCODE SQLBindMvCol();
|
||
|
extern RETCODE SQLBindParameter();
|
||
|
extern RETCODE SQLBindMvParameter();
|
||
|
extern RETCODE SQLCancel();
|
||
|
extern RETCODE SQLColAttributes();
|
||
|
extern RETCODE SQLColumns();
|
||
|
extern RETCODE SQLConnect();
|
||
|
extern RETCODE SQLDataSources();
|
||
|
extern RETCODE SQLDescribeCol();
|
||
|
extern RETCODE SQLDisconnect();
|
||
|
extern RETCODE SQLError();
|
||
|
extern RETCODE SQLExecDirect();
|
||
|
extern RETCODE SQLExecute();
|
||
|
extern RETCODE SQLFetch();
|
||
|
extern RETCODE SQLFreeConnect();
|
||
|
extern RETCODE SQLFreeEnv();
|
||
|
extern RETCODE SQLFreeMem();
|
||
|
extern RETCODE SQLFreeStmt();
|
||
|
extern RETCODE SQLGetCursorName();
|
||
|
extern RETCODE SQLGetData();
|
||
|
extern RETCODE SQLGetFunctions();
|
||
|
extern RETCODE SQLGetInfo();
|
||
|
extern RETCODE SQLNumParams();
|
||
|
extern RETCODE SQLNumResultCols();
|
||
|
extern RETCODE SQLParamOptions(); /* 24411 */
|
||
|
extern RETCODE SQLPrepare();
|
||
|
extern RETCODE SQLRowCount();
|
||
|
extern RETCODE SQLSetConnectOption();
|
||
|
extern RETCODE SQLSetCursorName();
|
||
|
extern RETCODE SQLSetParam();
|
||
|
extern RETCODE SQLTables();
|
||
|
extern RETCODE SQLTransact();
|
||
|
extern RETCODE SQLUseCfgFile();
|
||
|
extern STRING errlookup();
|
||
|
extern RETCODE CheckCType();
|
||
|
extern RETCODE CheckSqlType();
|
||
|
|
||
|
#else /* For real ODBC calls */
|
||
|
|
||
|
RETCODE SQL_API SQLAllocConnect();
|
||
|
RETCODE SQL_API SQLAllocEnv();
|
||
|
RETCODE SQL_API SQLAllocStmt();
|
||
|
RETCODE SQL_API SQLBindCol();
|
||
|
RETCODE SQL_API SQLBindParameter();
|
||
|
RETCODE SQL_API SQLCancel();
|
||
|
RETCODE SQL_API SQLColAttributes();
|
||
|
RETCODE SQL_API SQLConnect();
|
||
|
RETCODE SQL_API SQLDescribeCol();
|
||
|
RETCODE SQL_API SQLDisconnect();
|
||
|
RETCODE SQL_API SQLError();
|
||
|
RETCODE SQL_API SQLExecDirect();
|
||
|
RETCODE SQL_API SQLExecute();
|
||
|
RETCODE SQL_API SQLFetch();
|
||
|
RETCODE SQL_API SQLFreeConnect();
|
||
|
RETCODE SQL_API SQLFreeEnv();
|
||
|
RETCODE SQL_API SQLFreeStmt();
|
||
|
RETCODE SQL_API SQLGetCursorName();
|
||
|
RETCODE SQL_API SQLNumResultCols();
|
||
|
RETCODE SQL_API SQLParamOptions();
|
||
|
RETCODE SQL_API SQLPrepare();
|
||
|
RETCODE SQL_API SQLRowCount();
|
||
|
RETCODE SQL_API SQLSetCursorName();
|
||
|
RETCODE SQL_API SQLSetConnectOption();
|
||
|
RETCODE SQL_API SQLTransact();
|
||
|
RETCODE SQL_API SQLNumParams();
|
||
|
RETCODE SQL_API SQLGetInfo();
|
||
|
RETCODE SQL_API SQLGetTypeInfo();
|
||
|
RETCODE SQL_API SQLColumns();
|
||
|
RETCODE SQL_API SQLSpecialColumns();
|
||
|
RETCODE SQL_API SQLTables();
|
||
|
RETCODE SQL_API SQLStatistics();
|
||
|
|
||
|
#endif /* __SQL */
|
||
|
/* end prototypes of functions in this module */
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
} /* End of extern "C" { */
|
||
|
#endif /* __cplusplus */
|
||
|
|
||
|
#endif
|