773 lines
22 KiB
C
Executable File
773 lines
22 KiB
C
Executable File
#ifndef UVOD_DCON_H
|
|
#define UVOD_DCON_H
|
|
/******************************************************************************
|
|
*
|
|
* Header file for ODBC Connection functions
|
|
*
|
|
* 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.........................................
|
|
* 04/07/99 24790 CSM Enhance UCI config file for OLEDB configuration
|
|
* 02/12/99 24501 CSM Add support for Unidata DBMStype
|
|
* 10/14/98 23801 SAP Change copyrights.
|
|
* 02/18/98 22611 RGA Add SQLstate IA000 for EXPLAIN output
|
|
* 11/25/97 21285 JBG msg 950260-1 NOWAIT SQL error return state 40001
|
|
* 09/30/97 21285 JBG NOWAIT SQL error return state 40001
|
|
* 09/25/97 21285 JBG NOWAIT SQL error return state 40001
|
|
* 06/26/97 20748 MJC Remove underscores for BASIC
|
|
* 06/26/97 20748 MJC Finish previous item
|
|
* 06/20/97 20748 MJC Finish previous item
|
|
* 06/17/97 20748 MJC Add config values for NLS
|
|
* 10/30/96 19512 ENF Define new precisions for BIGINT, LONG VARCHAR
|
|
* 09/13/96 18854 ENF Make sure only UNIVERSE and ODBC in menus
|
|
* 08/22/96 18854 ENF Disable all DBMS types but UNIVERSE and ODBC
|
|
* 07/22/96 18854 ENF Changes for ODBC middleware project
|
|
* 06/04/96 18573 EAP added LAN to NETopts
|
|
* 06/10/96 17832 HSB Map 950663 => S0011, 950664 => S0012, 950667 => S0022
|
|
* 06/29/95 15921 ENF Map 50003 => S1008; change MAXFETCHCOLS default
|
|
* 06/19/95 16689 MJC add 950316 to S0002
|
|
* 06/16/95 16689 MJC add 950311,950313,950596 to S0002
|
|
* 06/14/95 16689 MJC remove 950397
|
|
* 06/14/95 16689 MJC Add some more
|
|
* 06/13/95 16689 MJC Add many uV maperror codes
|
|
* 06/06/95 15921 ENF Add some universe maperror code
|
|
* 06/02/95 15921 ENF Change definition of MAXFETCHROWS to MAXFETCHCOLS
|
|
* 05/31/95 16490 FRA Port to SGI
|
|
* 05/19/95 15921 ENF Added S0001/S0002 default uniVerse MAPERRORs
|
|
* 02/13/95 15921 ENF Added uniVerse as a database type
|
|
*
|
|
*****************************************************************************/
|
|
|
|
/******************************************
|
|
* Header file and definitions used by
|
|
* the SQLConnect function FindDSN when we
|
|
* have to read the file looking for
|
|
* overrides for specific default items
|
|
******************************************/
|
|
#define YES 1
|
|
#define NO 0
|
|
|
|
/******************************************
|
|
* Define codes for each parameter allowed to
|
|
* be specified in the config file. This field
|
|
* will be used to determine which DBC field or
|
|
* flag bit will get the value specified
|
|
******************************************/
|
|
#define DEF_MAXCHAR 1
|
|
#define OPT_MAXCHAR "MAXCHAR"
|
|
|
|
#define DEF_MAXVARCHAR 2
|
|
#define OPT_MAXVARCHAR "MAXVARCHAR"
|
|
|
|
#define DEF_SMINTPREC 3
|
|
#define OPT_SMINTPREC "SMINTPREC"
|
|
|
|
#define DEF_INTPREC 4
|
|
#define OPT_INTPREC "INTPREC"
|
|
|
|
#define DEF_FLOATPREC 5
|
|
#define OPT_FLOATPREC "FLOATPREC"
|
|
|
|
#define DEF_DBLPREC 6
|
|
#define OPT_DBLPREC "DBLPREC"
|
|
|
|
#define DEF_DBMSTYPE 8
|
|
#define OPT_DBMSTYPE "DBMSTYPE"
|
|
|
|
#define DEF_DATEFORM 9
|
|
#define OPT_DATEFORM "DATEFORM"
|
|
|
|
/* Below values are the ones associated with Colributes */
|
|
#define DEF_PRECISION 11
|
|
#define OPT_PRECISION "PRECISION"
|
|
|
|
#define DEF_SCALE 12
|
|
#define OPT_SCALE "SCALE"
|
|
|
|
#define DEF_NULLABLE 13
|
|
#define OPT_NULLABLE "NULLABLE"
|
|
|
|
#define DEF_DSPSIZE 14
|
|
#define OPT_DSPSIZE "DSPSIZE"
|
|
|
|
#define DEF_UNSIGNED 15
|
|
#define OPT_UNSIGNED "UNSIGNED"
|
|
|
|
#define DEF_MONEY 16
|
|
#define OPT_MONEY "MONEY"
|
|
|
|
#define DEF_UPDATE 17
|
|
#define OPT_UPDATE "UPDATE"
|
|
|
|
#define DEF_AUTOINC 18
|
|
#define OPT_AUTOINC "AUTOINC"
|
|
|
|
#define DEF_CASE 19
|
|
#define OPT_CASE "CASE"
|
|
|
|
#define DEF_SEARCH 20
|
|
#define OPT_SEARCH "SEARCH"
|
|
|
|
#define DEF_TYPENAME 21
|
|
#define OPT_TYPENAME "TYPENAME"
|
|
|
|
#define DEF_MARKERNAME 22
|
|
#define OPT_MARKERNAME "MARKERNAME"
|
|
|
|
#define DEF_TXSTART 23
|
|
#define OPT_TXSTART "TXSTART" /* Text to start a transaction */
|
|
|
|
#define DEF_TXROLL 24
|
|
#define OPT_TXROLL "TXROLL" /* Text to roll back transaction */
|
|
|
|
#define DEF_TXCOMMIT 25
|
|
#define OPT_TXCOMMIT "TXCOMMIT" /* Text to commit a transaction */
|
|
|
|
/****Tells if we must do Describe after Exec. In most cases we do it at
|
|
**** the time we Associate it, but Sybase, for example, can't do that
|
|
****/
|
|
#define DEF_DESCB4EXEC 26
|
|
#define OPT_DESCB4EXEC "DESCB4EXEC"
|
|
|
|
/*** Use "SQLTYPE = SQL_TYPE = dbcode" to load the SQL type mapping array
|
|
*** with the datatype codes from the data source and their SQL representation
|
|
*** Each invocation of SQLTYPE will add the type to the Sqltypes array in
|
|
*** the Dsdefs section of the hdbc
|
|
***/
|
|
#define DEF_SQLTYPE 27
|
|
#define OPT_SQLTYPE "SQLTYPE"
|
|
|
|
/*** eodcode - Code returned by data source when we try to fetch beyond the
|
|
*** end of the data set. For uniVerse, we use it as the code to indicate
|
|
*** that no columns were produced in the operation
|
|
***/
|
|
#define DEF_EODCODE 28
|
|
#define OPT_EODCODE "EODCODE"
|
|
|
|
#define DEF_DATEPREC 29
|
|
#define OPT_DATEPREC "DATEPREC"
|
|
|
|
#define DEF_REALPREC 30
|
|
#define OPT_REALPREC "REALPREC"
|
|
|
|
/*** USETGITX controls whether or not the SQlink transaction control calls
|
|
*** are used for this database. If they are NOT used, it would ssem
|
|
*** mandatory that there be some text in TXSTART, TXROLL and TXCOMMIT.
|
|
***/
|
|
#define DEF_USETGITX 31
|
|
#define OPT_USETGITX "USETGITX"
|
|
|
|
#define DEF_MAPERROR 32
|
|
#define OPT_MAPERROR "MAPERROR"
|
|
|
|
/*** TXBEHAVIOR defines whether the data source is normally in auto commit
|
|
*** or manual commit. 0 => Manual, 1 => Auto
|
|
***/
|
|
#define DEF_TXBEHAVIOR 33
|
|
#define OPT_TXBEHAVIOR "TXBEHAVIOR"
|
|
|
|
/*** SSPPORTNUMBER determines which TCP/IP port number the client must use
|
|
*** to connect with the server
|
|
***/
|
|
#define DEF_SSPPORTNUMBER 34
|
|
#define OPT_SSPPORTNUMBER "SSPPORTNUMBER"
|
|
|
|
#define DEF_DATEFETCH 36
|
|
#define OPT_DATEFETCH "DATEFETCH"
|
|
|
|
/*** MAXFETCHBUFF is for uniVerse. It specifies how large a fetch buffer
|
|
*** the server should allocate to hold row data.
|
|
***/
|
|
#define DEF_MAXFETCHBUFF 37
|
|
#define OPT_MAXFETCHBUFF "MAXFETCHBUFF"
|
|
|
|
/*** MAXFETCHCOLS is also for uniVerse. It specifies the max number of
|
|
*** columns to buffer before sending results to the client. The default
|
|
*** of 0 causes the default of FETCH_HDR_SIZE to be used.
|
|
***/
|
|
#define DEF_MAXFETCHCOLS 38
|
|
#define OPT_MAXFETCHCOLS "MAXFETCHCOLS"
|
|
|
|
#define DEF_MAXLONGVARCHAR 39
|
|
#define OPT_MAXLONGVARCHAR "MAXLONGVARCHAR"
|
|
|
|
#define DEF_BIGINTPREC 40
|
|
#define OPT_BIGINTPREC "BIGINTPREC"
|
|
|
|
/*** UniVerse NLS options ***/
|
|
#define DEF_NLSMAP 41
|
|
#define OPT_NLSMAP "NLSMAP"
|
|
|
|
#define DEF_NLSLOCALE 42
|
|
#define OPT_NLSLOCALE "NLSLOCALE"
|
|
|
|
#define DEF_NLSLC_TIME 43
|
|
#define OPT_NLSLC_TIME "NLSLCTIME"
|
|
|
|
#define DEF_NLSLC_NUMERIC 44
|
|
#define OPT_NLSLC_NUMERIC "NLSLCNUMERIC"
|
|
|
|
#define DEF_NLSLC_MONETARY 45
|
|
#define OPT_NLSLC_MONETARY "NLSLCMONETARY"
|
|
|
|
#define DEF_NLSLC_CTYPE 46
|
|
#define OPT_NLSLC_CTYPE "NLSLCCTYPE"
|
|
|
|
#define DEF_NLSLC_COLLATE 47
|
|
#define OPT_NLSLC_COLLATE "NLSLCCOLLATE"
|
|
|
|
#define DEF_NLSLC_ALL 48
|
|
#define OPT_NLSLC_ALL "NLSLCALL"
|
|
|
|
#define DEF_ACCOUNT 49
|
|
#define OPT_ACCOUNT "ACCOUNT"
|
|
|
|
#define DEF_USERNAME 50
|
|
#define OPT_USERNAME "USERNAME"
|
|
|
|
/**** Options below here are for network declarations
|
|
****/
|
|
#define DEF_NETWTYPE 1000
|
|
#define OPT_NETWTYPE "NETWORK"
|
|
|
|
#define DEF_TCPIP 1001
|
|
#define OPT_TCPIP "TCP/IP"
|
|
|
|
#define DEF_HOST 1002
|
|
#define OPT_HOST "HOST"
|
|
|
|
#define DEF_SERVICE 1003
|
|
#define OPT_SERVICE "SERVICE"
|
|
|
|
#define DEF_LAN 1004
|
|
#define OPT_LAN "LAN"
|
|
|
|
/*** Define constants so we can deterime if the connection
|
|
*** is to be the local universe.
|
|
***/
|
|
|
|
#define LOCALHOSTNAME "localhost"
|
|
#define LOCALHOSTADDR "127.0.0.1"
|
|
|
|
/********************************************
|
|
* Table of valid SQL data types, and their names for
|
|
* when we process the SQLTYPE keyword and a
|
|
* list of Supported SQL types
|
|
********************************************/
|
|
struct sqltype_map{
|
|
char *name;
|
|
int sqltype;
|
|
};
|
|
|
|
struct sqltype_map Valid_sql_types[] = {
|
|
{"SQL_CHAR", SQL_CHAR},
|
|
{"SQL_VARCHAR", SQL_VARCHAR},
|
|
{"SQL_NUMERIC", SQL_NUMERIC},
|
|
{"SQL_DECIMAL", SQL_DECIMAL},
|
|
{"SQL_INTEGER", SQL_INTEGER},
|
|
{"SQL_SMALLINT",SQL_SMALLINT},
|
|
{"SQL_FLOAT", SQL_FLOAT},
|
|
{"SQL_REAL", SQL_REAL},
|
|
{"SQL_DOUBLE", SQL_DOUBLE},
|
|
{"SQL_DATE", SQL_DATE},
|
|
{"SQL_BINARY", SQL_BINARY},
|
|
{"", 0} /* The last entry */
|
|
|
|
};
|
|
|
|
#define NUM_VALID_SQL_TYPES sizeof(Valid_sql_types)/sizeof(struct sqltype_map)
|
|
|
|
struct sqltype_map Supp_sql_types[] = {
|
|
{"SQL_CHAR", SQL_CHAR},
|
|
{"SQL_VARCHAR", SQL_VARCHAR},
|
|
{"SQL_NUMERIC", SQL_NUMERIC},
|
|
{"SQL_DECIMAL", SQL_DECIMAL},
|
|
{"SQL_INTEGER", SQL_INTEGER},
|
|
{"SQL_SMALLINT",SQL_SMALLINT},
|
|
{"SQL_FLOAT", SQL_FLOAT},
|
|
{"SQL_REAL", SQL_REAL},
|
|
{"SQL_DOUBLE", SQL_DOUBLE},
|
|
{"SQL_DATE", SQL_DATE},
|
|
{"", 0} /* The last entry */
|
|
|
|
};
|
|
|
|
#define NUM_SUPP_SQL_TYPES sizeof(Supp_sql_types)/sizeof(struct sqltype_map)
|
|
|
|
|
|
typedef struct {
|
|
char *name;
|
|
int number;
|
|
} OPTION;
|
|
|
|
/* DBMSopts is the list of legal option keywords and their numeric values */
|
|
OPTION DBMSopts[] = {
|
|
OPT_MAXCHAR, DEF_MAXCHAR,
|
|
OPT_MAXVARCHAR, DEF_MAXVARCHAR,
|
|
OPT_SMINTPREC, DEF_SMINTPREC,
|
|
OPT_INTPREC, DEF_INTPREC,
|
|
OPT_FLOATPREC, DEF_FLOATPREC,
|
|
OPT_REALPREC, DEF_REALPREC,
|
|
OPT_DBLPREC, DEF_DBLPREC,
|
|
OPT_DATEFORM, DEF_DATEFORM,
|
|
OPT_PRECISION, DEF_PRECISION,
|
|
OPT_SCALE, DEF_SCALE,
|
|
OPT_NULLABLE, DEF_NULLABLE,
|
|
OPT_DSPSIZE, DEF_DSPSIZE,
|
|
OPT_UNSIGNED, DEF_UNSIGNED,
|
|
OPT_MONEY, DEF_MONEY,
|
|
OPT_UPDATE, DEF_UPDATE,
|
|
OPT_AUTOINC, DEF_AUTOINC,
|
|
OPT_CASE, DEF_CASE,
|
|
OPT_SEARCH, DEF_SEARCH,
|
|
OPT_TYPENAME, DEF_TYPENAME,
|
|
OPT_MARKERNAME, DEF_MARKERNAME,
|
|
OPT_TXSTART, DEF_TXSTART,
|
|
OPT_TXCOMMIT, DEF_TXCOMMIT,
|
|
OPT_TXROLL, DEF_TXROLL,
|
|
OPT_TXBEHAVIOR, DEF_TXBEHAVIOR,
|
|
OPT_USETGITX, DEF_USETGITX,
|
|
OPT_MAPERROR, DEF_MAPERROR,
|
|
OPT_DESCB4EXEC, DEF_DESCB4EXEC,
|
|
OPT_SQLTYPE, DEF_SQLTYPE,
|
|
OPT_EODCODE, DEF_EODCODE,
|
|
OPT_DATEPREC, DEF_DATEPREC,
|
|
OPT_DATEFETCH, DEF_DATEFETCH,
|
|
OPT_SSPPORTNUMBER, DEF_SSPPORTNUMBER,
|
|
OPT_MAXFETCHBUFF, DEF_MAXFETCHBUFF,
|
|
OPT_MAXFETCHCOLS, DEF_MAXFETCHCOLS,
|
|
OPT_MAXLONGVARCHAR, DEF_MAXLONGVARCHAR,
|
|
OPT_BIGINTPREC, DEF_BIGINTPREC,
|
|
OPT_NLSMAP, DEF_NLSMAP,
|
|
OPT_NLSLOCALE, DEF_NLSLOCALE,
|
|
OPT_NLSLC_TIME, DEF_NLSLC_TIME,
|
|
OPT_NLSLC_NUMERIC, DEF_NLSLC_NUMERIC,
|
|
OPT_NLSLC_MONETARY, DEF_NLSLC_MONETARY,
|
|
OPT_NLSLC_CTYPE, DEF_NLSLC_CTYPE,
|
|
OPT_NLSLC_COLLATE, DEF_NLSLC_COLLATE,
|
|
OPT_NLSLC_ALL, DEF_NLSLC_ALL,
|
|
|
|
OPT_NETWTYPE, DEF_NETWTYPE,
|
|
OPT_HOST, DEF_HOST,
|
|
OPT_SERVICE, DEF_SERVICE,
|
|
OPT_ACCOUNT, DEF_ACCOUNT,
|
|
OPT_USERNAME, DEF_USERNAME
|
|
};
|
|
#define NDBMSopts (sizeof(DBMSopts)/sizeof(DBMSopts[0]))
|
|
|
|
|
|
OPTION NETopts[] = {
|
|
OPT_TCPIP, DEF_TCPIP,
|
|
OPT_LAN, DEF_LAN
|
|
};
|
|
#define NNETopts (sizeof(NETopts)/sizeof(NETopts[0]))
|
|
|
|
/*** GENERICopts is the list of options applied to ALL data sources ***/
|
|
/*** THE NEXT LINE MUST NOT BE CHANGED OR MOVED. ***/
|
|
/*. SQLCO - Generic */
|
|
char *GENERICopts[] = {
|
|
"MAXCHAR = 255",
|
|
"MAXVARCHAR = 255",
|
|
"MAXLONGVARCHAR = 4096",
|
|
"SMINTPREC = 5",
|
|
"INTPREC = 10",
|
|
"BIGINTPREC = 20",
|
|
"FLOATPREC = 15",
|
|
"REALPREC = 7",
|
|
"DBLPREC = 15",
|
|
"DATEFORM = D2",
|
|
"PRECISION = YES",
|
|
"SCALE = NO",
|
|
"NULLABLE = NO",
|
|
"DSPSIZE = NO",
|
|
"UNSIGNED = NO",
|
|
"MONEY = NO",
|
|
"UPDATE = NO",
|
|
"AUTOINC = NO",
|
|
"CASE = NO",
|
|
"SEARCH = NO",
|
|
"TYPENAME = NO",
|
|
"MARKERNAME = NO",
|
|
"TXSTART = NONE",
|
|
"TXROLL = NONE",
|
|
"TXCOMMIT = NONE",
|
|
"TXBEHAVIOR = 0",
|
|
"SSPPORTNUMBER = 2000",
|
|
"USETGITX = YES",
|
|
"DESCB4EXEC = YES",
|
|
"EODCODE = -1",
|
|
"DATEPREC = 10",
|
|
"DATEFETCH = 10"
|
|
};
|
|
#define NGENERICopts (sizeof (GENERICopts)/sizeof (GENERICopts[0]))
|
|
|
|
/*** UNIVERSEopts are specific options for uniVerse. ***/
|
|
/*** THE NEXT LINE MUST NOT BE CHANGED OR MOVED. ***/
|
|
/*. SQLCO - DBMS -UNIVERSE- */
|
|
char *UNIVERSEopts[] = {
|
|
"MAXFETCHBUFF = 8192",
|
|
"MAXFETCHCOLS = 400",
|
|
"DATEFORM = D-YMD[4,2,2]",
|
|
"EODCODE = 930115",
|
|
"PRECISION = YES",
|
|
"SCALE = YES",
|
|
"NULLABLE = YES",
|
|
"DSPSIZE = YES",
|
|
"UNSIGNED = YES",
|
|
"MONEY = YES",
|
|
"UPDATE = YES",
|
|
"AUTOINC = NO",
|
|
"CASE = YES",
|
|
"SEARCH = YES",
|
|
"TXBEHAVIOR = 1",
|
|
"TYPENAME = YES",
|
|
"MAPERROR = 08001 = 930129",
|
|
"MAPERROR = 08004 = 930133",
|
|
"MAPERROR = 08004 = 930127",
|
|
"MAPERROR = 08004 = 930137",
|
|
"MAPERROR = 21S01 = 950059",
|
|
"MAPERROR = 21S02 = 950415",
|
|
"MAPERROR = 21S02 = 950417",
|
|
"MAPERROR = 22005 = 950043",
|
|
"MAPERROR = 22005 = 950121",
|
|
"MAPERROR = 22005 = 950122",
|
|
"MAPERROR = 22005 = 950169",
|
|
"MAPERROR = 22005 = 950617",
|
|
"MAPERROR = 23000 = 923012",
|
|
"MAPERROR = 23000 = 923013",
|
|
"MAPERROR = 23000 = 950136",
|
|
"MAPERROR = 23000 = 950568",
|
|
"MAPERROR = 23000 = 950645",
|
|
"MAPERROR = 40000 = 040065",
|
|
"MAPERROR = 40000 = 909046",
|
|
"MAPERROR = 40000 = 950604",
|
|
"MAPERROR = 40001 = 930157",
|
|
"MAPERROR = 40001 = 950251",
|
|
"MAPERROR = 40001 = 950259",
|
|
"MAPERROR = 40001 = 950260",
|
|
"MAPERROR = 40001 = 950261",
|
|
"MAPERROR = 42000 = 001397",
|
|
"MAPERROR = 42000 = 001422",
|
|
"MAPERROR = 42000 = 001423",
|
|
"MAPERROR = 42000 = 001424",
|
|
"MAPERROR = 42000 = 020142",
|
|
"MAPERROR = 42000 = 036010",
|
|
"MAPERROR = 42000 = 950072",
|
|
"MAPERROR = 42000 = 950076",
|
|
"MAPERROR = 42000 = 950078",
|
|
"MAPERROR = 42000 = 950131",
|
|
"MAPERROR = 42000 = 950303",
|
|
"MAPERROR = 42000 = 950304",
|
|
"MAPERROR = 42000 = 950305",
|
|
"MAPERROR = 42000 = 950306",
|
|
"MAPERROR = 42000 = 950338",
|
|
"MAPERROR = 42000 = 950343",
|
|
"MAPERROR = 42000 = 950350",
|
|
"MAPERROR = 42000 = 950352",
|
|
"MAPERROR = 42000 = 950361",
|
|
"MAPERROR = 42000 = 950362",
|
|
"MAPERROR = 42000 = 950365",
|
|
"MAPERROR = 42000 = 950391",
|
|
"MAPERROR = 42000 = 950392",
|
|
"MAPERROR = 42000 = 950393",
|
|
"MAPERROR = 42000 = 950394",
|
|
"MAPERROR = 42000 = 950395",
|
|
"MAPERROR = 42000 = 950398",
|
|
"MAPERROR = 42000 = 950405",
|
|
"MAPERROR = 42000 = 950406",
|
|
"MAPERROR = 42000 = 950407",
|
|
"MAPERROR = 42000 = 950408",
|
|
"MAPERROR = 42000 = 950409",
|
|
"MAPERROR = 42000 = 950534",
|
|
"MAPERROR = 42000 = 950538",
|
|
"MAPERROR = 42000 = 950539",
|
|
"MAPERROR = 42000 = 950540",
|
|
"MAPERROR = 42000 = 950541",
|
|
"MAPERROR = 42000 = 950546",
|
|
"MAPERROR = 42000 = 950548",
|
|
"MAPERROR = 42000 = 950563",
|
|
"MAPERROR = 42000 = 950588",
|
|
"MAPERROR = 42000 = 950590",
|
|
"MAPERROR = 42000 = 950607",
|
|
"MAPERROR = 42000 = 950609",
|
|
"MAPERROR = S0001 = 950458",
|
|
"MAPERROR = S0001 = 950459",
|
|
"MAPERROR = S0001 = 950528",
|
|
"MAPERROR = S0001 = 950529",
|
|
"MAPERROR = S0002 = 950311",
|
|
"MAPERROR = S0002 = 950313",
|
|
"MAPERROR = S0002 = 950316",
|
|
"MAPERROR = S0002 = 950390",
|
|
"MAPERROR = S0002 = 950455",
|
|
"MAPERROR = S0002 = 950545",
|
|
"MAPERROR = S0002 = 950596",
|
|
"MAPERROR = S0002 = 950597",
|
|
"MAPERROR = S0002 = 950598",
|
|
"MAPERROR = S0002 = 950599",
|
|
"MAPERROR = S0021 = 950416",
|
|
"MAPERROR = S0021 = 950570",
|
|
"MAPERROR = S0022 = 950418",
|
|
"MAPERROR = S0022 = 950425",
|
|
"MAPERROR = S0022 = 950428",
|
|
"MAPERROR = S0022 = 950522",
|
|
"MAPERROR = S0022 = 950523",
|
|
"MAPERROR = S1008 = 50003",
|
|
"MAPERROR = S0011 = 950663",
|
|
"MAPERROR = S0012 = 950664",
|
|
"MAPERROR = S0022 = 950667",
|
|
"MAPERROR = IA000 = 950051"
|
|
};
|
|
#define NUNIVERSEopts (sizeof (UNIVERSEopts)/sizeof (UNIVERSEopts[0]))
|
|
|
|
/* ORACLEopts are the specific options for ORACLE 6 */
|
|
/*** THE NEXT LINE MUST NOT BE CHANGED OR MOVED. ***/
|
|
/* Removed - enf SQLCO - DBMS -ORACLE- */
|
|
char *ORACLEopts[] = {
|
|
"MARKERNAME = YES",
|
|
"EODCODE = 1002",
|
|
"SQLTYPE = SQL_CHAR = 1",
|
|
"SQLTYPE = SQL_DOUBLE = 2",
|
|
"SQLTYPE = SQL_VARCHAR = 8",
|
|
"SQLTYPE = SQL_CHAR = 11",
|
|
"SQLTYPE = SQL_DATE = 12",
|
|
"SQLTYPE = SQL_CHAR = 96",
|
|
"SQLTYPE = SQL_BINARY = 23",
|
|
"SQLTYPE = SQL_BINARY = 24",
|
|
"SMINTPREC = 38",
|
|
"INTPREC = 38",
|
|
"FLOATPREC = 38",
|
|
"REALPREC = 38",
|
|
"DBLPREC = 38",
|
|
"MAPERROR = S0001 = 955",
|
|
"MAPERROR = S0002 = 942",
|
|
"MAPERROR = S0022 = 904",
|
|
"MAPERROR = 08004 = 1017",
|
|
"MAPERROR = 08004 = 1005"
|
|
};
|
|
#define NORACLEopts (sizeof (ORACLEopts)/sizeof (ORACLEopts[0]))
|
|
|
|
/* ORACLE7opts are the specific options for ORACLE 7 */
|
|
/*** THE NEXT LINE MUST NOT BE CHANGED OR MOVED. ***/
|
|
/* Removed - enf SQLCO - DBMS -ORACLE7- */
|
|
char *ORACLE7opts[] = {
|
|
"MARKERNAME = YES",
|
|
"EODCODE = 1002",
|
|
"SQLTYPE = SQL_CHAR = 1",
|
|
"SQLTYPE = SQL_DOUBLE = 2",
|
|
"SQLTYPE = SQL_VARCHAR = 8",
|
|
"SQLTYPE = SQL_CHAR = 11",
|
|
"SQLTYPE = SQL_DATE = 12",
|
|
"SQLTYPE = SQL_CHAR = 96",
|
|
"SQLTYPE = SQL_BINARY = 23",
|
|
"SQLTYPE = SQL_BINARY = 24",
|
|
"SMINTPREC = 38",
|
|
"INTPREC = 38",
|
|
"FLOATPREC = 38",
|
|
"REALPREC = 38",
|
|
"DBLPREC = 38",
|
|
"MAPERROR = S0001 = 955",
|
|
"MAPERROR = S0002 = 942",
|
|
"MAPERROR = S0022 = 904",
|
|
"MAPERROR = 08004 = 1017",
|
|
"MAPERROR = 08004 = 1005"
|
|
};
|
|
#define NORACLE7opts (sizeof (ORACLE7opts)/sizeof (ORACLE7opts[0]))
|
|
|
|
|
|
/* SYBASEopts are the specific options for SYBASE */
|
|
/*** THE NEXT LINE MUST NOT BE CHANGED OR MOVED. ***/
|
|
/* Removed - enf SQLCO - DBMS -SYBASE- */
|
|
char *SYBASEopts[] = {
|
|
"SQLTYPE = SQL_BINARY = 34",
|
|
"SQLTYPE = SQL_VARCHAR = 35",
|
|
"SQLTYPE = SQL_BINARY = 37",
|
|
"SQLTYPE = SQL_VARCHAR = 39",
|
|
"SQLTYPE = SQL_BINARY = 45",
|
|
"SQLTYPE = SQL_CHAR = 47",
|
|
"SQLTYPE = SQL_SMALLINT = 48",
|
|
"SQLTYPE = SQL_SMALLINT = 50",
|
|
"SQLTYPE = SQL_SMALLINT = 52",
|
|
"SQLTYPE = SQL_INTEGER = 56",
|
|
"SQLTYPE = SQL_DATE = 58",
|
|
"SQLTYPE = SQL_DOUBLE = 59 ",
|
|
"SQLTYPE = SQL_DOUBLE = 60",
|
|
"SQLTYPE = SQL_DATE = 61",
|
|
"SQLTYPE = SQL_FLOAT = 62 ",
|
|
"SQLTYPE = SQL_DOUBLE = 122",
|
|
"DESCB4EXEC = NO",
|
|
"USETGITX = NO",
|
|
"TXSTART = BEGIN TRANSACTION",
|
|
"TXROLL = ROLLBACK TRANSACTION",
|
|
"TXCOMMIT = COMMIT TRANSACTION",
|
|
"TXBEHAVIOR = 1",
|
|
"MAPERROR = S0022 = 207",
|
|
"MAPERROR = S0002 = 208",
|
|
"MAPERROR = S0002 = 3701",
|
|
"MAPERROR = S0001 = 2714",
|
|
"MAPERROR = 08004 = 20014",
|
|
"DATEFORM = D4",
|
|
"DATEPREC = 12",
|
|
"DATEFETCH = 26"
|
|
};
|
|
#define NSYBASEopts (sizeof (SYBASEopts)/sizeof (SYBASEopts[0]))
|
|
|
|
/* INFORMIXopts are the specific options for INFORMIX */
|
|
/*** THE NEXT LINE MUST NOT BE CHANGED OR MOVED. ***/
|
|
/* Removed - enf SQLCO - DBMS -INFORMIX- */
|
|
char *INFORMIXopts[] = {
|
|
"PRECISION = YES",
|
|
"SCALE = YES",
|
|
"DESCB4EXEC = YES",
|
|
"TXBEHAVIOR = 0",
|
|
"USETGITX = YES",
|
|
"DATEPREC = 10",
|
|
"DATEFETCH = 10",
|
|
"DATEFORM = D4/",
|
|
"SQLTYPE = SQL_CHAR = 0",
|
|
"SQLTYPE = SQL_SMALLINT = 1",
|
|
"SQLTYPE = SQL_INTEGER = 2",
|
|
"SQLTYPE = SQL_FLOAT = 3",
|
|
"SQLTYPE = SQL_FLOAT = 4",
|
|
"SQLTYPE = SQL_DECIMAL = 5",
|
|
"SQLTYPE = SQL_INTEGER = 6",
|
|
"SQLTYPE = SQL_DATE = 7",
|
|
"SQLTYPE = SQL_FLOAT = 8",
|
|
"SQLTYPE = SQL_CHAR = 10",
|
|
"SQLTYPE = SQL_BINARY = 11",
|
|
"SQLTYPE = SQL_VARCHAR = 12",
|
|
"SQLTYPE = SQL_VARCHAR = 13",
|
|
"SQLTYPE = SQL_CHAR = 14",
|
|
"MAPERROR = 08004 = -354",
|
|
"MAPERROR = S0001 = -310",
|
|
"MAPERROR = S0002 = -206",
|
|
"MAPERROR = S0022 = -217"
|
|
};
|
|
#define NINFORMIXopts (sizeof (INFORMIXopts)/sizeof (INFORMIXopts[0]))
|
|
|
|
/* DB2opts are the specific options for DB2 */
|
|
/*** THE NEXT LINE MUST NOT BE CHANGED OR MOVED. ***/
|
|
/* Removed - enf SQLCO - DBMS -DB2- */
|
|
char *DB2opts[] = {
|
|
"SCALE = YES",
|
|
"SSPPORTNUMBER = 2000",
|
|
"USETGITX = YES",
|
|
"DESCB4EXEC = YES",
|
|
"EODCODE = -1",
|
|
"DATEFORM = D4/",
|
|
"DATEPREC = 10",
|
|
"SQLTYPE = SQL_INTEGER = 496",
|
|
"SQLTYPE = SQL_INTEGER = 497",
|
|
"SQLTYPE = SQL_CHAR = 452",
|
|
"SQLTYPE = SQL_CHAR = 453",
|
|
"SQLTYPE = SQL_SMALLINT = 500",
|
|
"SQLTYPE = SQL_SMALLINT = 501",
|
|
"SQLTYPE = SQL_VARCHAR = 448",
|
|
"SQLTYPE = SQL_VARCHAR = 449",
|
|
"SQLTYPE = SQL_CHAR = 485",
|
|
"SQLTYPE = SQL_CHAR = 484",
|
|
"SQLTYPE = SQL_FLOAT = 481",
|
|
"SQLTYPE = SQL_FLOAT = 480",
|
|
"SQLTYPE = SQL_VARCHAR = 457",
|
|
"SQLTYPE = SQL_VARCHAR = 456",
|
|
"SQLTYPE = SQL_DATE = 385",
|
|
"SQLTYPE = SQL_DATE = 384",
|
|
"SQLTYPE = SQL_CHAR = 389",
|
|
"SQLTYPE = SQL_CHAR = 388",
|
|
"SQLTYPE = SQL_CHAR = 393",
|
|
"SQLTYPE = SQL_CHAR = 392",
|
|
"DATEFETCH = 26",
|
|
"MAPERROR = 08004 = -1001",
|
|
"MAPERROR = S0002 = -204",
|
|
"MAPERROR = S0001 = -601"
|
|
};
|
|
|
|
#define NDB2opts (sizeof (DB2opts)/sizeof (DB2opts[0]))
|
|
|
|
/* ODBCopts are the specific options for any ODBC data source */
|
|
/*** THE NEXT LINE MUST NOT BE CHANGED OR MOVED. ***/
|
|
/*. SQLCO - DBMS -ODBC- */
|
|
char *ODBCopts[] = {
|
|
"SCALE = YES",
|
|
"DESCB4EXEC = YES",
|
|
"EODCODE = -1",
|
|
"DATEFORM = D4/",
|
|
"TXBEHAVIOR = 1",
|
|
"USETGITX = NO",
|
|
"PRECISION = YES",
|
|
"SCALE = YES",
|
|
"NULLABLE = YES",
|
|
"DSPSIZE = YES",
|
|
"UNSIGNED = YES",
|
|
"MONEY = YES",
|
|
"UPDATE = YES",
|
|
"AUTOINC = YES",
|
|
"CASE = YES",
|
|
"SEARCH = YES",
|
|
"TYPENAME = YES",
|
|
"SMINTPREC = 38",
|
|
"INTPREC = 38",
|
|
"FLOATPREC = 38",
|
|
"REALPREC = 38",
|
|
"DBLPREC = 38",
|
|
"BIGINTPREC = 38", /* Allow for Oracle */
|
|
"DATEPREC = 30" /* 19512 Allow 30 bytes for TIMESTAMP arrays */
|
|
};
|
|
|
|
#define NODBCopts (sizeof (ODBCopts)/sizeof (ODBCopts[0]))
|
|
|
|
/*** UNIDATAopts are specific options for uniDATA. ***/
|
|
/*** THE NEXT LINE MUST NOT BE CHANGED OR MOVED. ***/
|
|
/*. SQLCO - DBMS -UNIDATA- */
|
|
char *UNIDATAopts[] = {
|
|
"MAXFETCHBUFF = 8192",
|
|
"MAXFETCHCOLS = 400",
|
|
"DATEFORM = D-YMD[4,2,2]",
|
|
"EODCODE = -1",
|
|
"PRECISION = YES",
|
|
"SCALE = YES",
|
|
"NULLABLE = YES",
|
|
"DSPSIZE = YES",
|
|
"UNSIGNED = YES",
|
|
"MONEY = YES",
|
|
"UPDATE = YES",
|
|
"AUTOINC = NO",
|
|
"CASE = YES",
|
|
"SEARCH = YES",
|
|
"TXBEHAVIOR = 1",
|
|
"TYPENAME = YES",
|
|
};
|
|
#define NUNIDATAopts (sizeof (UNIDATAopts)/sizeof (UNIDATAopts[0]))
|
|
|
|
/*** DBKnown is the table of data bases we recognize and know parameters
|
|
*** for.
|
|
**/
|
|
struct {
|
|
char *name;
|
|
int dbcode;
|
|
int numopts;
|
|
char **opts;
|
|
} DBKnown[] = {
|
|
"GENERIC", DBMS_GENERIC, NGENERICopts, GENERICopts,
|
|
"UNIVERSE", DBMS_UNIVERSE, NUNIVERSEopts, UNIVERSEopts,
|
|
/* "ORACLE", DBMS_ORACLE, NORACLEopts, ORACLEopts, */
|
|
/* "ORACLE7", DBMS_ORACLE, NORACLE7opts, ORACLE7opts, */
|
|
/* "SYBASE", DBMS_SYBASE, NSYBASEopts, SYBASEopts, */
|
|
/* "INFORMIX", DBMS_INFORMIX, NINFORMIXopts, INFORMIXopts, */
|
|
/* "DB2", DBMS_DB2, NDB2opts, DB2opts, */
|
|
"ODBC", DBMS_ODBC, NODBCopts, ODBCopts,
|
|
"UNIDATA", DBMS_UNIDATA, NUNIDATAopts, UNIDATAopts
|
|
};
|
|
|
|
#define NDBKnown (sizeof (DBKnown)/sizeof (DBKnown[0]))
|
|
|
|
#endif /* UVOD_DCON_H */
|