Prayer

在一般中寻求卓越
posts - 1256, comments - 190, trackbacks - 0, articles - 0
  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

sqlcli.h DB2 CLI include file

Posted on 2008-10-23 09:47 Prayer 阅读(2392) 评论(0)  编辑 收藏 引用 所属分类: DB2CLI
/*** START HEADER FILE SPECIFICATIONS *****************************/
/*                                                                */
/* Header File Name: SQLCLI                                       */
/*                                                                */
/* Descriptive Name: Structured Query Language (SQL) Call Level   */
/*                   Interface.                                   */
/*                                                                */
/* 5716-SS1  (C) Copyright IBM Corp. 1995,1995                    */
/* All rights reserved.                                           */
/* US Government Users Restricted Rights -                        */
/* Use, duplication or disclosure restricted                      */
/* by GSA ADP Schedule Contract with IBM Corp.                    */
/*                                                                */
/* Licensed Materials-Property of IBM                             */
/*                                                                */
/*                                                                */
/* Description: The SQL Call Level Interface provides access to   */
/*              most SQL functions, without the need for a        */
/*              precompiler.                                      */
/*                                                                */
/* Header Files Included: SQLCLI                                  */
/*                                                                */
/* Function Prototype List:  SQLAllocConnect                      */
/*                           SQLAllocEnv                          */
/*                           SQLAllocHandle                       */
/*                           SQLAllocStmt                         */
/*                           SQLBindCol                           */
/*                           SQLBindFileToCol                     */
/*                           SQLBindFileToParam                   */
/*                           SQLBindParam                         */
/*                           SQLBindParameter                     */
/*                           SQLCancel                            */
/*                           SQLCloseCursor                       */
/*                           SQLColAttributes                     */
/*                           SQLColumns                           */
/*                           SQLConnect                           */
/*                           SQLCopyDesc                          */
/*                           SQLDataSources                       */
/*                           SQLDescribeCol                       */
/*                           SQLDescribeParam                     */
/*                           SQLDisconnect                        */
/*                           SQLDriverConnect                     */
/*                           SQLEndTran                           */
/*                           SQLError                             */
/*                           SQLExecDirect                        */
/*                           SQLExecute                           */
/*                           SQLExtendedFetch                     */
/*                           SQLFetch                             */
/*                           SQLFetchScroll                       */
/*                           SQLForeignKeys                       */
/*                           SQLFreeConnect                       */
/*                           SQLFreeEnv                           */
/*                           SQLFreeHandle                        */
/*                           SQLFreeStmt                          */
/*                           SQLGetCol                            */
/*                           SQLGetConnectOption                  */
/*                           SQLGetCursorName                     */
/*                           SQLGetConnectAttr                    */
/*                           SQLGetData                           */
/*                           SQLGetDescField                      */
/*                           SQLGetDescRec                        */
/*                           SQLGetDiagField                      */
/*                           SQLGetDiagRec                        */
/*                           SQLGetEnvAttr                        */
/*                           SQLGetFunctions                      */
/*                           SQLGetInfo                           */
/*                           SQLGetLength                         */
/*                           SQLGetPosition                       */
/*                           SQLGetStmtAttr                       */
/*                           SQLGetStmtOption                     */
/*                           SQLGetSubString                      */
/*                           SQLGetTypeInfo                       */
/*                           SQLLanguages                         */
/*                           SQLMoreResults                       */
/*                           SQLNativeSql                         */
/*                           SQLNumParams                         */
/*                           SQLNumResultCols                     */
/*                           SQLParamData                         */
/*                           SQLParamOptions                      */
/*                           SQLPrepare                           */
/*                           SQLPrimaryKeys                       */
/*                           SQLProcedureColumns                  */
/*                           SQLProcedures                        */
/*                           SQLPutData                           */
/*                           SQLReleaseEnv                        */
/*                           SQLRowCount                          */
/*                           SQLSetConnectAttr                    */
/*                           SQLSetConnectOption                  */
/*                           SQLSetCursorName                     */
/*                           SQLSetDescField                      */
/*                           SQLSetDescRec                        */
/*                           SQLSetEnvAttr                        */
/*                           SQLSetParam                          */
/*                           SQLSetStmtAttr                       */
/*                           SQLSetStmtOption                     */
/*                           SQLSpecialColumns                    */
/*                           SQLStatistics                        */
/*                           SQLTables                            */
/*                           SQLTransact                          */
/*                                                                */
/* Change Activity:                                               */
/*                                                                */
/* CFD List:                                                      */
/*                                                                */
/* FLAG REASON       LEVEL DATE   PGMR      CHANGE DESCRIPTION    */
/* ---- ------------ ----- ------ --------- ----------------------*/
/* $A0= D91823       3D60  941206 MEGERIAN  New Include           */
/* $A1= D94881       4D20  960816 MEGERIAN  V4R2M0 enhancements   */
/* $A2= D95600       4D30  970910 MEGERIAN  V4R3M0 enhancements   */
/* $A3= P3682850     4D40  981030 MEGERIAN  V4R4M0 enhancements   */
/* $A4= D97596       4D50  990326 LJAMESON  V4R5M0 enhancements   */
/*                                                                */
/* End CFD List.                                                  */
/*                                                                */
/*  Additional notes about the Change Activity                    */
/* End Change Activity.                                           */
/*** END HEADER FILE SPECIFICATIONS *******************************/

#ifndef SQL_H_SQLCLI
   #define SQL_H_SQLCLI            /* Permit duplicate Includes */

#ifndef __SQL_EXTERN
    #ifdef __ILEC400__
        #define SQL_EXTERN extern
    #else
        #ifdef __cplusplus
            #define SQL_EXTERN extern "C nowiden"
        #else
            #define SQL_EXTERN extern "C"
        #endif
    #endif
    #define __SQL_EXTERN
#endif

/* generally useful constants */
#define  SQL_FALSE                 0
#define  SQL_TRUE                  1
#define  SQL_NTS                  -3  /* NTS = Null Terminated String    */
#define  SQL_SQLSTATE_SIZE         5  /* size of SQLSTATE, not including
                                         null terminating byte           */
#define  SQL_MAX_MESSAGE_LENGTH    512

/* RETCODE values             */
#define  SQL_SUCCESS             0
#define  SQL_SUCCESS_WITH_INFO   1
#define  SQL_NO_DATA_FOUND       100
#define  SQL_NEED_DATA           99
#define  SQL_NO_DATA             SQL_NO_DATA_FOUND
#define  SQL_ERROR              -1
#define  SQL_INVALID_HANDLE     -2

/* SQLFreeStmt option values  */
#define  SQL_CLOSE               0
#define  SQL_DROP                1
#define  SQL_UNBIND              2
#define  SQL_RESET_PARAMS        3

/* SQLSetParam defines        */
#define  SQL_C_DEFAULT          99

/* SQLTransact option values  */
#define  SQL_COMMIT              0
#define  SQL_ROLLBACK            1
#define  SQL_COMMIT_HOLD         2
#define  SQL_ROLLBACK_HOLD       3

/* SQLDriverConnect option values  */
#define  SQL_DRIVER_COMPLETE          1
#define  SQL_DRIVER_COMPLETE_REQUIRED 1
#define  SQL_DRIVER_NOPROMPT          1

/*  Valid option codes for GetInfo procedure               */
#define  SQL_ACTIVE_CONNECTIONS    0
#define  SQL_ACTIVE_STATEMENTS     1
#define  SQL_PROCEDURES            2
#define  SQL_DBMS_NAME             17
#define  SQL_DBMS_VER              18
#define  SQL_MAX_COLUMN_NAME_LEN   30
#define  SQL_MAX_CURSOR_NAME_LEN   31
#define  SQL_MAX_OWNER_NAME_LEN    32
#define  SQL_MAX_SCHEMA_NAME_LEN   33
#define  SQL_MAX_TABLE_NAME_LEN    35

/* Standard SQL data types */
#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_DATETIME            9
#define  SQL_VARCHAR            12
#define  SQL_BLOB               13
#define  SQL_CLOB               14
#define  SQL_DBCLOB             15
#define  SQL_DATALINK           16
#define  SQL_WCHAR              17
#define  SQL_WVARCHAR           18
#define  SQL_BIGINT             19
#define  SQL_BLOB_LOCATOR       20
#define  SQL_CLOB_LOCATOR       21
#define  SQL_DBCLOB_LOCATOR     22
#define  SQL_WLONGVARCHAR       SQL_WVARCHAR
#define  SQL_LONGVARCHAR        SQL_VARCHAR
#define  SQL_GRAPHIC            95
#define  SQL_VARGRAPHIC         96
#define  SQL_LONGVARGRAPHIC     SQL_VARGRAPHIC
#define  SQL_BINARY             97
#define  SQL_VARBINARY          98
#define  SQL_LONGVARBINARY      SQL_VARBINARY
#define  SQL_DATE               91
#define  SQL_TYPE_DATE          91
#define  SQL_TIME               92
#define  SQL_TYPE_TIME          92
#define  SQL_TIMESTAMP          93
#define  SQL_TYPE_TIMESTAMP     93
#define  SQL_CODE_DATE           1
#define  SQL_CODE_TIME           2
#define  SQL_CODE_TIMESTAMP      3
#define  SQL_ALL_TYPES           0

/*
* NULL status defines; these are used in SQLColAttributes, SQLDescribeCol,
* to describe the nullability of a column in a table.
*/
#define  SQL_UNUSED                             0
#define  SQL_HANDLE_ENV                         1
#define  SQL_HANDLE_DBC                         2
#define  SQL_HANDLE_STMT                        3
#define  SQL_HANDLE_DESC                        4
#define  SQL_NULL_HANDLE                        0

#define  SQL_NO_NULLS         0
#define  SQL_NULLABLE         1
#define  SQL_NULLABLE_UNKNOWN 2

/* Special length values  */
#define  SQL_NULL_DATA       -1
#define  SQL_DATA_AT_EXEC    -2
#define  SQL_BIGINT_PREC     19
#define  SQL_INTEGER_PREC    10
#define  SQL_SMALLINT_PREC    5


/* SQLColAttributes defines */
#define  SQL_ATTR_READONLY            0
#define  SQL_ATTR_WRITE               1
#define  SQL_ATTR_READWRITE_UNKNOWN   2

/* Valid concurrency values */
#define  SQL_CONCUR_LOCK              0
#define  SQL_CONCUR_READ_ONLY         1

/*  Valid environment attributes                      */
#define SQL_ATTR_OUTPUT_NTS          10001
#define SQL_ATTR_SYS_NAMING          10002
#define SQL_ATTR_DEFAULT_LIB         10003
#define SQL_ATTR_SERVER_MODE         10004
#define SQL_ATTR_JOB_SORT_SEQUENCE   10005
#define SQL_ATTR_ENVHNDL_COUNTER     10009
#define SQL_ATTR_ESCAPE_CHAR         10010

/*  Valid environment/connection attributes           */
#define SQL_ATTR_DATE_FMT            10020
#define SQL_ATTR_DATE_SEP            10021
#define SQL_ATTR_TIME_FMT            10022
#define SQL_ATTR_TIME_SEP            10023
#define SQL_ATTR_DECIMAL_SEP         10024

/*  Valid environment/connection values               */
#define SQL_FMT_ISO                  1
#define SQL_FMT_USA                  2
#define SQL_FMT_EUR                  3
#define SQL_FMT_JIS                  4
#define SQL_FMT_MDY                  5
#define SQL_FMT_DMY                  6
#define SQL_FMT_YMD                  7
#define SQL_FMT_JUL                  8
#define SQL_FMT_HMS                  9
#define SQL_FMT_JOB                  10
#define SQL_SEP_SLASH                1
#define SQL_SEP_DASH                 2
#define SQL_SEP_PERIOD               3
#define SQL_SEP_COMMA                4
#define SQL_SEP_BLANK                5
#define SQL_SEP_COLON                6
#define SQL_SEP_JOB                  7

/*  Valid values for type in GetCol                                 */
#define SQL_DEFAULT              99
#define SQL_ARD_TYPE            -99

/*  Valid values for UPDATE_RULE and DELETE_RULE in SQLForeignKeys  */
#define SQL_CASCADE              1
#define SQL_RESTRICT             2
#define SQL_NO_ACTION            3
#define SQL_SET_NULL             4
#define SQL_SET_DEFAULT          5

/*  Valid values for COLUMN_TYPE in SQLProcedureColumns  */
#define SQL_PARAM_INPUT             1
#define SQL_PARAM_OUTPUT            2
#define SQL_PARAM_INPUT_OUTPUT      3

/* statement attributes */
#define SQL_ATTR_APP_ROW_DESC      10010
#define SQL_ATTR_APP_PARAM_DESC    10011
#define SQL_ATTR_IMP_ROW_DESC      10012
#define SQL_ATTR_IMP_PARAM_DESC    10013
#define SQL_ATTR_FOR_FETCH_ONLY    10014
#define SQL_ATTR_CONCURRENCY       10014
#define SQL_CONCURRENCY            10014
#define SQL_ATTR_CURSOR_SCROLLABLE 10015
#define SQL_ATTR_ROWSET_SIZE       10016
#define SQL_ROWSET_SIZE            10016

/*  Codes used in FetchScroll                                       */
#define SQL_FETCH_NEXT                   1
#define SQL_FETCH_FIRST                  2
#define SQL_FETCH_LAST                   3
#define SQL_FETCH_PRIOR                  4
#define SQL_FETCH_ABSOLUTE               5
#define SQL_FETCH_RELATIVE               6

/* SQLColAttributes defines */
#define SQL_DESC_COUNT                   1
#define SQL_DESC_TYPE                    2
#define SQL_DESC_LENGTH                  3
#define SQL_DESC_LENGTH_PTR              4
#define SQL_DESC_PRECISION               5
#define SQL_DESC_SCALE                   6
#define SQL_DESC_DATETIME_INTERVAL_CODE  7
#define SQL_DESC_NULLABLE                8
#define SQL_DESC_INDICATOR_PTR           9
#define SQL_DESC_DATA_PTR                10
#define SQL_DESC_NAME                    11
#define SQL_DESC_UNNAMED                 12
#define SQL_DESC_DISPLAY_SIZE            13
#define SQL_DESC_ALLOC_TYPE              99
#define SQL_DESC_ALLOC_AUTO              1
#define SQL_DESC_ALLOC_USER              2

#define SQL_COLUMN_COUNT                   1
#define SQL_COLUMN_TYPE                    2
#define SQL_COLUMN_LENGTH                  3
#define SQL_COLUMN_LENGTH_PTR              4
#define SQL_COLUMN_PRECISION               5
#define SQL_COLUMN_SCALE                   6
#define SQL_COLUMN_DATETIME_INTERVAL_CODE  7
#define SQL_COLUMN_NULLABLE                8
#define SQL_COLUMN_INDICATOR_PTR           9
#define SQL_COLUMN_DATA_PTR                10
#define SQL_COLUMN_NAME                    11
#define SQL_COLUMN_UNNAMED                 12
#define SQL_COLUMN_DISPLAY_SIZE            13
#define SQL_COLUMN_ALLOC_TYPE              99
#define SQL_COLUMN_ALLOC_AUTO              1
#define SQL_COLUMN_ALLOC_USER              2

/*  Valid codes for SpecialColumns procedure              */
#define SQL_SCOPE_CURROW         0
#define SQL_SCOPE_TRANSACTION    1
#define SQL_SCOPE_SESSION        2
#define SQL_PC_UNKNOWN           0
#define SQL_PC_NOT_PSEUDO        1
#define SQL_PC_PSEUDO            2

/*  Valid values for connect attribute                     */
#define SQL_ATTR_AUTO_IPD       10001
#define SQL_ATTR_ACCESS_MODE    10002
#define SQL_ACCESS_MODE         10002
#define SQL_ATTR_AUTOCOMMIT     10003
#define SQL_AUTOCOMMIT          10003
#define SQL_ATTR_DBC_SYS_NAMING 10004
#define SQL_ATTR_DBC_DEFAULT_LIB 10005
#define SQL_ATTR_COMMIT             0
#define SQL_MODE_READ_ONLY          0
#define SQL_MODE_READ_WRITE         1
#define SQL_MODE_DEFAULT            1
#define SQL_AUTOCOMMIT_OFF          0
#define SQL_AUTOCOMMIT_ON           1
#define SQL_TXN_ISOLATION           0
#define SQL_COMMIT_NONE             1
#define SQL_TXN_NO_COMMIT           1
#define SQL_TXN_NOCOMMIT            1
#define SQL_COMMIT_CHG              2
#define SQL_COMMIT_UR               2
#define SQL_TXN_READ_UNCOMMITTED    2
#define SQL_COMMIT_CS               3
#define SQL_TXN_READ_COMMITTED      3
#define SQL_COMMIT_ALL              4
#define SQL_COMMIT_RS               4
#define SQL_TXN_REPEATABLE_READ     4
#define SQL_COMMIT_RR               5
#define SQL_TXN_SERIALIZABLE        5

/*  Valid index flags                         */
#define SQL_INDEX_UNIQUE            0
#define SQL_INDEX_ALL               1
#define SQL_INDEX_OTHER             3

/*  Valid File Options                        */
#define SQL_FILE_READ               2
#define SQL_FILE_CREATE             8
#define SQL_FILE_OVERWRITE         16
#define SQL_FILE_APPEND            32

/* Valid types for GetDiagField                           */
#define SQL_DIAG_RETURNCODE         1
#define SQL_DIAG_NUMBER             2
#define SQL_DIAG_ROW_COUNT          3
#define SQL_DIAG_SQLSTATE           4
#define SQL_DIAG_NATIVE             5
#define SQL_DIAG_MESSAGE_TEXT       6
#define SQL_DIAG_DYNAMIC_FUNCTION   7
#define SQL_DIAG_CLASS_ORIGIN       8
#define SQL_DIAG_SUBCLASS_ORIGIN    9
#define SQL_DIAG_CONNECTION_NAME    10
#define SQL_DIAG_SERVER_NAME        11

/*
* SQLColAttributes defines
* These are also used by SQLGetInfo
*/
#define  SQL_UNSEARCHABLE             0
#define  SQL_LIKE_ONLY                1
#define  SQL_ALL_EXCEPT_LIKE          2
#define  SQL_SEARCHABLE               3

/* GetFunctions() values to identify CLI functions   */
#define  SQL_API_SQLALLOCCONNECT        1
#define  SQL_API_SQLALLOCENV            2
#define  SQL_API_SQLALLOCHANDLE      1001
#define  SQL_API_SQLALLOCSTMT           3
#define  SQL_API_SQLBINDCOL             4
#define  SQL_API_SQLBINDFILETOCOL    2002
#define  SQL_API_SQLBINDFILETOPARAM  2003
#define  SQL_API_SQLBINDPARAM        1002
#define  SQL_API_SQLBINDPARAMETER    1023
#define  SQL_API_SQLCANCEL              5
#define  SQL_API_SQLCLOSECURSOR      1003
#define  SQL_API_SQLCOLATTRIBUTES       6
#define  SQL_API_SQLCOLUMNS            40
#define  SQL_API_SQLCONNECT             7
#define  SQL_API_SQLCOPYDESC         1004
#define  SQL_API_SQLDATASOURCES        57
#define  SQL_API_SQLDESCRIBECOL         8
#define  SQL_API_SQLDESCRIBEPARAM      58
#define  SQL_API_SQLDISCONNECT          9
#define  SQL_API_SQLDRIVERCONNECT      68
#define  SQL_API_SQLENDTRAN          1005
#define  SQL_API_SQLERROR              10
#define  SQL_API_SQLEXECDIRECT         11
#define  SQL_API_SQLEXECUTE            12
#define  SQL_API_SQLEXTENDEDFETCH    1022
#define  SQL_API_SQLFETCH              13
#define  SQL_API_SQLFETCHSCROLL      1021
#define  SQL_API_SQLFOREIGNKEYS        60
#define  SQL_API_SQLFREECONNECT        14
#define  SQL_API_SQLFREEENV            15
#define  SQL_API_SQLFREEHANDLE       1006
#define  SQL_API_SQLFREESTMT           16
#define  SQL_API_SQLGETCOL             43
#define  SQL_API_SQLGETCONNECTATTR   1007
#define  SQL_API_SQLGETCONNECTOPTION   42
#define  SQL_API_SQLGETCURSORNAME      17
#define  SQL_API_SQLGETDATA            43
#define  SQL_API_SQLGETDESCFIELD     1008
#define  SQL_API_SQLGETDESCREC       1009
#define  SQL_API_SQLGETDIAGFIELD     1010
#define  SQL_API_SQLGETDIAGREC       1011
#define  SQL_API_SQLGETENVATTR       1012
#define  SQL_API_SQLGETFUNCTIONS       44
#define  SQL_API_SQLGETINFO            45
#define  SQL_API_SQLGETLENGTH        2004
#define  SQL_API_SQLGETPOSITION      2005
#define  SQL_API_SQLGETSTMTATTR      1014
#define  SQL_API_SQLGETSTMTOPTION      46
#define  SQL_API_SQLGETSUBSTRING     2006
#define  SQL_API_SQLGETTYPEINFO        47
#define  SQL_API_SQLLANGUAGES        2001
#define  SQL_API_SQLMORERESULTS        61
#define  SQL_API_SQLNATIVESQL          62
#define  SQL_API_SQLNUMPARAMS          63
#define  SQL_API_SQLNUMRESULTCOLS      18
#define  SQL_API_SQLPARAMDATA          48
#define  SQL_API_SQLPARAMOPTIONS     2007
#define  SQL_API_SQLPREPARE            19
#define  SQL_API_SQLPRIMARYKEYS        65
#define  SQL_API_SQLPROCEDURECOLUMNS   66
#define  SQL_API_SQLPROCEDURES         67
#define  SQL_API_SQLPUTDATA            49
#define  SQL_API_SQLRELEASEENV       1015
#define  SQL_API_SQLROWCOUNT           20
#define  SQL_API_SQLSETCONNECTATTR   1016
#define  SQL_API_SQLSETCONNECTOPTION   50
#define  SQL_API_SQLSETCURSORNAME      21
#define  SQL_API_SQLSETDESCFIELD     1017
#define  SQL_API_SQLSETDESCREC       1018
#define  SQL_API_SQLSETENVATTR       1019
#define  SQL_API_SQLSETPARAM           22
#define  SQL_API_SQLSETSTMTATTR      1020
#define  SQL_API_SQLSETSTMTOPTION      51
#define  SQL_API_SQLSPECIALCOLUMNS     52
#define  SQL_API_SQLSTATISTICS         53
#define  SQL_API_SQLTABLES             54
#define  SQL_API_SQLTRANSACT           23

/* NULL handle defines    */
#define  SQL_NULL_HENV                0L
#define  SQL_NULL_HDBC                0L
#define  SQL_NULL_HSTMT               0L

#if !defined(SDWORD)
typedef long int            SDWORD;
#endif
#if !defined(UDWORD)
typedef unsigned long int   UDWORD;
#endif
#if !defined(UWORD)
typedef unsigned short int  UWORD;
#endif
#if !defined(SWORD)
typedef signed short int    SWORD;
#endif

typedef  char              SQLCHAR;
typedef  long     int      SQLINTEGER;
typedef  short    int      SQLSMALLINT;
typedef  UWORD             SQLUSMALLINT;
typedef  UDWORD            SQLUINTEGER;
typedef  double            SQLDOUBLE;
typedef  float             SQLREAL;

typedef  void *            PTR;
typedef  PTR               SQLPOINTER;
typedef  long              HENV;
typedef  long              HDBC;
typedef  long              HSTMT;
typedef  long              HDESC;
typedef  HENV              SQLHENV;
typedef  HDBC              SQLHDBC;
typedef  HSTMT             SQLHSTMT;
typedef  HDESC             SQLHDESC;

typedef  SQLINTEGER        RETCODE;
typedef  RETCODE           SQLRETURN;

typedef  float             SFLOAT;



/*
* DATE, TIME, and TIMESTAMP structures.  These are for compatibility
* purposes only.  When actually specifying or retrieving DATE, TIME,
* and TIMESTAMP values, character strings must be used.
*/


typedef  struct DATE_STRUCT
  {
    SQLSMALLINT   year;
    SQLSMALLINT   month;
    SQLSMALLINT   day;
  } DATE_STRUCT;

typedef  struct TIME_STRUCT
  {
    SQLSMALLINT   hour;
    SQLSMALLINT   minute;
    SQLSMALLINT   second;
  } TIME_STRUCT;

typedef  struct TIMESTAMP_STRUCT
  {
    SQLSMALLINT   year;
    SQLSMALLINT   month;
    SQLSMALLINT   day;
    SQLSMALLINT   hour;
    SQLSMALLINT   minute;
    SQLSMALLINT   second;
    SQLINTEGER    fraction;     /* fraction of a second */
  } TIMESTAMP_STRUCT;






SQL_EXTERN SQLRETURN  SQLAllocConnect (SQLHENV              henv,
                                   SQLHDBC             *phdbc);


SQL_EXTERN SQLRETURN  SQLAllocEnv     (SQLHENV             *phenv);

SQL_EXTERN SQLRETURN  SQLAllocHandle  (SQLSMALLINT           htype,
                                   SQLINTEGER            ihnd,
                                   SQLINTEGER           *ohnd);

SQL_EXTERN SQLRETURN  SQLAllocStmt    (SQLHDBC           hdbc,
                                   SQLHSTMT         *phstmt);

SQL_EXTERN SQLRETURN  SQLBindCol      (SQLHSTMT          hstmt,
                                   SQLSMALLINT       icol,
                                   SQLSMALLINT       iType,
                                   SQLPOINTER        rgbValue,
                                   SQLINTEGER        cbValueMax,
                                   SQLINTEGER       *pcbValue);

SQL_EXTERN SQLRETURN  SQLBindFileToCol (SQLHSTMT          hstmt,
                                   SQLSMALLINT       icol,
                                   SQLCHAR          *fName,
                                   SQLSMALLINT      *fNameLen,
                                   SQLINTEGER       *fOptions,
                                   SQLSMALLINT       fValueMax,
                                   SQLINTEGER       *sLen,
                                   SQLINTEGER       *pcbValue);

SQL_EXTERN SQLRETURN  SQLBindFileToParam (SQLHSTMT          hstmt,
                                   SQLSMALLINT       ipar,
                                   SQLSMALLINT       iType,
                                   SQLCHAR          *fName,
                                   SQLSMALLINT      *fNameLen,
                                   SQLINTEGER       *fOptions,
                                   SQLSMALLINT       fValueMax,
                                   SQLINTEGER       *pcbValue);

SQL_EXTERN SQLRETURN  SQLBindParam    (SQLHSTMT          hstmt,
                                   SQLSMALLINT       iparm,
                                   SQLSMALLINT       iType,
                                   SQLSMALLINT       pType,
                                   SQLINTEGER        pLen,
                                   SQLSMALLINT       pScale,
                                   SQLPOINTER        pData,
                                   SQLINTEGER       *pcbValue);

SQL_EXTERN SQLRETURN  SQLBindParameter (SQLHSTMT          hstmt,
                                   SQLSMALLINT       ipar,
                                   SQLSMALLINT       fParamType,
                                   SQLSMALLINT       fCType,
                                   SQLSMALLINT       fSQLType,
                                   SQLINTEGER        pLen,
                                   SQLSMALLINT       pScale,
                                   SQLPOINTER        pData,
                                   SQLINTEGER        cbValueMax,
                                   SQLINTEGER       *pcbValue);

SQL_EXTERN SQLRETURN  SQLCancel       (SQLHSTMT          hstmt);

SQL_EXTERN SQLRETURN  SQLCloseCursor  (SQLHSTMT          hstmt);

SQL_EXTERN SQLRETURN  SQLColAttributes (SQLHSTMT          hstmt,
                                    SQLSMALLINT       icol,
                                    SQLSMALLINT       fDescType,
                                    SQLCHAR          *rgbDesc,
                                    SQLINTEGER        cbDescMax,
                                    SQLINTEGER       *pcbDesc,
                                    SQLINTEGER       *pfDesc);

SQL_EXTERN SQLRETURN   SQLColumns    (SQLHSTMT       hstmt,
                                  SQLCHAR        *szTableQualifier,
                                  SQLSMALLINT    cbTableQualifier,
                                  SQLCHAR        *szTableOwner,
                                  SQLSMALLINT    cbTableOwner,
                                  SQLCHAR        *szTableName,
                                  SQLSMALLINT    cbTableName,
                                  SQLCHAR        *szColumnName,
                                  SQLSMALLINT    cbColumnName);

SQL_EXTERN SQLRETURN  SQLConnect    (SQLHDBC           hdbc,
                                 SQLCHAR          *szDSN,
                                 SQLSMALLINT       cbDSN,
                                 SQLCHAR          *szUID,
                                 SQLSMALLINT       cbUID,
                                 SQLCHAR          *szAuthStr,
                                 SQLSMALLINT       cbAuthStr);

SQL_EXTERN SQLRETURN  SQLCopyDesc   (SQLHDESC   sDesc,
                                 SQLHDESC   tDesc);

SQL_EXTERN SQLRETURN  SQLDataSources (SQLHENV       henv,
                                      SQLSMALLINT   fDirection,
                                      SQLCHAR      *szDSN,
                                      SQLSMALLINT   cbDSNMax,
                                      SQLSMALLINT  *pcbDSN,
                                      SQLCHAR      *szDescription,
                                      SQLSMALLINT   cbDescriptionMax,
                                      SQLSMALLINT  *pcbDescription);

SQL_EXTERN SQLRETURN  SQLDescribeCol (SQLHSTMT          hstmt,
                                  SQLSMALLINT       icol,
                                  SQLCHAR          *szColName,
                                  SQLSMALLINT       cbColNameMax,
                                  SQLSMALLINT      *pcbColName,
                                  SQLSMALLINT      *pfSqlType,
                                  SQLINTEGER       *pcbColDef,
                                  SQLSMALLINT      *pibScale,
                                  SQLSMALLINT      *pfNullable);

SQL_EXTERN SQLRETURN  SQLDescribeParam (SQLHSTMT          hstmt,
                                  SQLSMALLINT       ipar,
                                  SQLSMALLINT      *pfSqlType,
                                  SQLINTEGER       *pcbColDef,
                                  SQLSMALLINT      *pibScale,
                                  SQLSMALLINT      *pfNullable);

SQL_EXTERN SQLRETURN  SQLDisconnect  (SQLHDBC              hdbc);

SQL_EXTERN SQLRETURN  SQLDriverConnect (SQLHDBC              hdbc,
                                        SQLPOINTER           hwnd,
                                        SQLCHAR      *szConnStrIn,
                                        SQLSMALLINT   cbConnStrin,
                                        SQLCHAR      *szConnStrOut,
                                        SQLSMALLINT  cbConnStrOutMax,
                                        SQLSMALLINT  *pcbConnStrOut,
                                        SQLSMALLINT fDriverCompletion);

SQL_EXTERN SQLRETURN  SQLEndTran     (SQLSMALLINT          htype,
                                  SQLHENV              henv,
                                  SQLSMALLINT          ctype);

SQL_EXTERN SQLRETURN  SQLError       (SQLHENV              henv,
                                  SQLHDBC              hdbc,
                                  SQLHSTMT             hstmt,
                                  SQLCHAR          *szSqlState,
                                  SQLINTEGER       *pfNativeError,
                                  SQLCHAR          *szErrorMsg,
                                  SQLSMALLINT       cbErrorMsgMax,
                                  SQLSMALLINT      *pcbErrorMsg);

SQL_EXTERN SQLRETURN  SQLExecDirect  (SQLHSTMT             hstmt,
                                  SQLCHAR          *szSqlStr,
                                  SQLINTEGER        cbSqlStr);

SQL_EXTERN SQLRETURN  SQLExecute     (SQLHSTMT             hstmt);

SQL_EXTERN SQLRETURN  SQLExtendedFetch (SQLHSTMT             hstmt,
                                    SQLSMALLINT          fOrient,
                                    SQLINTEGER           fOffset,
                                    SQLINTEGER          *pcrow,
                                    SQLSMALLINT         *rgfRowStatus);

SQL_EXTERN SQLRETURN  SQLFetch       (SQLHSTMT             hstmt);

SQL_EXTERN SQLRETURN  SQLFetchScroll (SQLHSTMT             hstmt,
                                      SQLSMALLINT          fOrient,
                                      SQLINTEGER           fOffset);

SQL_EXTERN SQLRETURN  SQLForeignKeys (SQLHSTMT          hstmt,
                                  SQLCHAR          *szPkTableQualifier,
                                  SQLSMALLINT       cbPkTableQualifier,
                                  SQLCHAR          *szPkTableOwner,
                                  SQLSMALLINT       cbPkTableOwner,
                                  SQLCHAR          *szPkTableName,
                                  SQLSMALLINT       cbPkTableName,
                                  SQLCHAR          *szFkTableQualifier,
                                  SQLSMALLINT       cbFkTableQualifier,
                                  SQLCHAR          *szFkTableOwner,
                                  SQLSMALLINT       cbFkTableOwner,
                                  SQLCHAR          *szFkTableName,
                                  SQLSMALLINT       cbFkTableName);

SQL_EXTERN SQLRETURN  SQLFreeConnect (SQLHDBC              hdbc);

SQL_EXTERN SQLRETURN  SQLFreeEnv     (SQLHENV              henv);

SQL_EXTERN SQLRETURN  SQLFreeStmt    (SQLHSTMT             hstmt,
                                  SQLSMALLINT          fOption);

SQL_EXTERN SQLRETURN  SQLFreeHandle  (SQLSMALLINT          htype,
                                  SQLINTEGER           hndl);

SQL_EXTERN SQLRETURN  SQLGetCol      (SQLHSTMT             hstmt,
                                  SQLSMALLINT          icol,
                                  SQLSMALLINT          itype,
                                  SQLPOINTER           tval,
                                  SQLINTEGER           blen,
                                  SQLINTEGER          *olen);

SQL_EXTERN SQLRETURN  SQLGetConnectAttr (SQLHDBC              hdbc,
                                     SQLINTEGER           attr,
                                     SQLPOINTER           oval,
                                     SQLINTEGER           ilen,
                                     SQLINTEGER          *olen);

SQL_EXTERN SQLRETURN  SQLGetConnectOption (SQLHDBC              hdbc,
                                       SQLSMALLINT          iopt,
                                       SQLPOINTER           oval);

SQL_EXTERN SQLRETURN  SQLGetCursorName (SQLHSTMT             hstmt,
                                    SQLCHAR          *szCursor,
                                    SQLSMALLINT       cbCursorMax,
                                    SQLSMALLINT      *pcbCursor);

SQL_EXTERN SQLRETURN  SQLGetData     (SQLHSTMT          hstmt,
                                  SQLSMALLINT       icol,
                                  SQLSMALLINT       fCType,
                                  SQLPOINTER        rgbValue,
                                  SQLINTEGER        cbValueMax,
                                  SQLINTEGER       *pcbValue);

SQL_EXTERN SQLRETURN SQLGetDescField (SQLHDESC             hdesc,
                                  SQLSMALLINT          rcdNum,
                                  SQLSMALLINT          fieldID,
                                  SQLPOINTER           fValue,
                                  SQLINTEGER           fLength,
                                  SQLINTEGER          *stLength);

SQL_EXTERN SQLRETURN SQLGetDescRec   (SQLHDESC             hdesc,
                                  SQLSMALLINT          rcdNum,
                                  SQLCHAR             *fname,
                                  SQLSMALLINT          bufLen,
                                  SQLSMALLINT         *sLength,
                                  SQLSMALLINT         *sType,
                                  SQLSMALLINT         *sbType,
                                  SQLINTEGER          *fLength,
                                  SQLSMALLINT         *fprec,
                                  SQLSMALLINT         *fscale,
                                  SQLSMALLINT         *fnull);

SQL_EXTERN SQLRETURN SQLGetDiagField (SQLSMALLINT         hType,
                                  SQLINTEGER          hndl,
                                  SQLSMALLINT         rcdNum,
                                  SQLSMALLINT         diagID,
                                  SQLPOINTER          dValue,
                                  SQLSMALLINT         bLength,
                                  SQLSMALLINT        *sLength);

SQL_EXTERN SQLRETURN SQLGetDiagRec   (SQLSMALLINT         hType,
                                  SQLINTEGER          hndl,
                                  SQLSMALLINT         rcdNum,
                                  SQLCHAR            *SQLstate,
                                  SQLINTEGER         *SQLcode,
                                  SQLCHAR            *msgText,
                                  SQLSMALLINT         bLength,
                                  SQLSMALLINT        *SLength);

SQL_EXTERN SQLRETURN SQLGetEnvAttr  (SQLHENV    hEnv,
                                 SQLINTEGER fAttribute,
                                 SQLPOINTER pParam,
                                 SQLINTEGER cbParamMax,
                                 SQLINTEGER * pcbParam);

SQL_EXTERN SQLRETURN  SQLGetFunctions  (SQLHDBC        hdbc,
                                    SQLSMALLINT    fFunction,
                                    SQLSMALLINT    *pfExists);

SQL_EXTERN SQLRETURN  SQLGetInfo       (SQLHDBC        hdbc,
                                    SQLSMALLINT    fInfoType,
                                    SQLPOINTER     rgbInfoValue,
                                    SQLSMALLINT    cbInfoValueMax,
                                    SQLSMALLINT    *pcbInfoValue);

SQL_EXTERN SQLRETURN  SQLGetLength (SQLHSTMT       hstmt,
                                    SQLSMALLINT    locType,
                                    SQLINTEGER     locator,
                                    SQLINTEGER    *sLength,
                                    SQLINTEGER    *ind);

SQL_EXTERN SQLRETURN  SQLGetPosition (SQLHSTMT       hstmt,
                                    SQLSMALLINT    locType,
                                    SQLINTEGER     srceLocator,
                                    SQLINTEGER     srchLocator,
                                    SQLCHAR       *srchLiteral,
                                    SQLINTEGER     srchLiteralLen,
                                    SQLINTEGER     fPosition,
                                    SQLINTEGER    *located,
                                    SQLINTEGER    *ind);

SQL_EXTERN SQLRETURN  SQLGetStmtAttr   (SQLHSTMT       hstmt,
                                    SQLINTEGER     fAttr,
                                    SQLPOINTER     pvParam,
                                    SQLINTEGER     bLength,
                                    SQLINTEGER    *SLength);

SQL_EXTERN SQLRETURN  SQLGetStmtOption (SQLHSTMT       hstmt,
                                    SQLSMALLINT    fOption,
                                    SQLPOINTER     pvParam);

SQL_EXTERN SQLRETURN  SQLGetSubString (SQLHSTMT       hstmt,
                                    SQLSMALLINT    locType,
                                    SQLINTEGER     srceLocator,
                                    SQLINTEGER     fPosition,
                                    SQLINTEGER     length,
                                    SQLSMALLINT    tType,
                                    SQLPOINTER     rgbValue,
                                    SQLINTEGER     cbValueMax,
                                    SQLINTEGER    *StringLength,
                                    SQLINTEGER    *ind);

SQL_EXTERN SQLRETURN  SQLGetTypeInfo   (SQLHSTMT       hstmt,
                                    SQLSMALLINT    fSqlType);

SQL_EXTERN SQLRETURN  SQLLanguages   (SQLHSTMT          hstmt);

SQL_EXTERN SQLRETURN  SQLMoreResults (SQLHSTMT          hstmt);

SQL_EXTERN SQLRETURN  SQLNativeSql   (SQLHDBC           hdbc,
                                      SQLCHAR          *szSqlStrIn,
                                      SQLINTEGER        cbSqlStrIn,
                                      SQLCHAR          *szSqlStr,
                                      SQLINTEGER        cbSqlStrMax,
                                      SQLINTEGER       *pcbSqlStr);

SQL_EXTERN SQLRETURN  SQLNumParams (SQLHSTMT            hstmt,
                                    SQLSMALLINT      *pcpar);

SQL_EXTERN SQLRETURN  SQLNumResultCols (SQLHSTMT        hstmt,
                                    SQLSMALLINT      *pccol);

SQL_EXTERN SQLRETURN  SQLParamData   (SQLHSTMT          hstmt,
                                  SQLPOINTER          *Value);

SQL_EXTERN SQLRETURN  SQLParamOptions (SQLHSTMT         hstmt,
                                  SQLINTEGER          crow,
                                  SQLINTEGER          *pirow);

SQL_EXTERN SQLRETURN  SQLPrepare     (SQLHSTMT          hstmt,
                                  SQLCHAR          *szSqlStr,
                                  SQLSMALLINT       cbSqlStr);

SQL_EXTERN SQLRETURN  SQLPrimaryKeys (SQLHSTMT          hstmt,
                                  SQLCHAR          *szTableQualifier,
                                  SQLSMALLINT       cbTableQualifier,
                                  SQLCHAR          *szTableOwner,
                                  SQLSMALLINT       cbTableOwner,
                                  SQLCHAR          *szTableName,
                                  SQLSMALLINT       cbTableName);

SQL_EXTERN SQLRETURN  SQLProcedureColumns (SQLHSTMT          hstmt,
                                  SQLCHAR          *szProcQualifier,
                                  SQLSMALLINT       cbProcQualifier,
                                  SQLCHAR          *szProcOwner,
                                  SQLSMALLINT       cbProcOwner,
                                  SQLCHAR          *szProcName,
                                  SQLSMALLINT       cbProcName,
                                  SQLCHAR          *szColumnName,
                                  SQLSMALLINT       cbColumnName);

SQL_EXTERN SQLRETURN  SQLProcedures (SQLHSTMT          hstmt,
                                  SQLCHAR          *szProcQualifier,
                                  SQLSMALLINT       cbProcQualifier,
                                  SQLCHAR          *szProcOwner,
                                  SQLSMALLINT       cbProcOwner,
                                  SQLCHAR          *szProcName,
                                  SQLSMALLINT       cbProcName);

SQL_EXTERN SQLRETURN  SQLPutData     (SQLHSTMT             hstmt,
                                  SQLPOINTER           Data,
                                  SQLINTEGER           SLen);

SQL_EXTERN SQLRETURN  SQLReleaseEnv     (SQLHENV           henv);

SQL_EXTERN SQLRETURN  SQLRowCount    (SQLHSTMT           hstmt,
                                  SQLINTEGER         *pcrow);

SQL_EXTERN SQLRETURN  SQLSetConnectAttr   (SQLHDBC        hdbc,
                                       SQLINTEGER     attrib,
                                       SQLPOINTER     vParam,
                                       SQLINTEGER     inlen);

SQL_EXTERN SQLRETURN  SQLSetConnectOption (SQLHDBC        hdbc,
                                       SQLSMALLINT    fOption,
                                       SQLPOINTER     vParam);

SQL_EXTERN SQLRETURN  SQLSetCursorName (SQLHSTMT             hstmt,
                                    SQLCHAR          *szCursor,
                                    SQLSMALLINT       cbCursor);

SQL_EXTERN SQLRETURN  SQLSetDescField  (SQLHDESC          hdesc,
                                    SQLSMALLINT       rcdNum,
                                    SQLSMALLINT       fID,
                                    SQLPOINTER        Value,
                                    SQLINTEGER        buffLen);

SQL_EXTERN SQLRETURN  SQLSetDescRec    (SQLHDESC          hdesc,
                                    SQLSMALLINT       rcdNum,
                                    SQLSMALLINT       Type,
                                    SQLSMALLINT       subType,
                                    SQLINTEGER        fLength,
                                    SQLSMALLINT       fPrec,
                                    SQLSMALLINT       fScale,
                                    SQLPOINTER        Value,
                                    SQLINTEGER       *sLength,
                                    SQLSMALLINT      *indic);

SQL_EXTERN SQLRETURN  SQLSetEnvAttr( SQLHENV hEnv,
                                 SQLINTEGER fAttribute,
                                 SQLPOINTER pParam,
                                 SQLINTEGER cbParam);

SQL_EXTERN SQLRETURN  SQLSetParam      (SQLHSTMT             hstmt,
                                    SQLSMALLINT       ipar,
                                    SQLSMALLINT       fCType,
                                    SQLSMALLINT       fSqlType,
                                    SQLINTEGER        cbColDef,
                                    SQLSMALLINT       ibScale,
                                    SQLPOINTER        rgbValue,
                                    SQLINTEGER       *pcbValue);

SQL_EXTERN SQLRETURN  SQLSetStmtAttr (SQLHSTMT       hstmt,
                                  SQLINTEGER     fAttr,
                                  SQLPOINTER     pParam,
                                  SQLINTEGER     vParam);

SQL_EXTERN SQLRETURN  SQLSetStmtOption (SQLHSTMT          hstmt,
                                    SQLSMALLINT    fOption,
                                    SQLPOINTER     vParam);

SQL_EXTERN SQLRETURN SQLSpecialColumns (SQLHSTMT       hstmt,
                                    SQLSMALLINT    fColType,
                                    SQLCHAR        *szTableQual,
                                    SQLSMALLINT    cbTableQual,
                                    SQLCHAR        *szTableOwner,
                                    SQLSMALLINT    cbTableOwner,
                                    SQLCHAR        *szTableName,
                                    SQLSMALLINT    cbTableName,
                                    SQLSMALLINT    fScope,
                                    SQLSMALLINT    fNullable);

SQL_EXTERN SQLRETURN  SQLStatistics    (SQLHSTMT       hstmt,
                                    SQLCHAR        *szTableQualifier,
                                    SQLSMALLINT    cbTableQualifier,
                                    SQLCHAR        *szTableOwner,
                                    SQLSMALLINT    cbTableOwner,
                                    SQLCHAR        *szTableName,
                                    SQLSMALLINT    cbTableName,
                                    SQLSMALLINT    fUnique,
                                    SQLSMALLINT    fres);

SQL_EXTERN SQLRETURN SQLTables        (SQLHSTMT       hstmt,
                                   SQLCHAR        *szTableQualifier,
                                   SQLSMALLINT    cbTableQualifier,
                                   SQLCHAR        *szTableOwner,
                                   SQLSMALLINT    cbTableOwner,
                                   SQLCHAR        *szTableName,
                                   SQLSMALLINT    cbTableName,
                                   SQLCHAR        *szTableType,
                                   SQLSMALLINT    cbTableType);

SQL_EXTERN SQLRETURN  SQLTransact      (SQLHENV              henv,
                                    SQLHDBC              hdbc,
                                    SQLSMALLINT       fType);


#define FAR
#define  SQL_SQLSTATE_SIZE         5   /* size of SQLSTATE, not including
                                          null terminating byte               */
#define  SQL_MAX_DSN_LENGTH       18   /* maximum data source name size       */
#define  SQL_MAX_ID_LENGTH        18   /* maximum identifier name size,
                                          e.g. cursor names                   */

#define SQL_MAX_STMT_SIZ       32767   /* Maximum statement size              */

#define SQL_MAXRECL            32766   /* Maximum record length               */

#define SQL_SMALL_LENGTH       2       /* Size of a SMALLINT                  */
#define SQL_MAXSMALLVAL        32767   /* Maximum value of a SMALLINT         */
#define SQL_MINSMALLVAL (-(SQL_MAXSMALLVAL)-1) /* Minimum value of a SMALLINT */
#define SQL_INT_LENGTH         4       /* Size of an INTEGER                  */
#define SQL_MAXINTVAL          2147483647 /* Maximum value of an INTEGER      */
#define SQL_MININTVAL (-(SQL_MAXINTVAL)-1)/* Minimum value of an INTEGER      */
#define SQL_FLOAT_LENGTH       8       /* Size of a FLOAT                     */
#define SQL_DEFDEC_PRECISION   5       /* Default precision for DECIMAL       */
#define SQL_DEFDEC_SCALE       0       /* Default scale for DECIMAL           */
#define SQL_MAXDECIMAL         31      /* Maximum scale/prec. for DECIMAL     */
#define SQL_DEFCHAR            1       /* Default length for a CHAR           */
#define SQL_DEFWCHAR           1       /* Default length for a wchar_t        */
#define SQL_MAXCHAR            32766   /* Maximum length of a CHAR            */
#define SQL_MAXLSTR            255     /* Maximum length of an LSTRING        */
#define SQL_MAXVCHAR           32740   /* Maximum length of a         */
                                       /* VARCHAR                             */
#define SQL_MAXVGRAPH          16370   /* Maximum length of a VARGRAPHIC      */
#define SQL_MAXBLOB            15728640 /* Max. length of a BLOB host var   */
#define SQL_MAXCLOB            15728640 /* Max. length of a CLOB host var   */
#define SQL_MAXDBCLOB          7864320 /* Max. length of an DBCLOB host    */
                                       /* var                                 */
#define SQL_LONGMAX            32740   /* Maximum length of a LONG VARCHAR    */
#define SQL_LONGGRMAX          16370   /* Max. length of a LONG VARGRAPHIC    */
#define SQL_LVCHAROH           26      /* Overhead for LONG VARCHAR in        */
                                       /* record                              */
#define SQL_LOBCHAROH          312     /* Overhead for LOB in record          */
#define SQL_BLOB_MAXLEN        15728640 /* BLOB maximum length, in bytes    */
#define SQL_CLOB_MAXLEN        15728640 /* CLOB maximum length, in chars    */
#define SQL_DBCLOB_MAXLEN      7864320 /* maxlen for dbcs lobs             */
#define SQL_TIME_LENGTH        3       /* Size of a TIME field                */
#define SQL_TIME_STRLEN        8       /* Size of a TIME field output         */
#define SQL_TIME_MINSTRLEN     5       /* Size of a non-USA TIME field        */
                                       /* output without seconds              */
#define SQL_DATE_LENGTH        4       /* Size of a DATE field                */
#define SQL_DATE_STRLEN        10      /* Size of a DATE field output         */
#define SQL_STAMP_LENGTH       10      /* Size of a TIMESTAMP field           */
#define SQL_STAMP_STRLEN       26      /* Size of a TIMESTAMP field output    */
#define SQL_STAMP_MINSTRLEN    19      /* Size of a TIMESTAMP field output    */
                                       /* without microseconds                */
#define SQL_BOOLEAN_LENGTH     1       /* Size of a BOOLEAN field             */
#define SQL_IND_LENGTH         2       /* Size of an indicator value          */

#define SQL_MAX_PNAME_LENGTH   254     /* Max size of Stored Proc Name        */
#define SQL_LG_IDENT           18      /* Maximum length of Long Identifer    */
#define SQL_SH_IDENT           8       /* Maximum length of Short Identifer   */
#define SQL_MN_IDENT           1       /* Minimum length of Identifiers       */
#define SQL_MAX_VAR_NAME       30      /* Max size of Host Variable Name      */
#define SQL_KILO_VALUE         1024    /* # of bytes in a kilobyte            */
#define SQL_MEGA_VALUE         1048576 /* # of bytes in a megabyte            */
#define SQL_GIGA_VALUE         1073741824 /* # of bytes in a gigabyte         */

/* SQL extended data types (negative means unsupported) */
#define  SQL_TINYINT            -6
#define  SQL_BIT                -7

/* C data type to SQL data type mapping */
#define  SQL_C_CHAR       SQL_CHAR      /* CHAR, VARCHAR, DECIMAL, NUMERIC */
#define  SQL_C_LONG       SQL_INTEGER   /* INTEGER                         */
#define  SQL_C_SHORT      SQL_SMALLINT  /* SMALLINT                        */
#define  SQL_C_FLOAT      SQL_REAL      /* REAL                            */
#define  SQL_C_DOUBLE     SQL_DOUBLE    /* FLOAT, DOUBLE                   */
#define  SQL_C_DATE       SQL_DATE      /* DATE                            */
#define  SQL_C_TIME       SQL_TIME      /* TIME                            */
#define  SQL_C_TIMESTAMP  SQL_TIMESTAMP /* TIMESTAMP                       */
#define  SQL_C_BINARY     SQL_BINARY    /* BINARY, VARBINARY               */
#define  SQL_C_BIT        SQL_BIT
#define  SQL_C_TINYINT    SQL_TINYINT
#define  SQL_C_BIGINT     SQL_BIGINT
#define  SQL_C_DBCHAR     SQL_DBCLOB
#define  SQL_C_WCHAR      SQL_WCHAR     /* UNICODE                         */
#define  SQL_C_DATETIME   SQL_DATETIME  /* DATETIME                        */
#define  SQL_C_BLOB           SQL_BLOB
#define  SQL_C_CLOB           SQL_CLOB
#define  SQL_C_DBCLOB         SQL_DBCLOB
#define  SQL_C_BLOB_LOCATOR   SQL_BLOB_LOCATOR
#define  SQL_C_CLOB_LOCATOR   SQL_CLOB_LOCATOR
#define  SQL_C_DBCLOB_LOCATOR SQL_DBCLOB_LOCATOR



#define SQL_WARN_VAL_TRUNC                  "01004"


#endif /* SQL_H_SQLCLI */
 

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理