Main Page Modules Compound List File List Compound Members File Members Related Pages

# sybdb.h

Go to the documentation of this file.

    00001 /* FreeTDS - Library of routines accessing Sybase and Microsoft databases
    00002  * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004  Brian Bruns
    00003  *
    00004  * This library is free software; you can redistribute it and/or
    00005  * modify it under the terms of the GNU Library General Public
    00006  * License as published by the Free Software Foundation; either
    00007  * version 2 of the License, or (at your option) any later version.
    00008  *
    00009  * This library is distributed in the hope that it will be useful,
    00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00012  * Library General Public License for more details.
    00013  *
    00014  * You should have received a copy of the GNU Library General Public
    00015  * License along with this library; if not, write to the
    00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00017  * Boston, MA 02111-1307, USA.
    00018  */
    00019
    00020 #ifndef _sybdb_h_
    00021 #define _sybdb_h_
    00022
    00023 #include "tds_sysdep_public.h"
    00024
    00025 #ifdef __cplusplus
    00026 extern "C"
    00027 {
    00028 #if 0
    00029 }
    00030 #endif
    00031 #endif
    00032
    00033 static const char rcsid_sybdb_h[] = "$Id: sybdb.h,v 1.64.2.3 2004/12/15 09:45:30 freddy77 Exp $";
    00034 static const void *const no_unused_sybdb_h_warn[] = { rcsid_sybdb_h, no_unused_sybdb_h_warn };
    00035
    00041 #ifdef FALSE
    00042 #undef FALSE
    00043 #endif
    00044 #ifdef TRUE
    00045 #undef TRUE
    00046 #endif
    00047 #define FALSE 0
    00048 #define TRUE  1
    00049
    00050 #define DBSAVE   1
    00051 #define DBNOSAVE 0
    00052 #define DBNOERR  -1
    00053
    00054 #define INT_EXIT        0
    00055 #define INT_CONTINUE    1
    00056 #define INT_CANCEL      2
    00057 #define INT_TIMEOUT     3
    00058
    00059 #define DBMAXNUMLEN 33
    00060 #define DBMAXNAME   30
    00061
    00065 #define DBVERSION_UNKNOWN 0
    00066 #define DBVERSION_46      1
    00067 #define DBVERSION_100     2
    00068 #define DBVERSION_42      3
    00069 #define DBVERSION_70      4
    00070 #define DBVERSION_80      5
    00071
    00072 /* these two are defined by Microsoft for dbsetlversion() */
    00073 #define DBVER42           DBVERSION_42
    00074 #define DBVER60           DBVERSION_70  /* our best approximation */
    00075
    00080 #define DBTDS_UNKNOWN           0
    00081 #define DBTDS_2_0               1       /* pre 4.0 SQL Server */
    00082 #define DBTDS_3_4               2       /* Microsoft SQL Server (3.0) */
    00083 #define DBTDS_4_0               3       /* 4.0 SQL Server */
    00084 #define DBTDS_4_2               4       /* 4.2 SQL Server */
    00085 #define DBTDS_4_6               5       /* 2.0 OpenServer and 4.6 SQL Server. */
    00086 #define DBTDS_4_9_5             6       /* 4.9.5 (NCR) SQL Server */
    00087 #define DBTDS_5_0               7       /* 5.0 SQL Server */
    00088 #define DBTDS_7_0               8       /* Microsoft SQL Server 7.0 */
    00089 #define DBTDS_8_0               9       /* Microsoft SQL Server 2000 */
    00090
    00091 #define DBTXPLEN 16
    00092
    00093 #define BCPMAXERRS 1
    00094 #define BCPFIRST 2
    00095 #define BCPLAST 3
    00096 #define BCPBATCH 4
    00097
    00098 #define BCPLABELED 5
    00099 #define BCPHINTS 6
    00100
    00101 #define DBCMDNONE 0
    00102 #define DBCMDPEND 1
    00103 #define DBCMDSENT 2
    00104
    00105 typedef int RETCODE;
    00106
    00107 typedef void DBCURSOR;
    00108 typedef void DBXLATE;
    00109 typedef void DBSORTORDER;
    00110 typedef void DBLOGINFO;
    00111 typedef void *DBVOIDPTR;
    00112 typedef short SHORT;
    00113 typedef unsigned short USHORT;
    00114 typedef int (*INTFUNCPTR) (void *, ...);
    00115 typedef int (*DBWAITFUNC) (void);
    00116 typedef DBWAITFUNC(*DB_DBBUSY_FUNC) (void *dbproc);
    00117 typedef void (*DB_DBIDLE_FUNC) (DBWAITFUNC dfunc, void *dbproc);
    00118 typedef int (*DB_DBCHKINTR_FUNC) (void *dbproc);
    00119 typedef int (*DB_DBHNDLINTR_FUNC) (void *dbproc);
    00120
    00121 #ifndef __INCvxWorksh
    00122 /* VxWorks already defines STATUS and BOOL. Compiler gets mad if you
    00123 ** redefine them. */
    00124 /* __INCvxWorksh will get #defined by std. include files included from tds.h
    00125 */
    00126 #ifdef STATUS
    00127 /* On DU4.0d we get a conflicting STATUS definition from arpa/nameser.h
    00128    when _REENTRANT is defined.
    00129 */
    00130 #undef STATUS
    00131 #endif
    00132 typedef int STATUS;
    00133 #if !defined(_WINDEF_) && !defined(_WINDEF_H)
    00134 typedef int BOOL;
    00135 #endif
    00136 #endif
    00137
    00138 #if !defined(_FREETDS_LIBRARY_SOURCE) || !defined(_tds_h_)
    00139 /* copied from tds.h */
    00140 /* TODO find a best way... */
    00141 enum
    00142 {
    00143         SYBCHAR = 47,           /* 0x2F */
    00144 #define SYBCHAR SYBCHAR
    00145         SYBVARCHAR = 39,        /* 0x27 */
    00146 #define SYBVARCHAR      SYBVARCHAR
    00147         SYBINTN = 38,           /* 0x26 */
    00148 #define SYBINTN SYBINTN
    00149         SYBINT1 = 48,           /* 0x30 */
    00150 #define SYBINT1 SYBINT1
    00151         SYBINT2 = 52,           /* 0x34 */
    00152 #define SYBINT2 SYBINT2
    00153         SYBINT4 = 56,           /* 0x38 */
    00154 #define SYBINT4 SYBINT4
    00155         SYBINT8 = 127,          /* 0x7F */
    00156 #define SYBINT8 SYBINT8
    00157         SYBFLT8 = 62,           /* 0x3E */
    00158 #define SYBFLT8 SYBFLT8
    00159         SYBDATETIME = 61,       /* 0x3D */
    00160 #define SYBDATETIME     SYBDATETIME
    00161         SYBBIT = 50,            /* 0x32 */
    00162 #define SYBBIT  SYBBIT
    00163         SYBTEXT = 35,           /* 0x23 */
    00164 #define SYBTEXT SYBTEXT
    00165         SYBIMAGE = 34,          /* 0x22 */
    00166 #define SYBIMAGE        SYBIMAGE
    00167         SYBMONEY4 = 122,        /* 0x7A */
    00168 #define SYBMONEY4       SYBMONEY4
    00169         SYBMONEY = 60,          /* 0x3C */
    00170 #define SYBMONEY        SYBMONEY
    00171         SYBDATETIME4 = 58,      /* 0x3A */
    00172 #define SYBDATETIME4    SYBDATETIME4
    00173         SYBREAL = 59,           /* 0x3B */
    00174 #define SYBREAL SYBREAL
    00175         SYBBINARY = 45,         /* 0x2D */
    00176 #define SYBBINARY       SYBBINARY
    00177         SYBVARBINARY = 37,      /* 0x25 */
    00178 #define SYBVARBINARY    SYBVARBINARY
    00179         SYBNUMERIC = 108,       /* 0x6C */
    00180 #define SYBNUMERIC      SYBNUMERIC
    00181         SYBDECIMAL = 106,       /* 0x6A */
    00182 #define SYBDECIMAL      SYBDECIMAL
    00183         SYBFLTN = 109,          /* 0x6D */
    00184 #define SYBFLTN SYBFLTN
    00185         SYBMONEYN = 110,        /* 0x6E */
    00186 #define SYBMONEYN       SYBMONEYN
    00187         SYBDATETIMN = 111       /* 0x6F */
    00188 #define SYBDATETIMN     SYBDATETIMN
    00189 };
    00190
    00191 #define SYBAOPCNT  0x4b
    00192 #define SYBAOPCNTU 0x4c
    00193 #define SYBAOPSUM  0x4d
    00194 #define SYBAOPSUMU 0x4e
    00195 #define SYBAOPAVG  0x4f
    00196 #define SYBAOPAVGU 0x50
    00197 #define SYBAOPMIN  0x51
    00198 #define SYBAOPMAX  0x52
    00199
    00200 /* mssql2k compute operator */
    00201 #define SYBAOPCNT_BIG           0x09
    00202 #define SYBAOPSTDEV             0x30
    00203 #define SYBAOPSTDEVP            0x31
    00204 #define SYBAOPVAR               0x32
    00205 #define SYBAOPVARP              0x33
    00206 #define SYBAOPCHECKSUM_AGG      0x72
    00207
    00208 #endif
    00209
    00210 typedef unsigned char DBBOOL;
    00211 typedef char DBCHAR;
    00212 typedef unsigned char DBBIT;
    00213 typedef unsigned char DBTINYINT;
    00214 typedef tds_sysdep_int16_type DBSMALLINT;
    00215 typedef tds_sysdep_int32_type DBINT;
    00216 typedef unsigned char DBBINARY;
    00217 typedef tds_sysdep_real32_type DBREAL;
    00218 typedef tds_sysdep_real64_type DBFLT8;
    00219 typedef unsigned tds_sysdep_int16_type DBUSMALLINT;
    00220
    00221 typedef struct
    00222 {
    00223         DBINT len;
    00224     char  str[256];
    00225 } DBVARYCHAR;
    00226
    00227 typedef struct
    00228 {
    00229         unsigned char precision;
    00230         unsigned char scale;
    00231         unsigned char array[33];
    00232 } DBNUMERIC;
    00233
    00234 typedef DBNUMERIC DBDECIMAL;
    00235
    00236 typedef struct
    00237 {
    00238         DBINT mnyhigh;
    00239         unsigned tds_sysdep_int32_type mnylow;
    00240 } DBMONEY;
    00241
    00242 typedef struct
    00243 {
    00244         DBINT mny4;
    00245 } DBMONEY4;
    00246
    00247 typedef struct
    00248 {
    00249         DBINT dtdays;
    00250         DBINT dttime;
    00251 } DBDATETIME;
    00252
    00253 typedef struct
    00254 {
    00255         DBUSMALLINT days;
    00256         DBUSMALLINT minutes;
    00257 } DBDATETIME4;
    00258
    00259 #ifdef MSDBLIB
    00260 #define SQLCHAR SYBCHAR
    00261 #endif
    00262
    00263 typedef struct tds_dblib_loginrec LOGINREC;
    00264
    00265 typedef unsigned char BYTE;
    00266
    00267 typedef struct dbtypeinfo
    00268 {
    00269         DBINT precision;
    00270         DBINT scale;
    00271 } DBTYPEINFO;
    00272
    00273 struct dbstring
    00274 {
    00275         BYTE *strtext;
    00276         DBINT strtotlen;
    00277         struct dbstring *strnext;
    00278 };
    00279 typedef struct dbstring DBSTRING;
    00280
    00281 /* Used by dbcolinfo */
    00282 enum
    00283 { MAXCOLNAMELEN = 512 }; /* duplicates TDS_SYSNAME_SIZE */
    00284 typedef enum { CI_REGULAR=1, CI_ALTERNATE=2, CI_CURSOR=3 } CI_TYPE;
    00285
    00286 typedef struct
    00287 {
    00288     DBINT SizeOfStruct;
    00289     DBCHAR  Name[MAXCOLNAMELEN+2];
    00290     DBCHAR  ActualName[MAXCOLNAMELEN+2];
    00291     DBCHAR  TableName[MAXCOLNAMELEN+2];
    00292     SHORT Type;
    00293     DBINT UserType;
    00294     DBINT MaxLength;
    00295     BYTE  Precision;
    00296     BYTE  Scale;
    00297     BOOL  VarLength;
    00298     BYTE  Null;
    00299     BYTE  CaseSensitive;
    00300     BYTE  Updatable;
    00301     BOOL  Identity;
    00302
    00303 } DBCOL;
    00304 /* end dbcolinfo stuff */
    00305
    00306
    00307
    00308 /* a large list of options, DBTEXTSIZE is needed by sybtcl */
    00309 #define DBPARSEONLY      0
    00310 #define DBESTIMATE       1
    00311 #define DBSHOWPLAN       2
    00312 #define DBNOEXEC         3
    00313 #define DBARITHIGNORE    4
    00314 #define DBNOCOUNT        5
    00315 #define DBARITHABORT     6
    00316 #define DBTEXTLIMIT      7
    00317 #define DBBROWSE         8
    00318 #define DBOFFSET         9
    00319 #define DBSTAT          10
    00320 #define DBERRLVL        11
    00321 #define DBCONFIRM       12
    00322 #define DBSTORPROCID    13
    00323 #define DBBUFFER        14
    00324 #define DBNOAUTOFREE    15
    00325 #define DBROWCOUNT      16
    00326 #define DBTEXTSIZE      17
    00327 #define DBNATLANG       18
    00328 #define DBDATEFORMAT    19
    00329 #define DBPRPAD         20
    00330 #define DBPRCOLSEP      21
    00331 #define DBPRLINELEN     22
    00332 #define DBPRLINESEP     23
    00333 #define DBLFCONVERT     24
    00334 #define DBDATEFIRST     25
    00335 #define DBCHAINXACTS    26
    00336 #define DBFIPSFLAG      27
    00337 #define DBISOLATION     28
    00338 #define DBAUTH          29
    00339 #define DBIDENTITY      30
    00340 #define DBNOIDCOL       31
    00341 #define DBDATESHORT     32
    00342 #define DBCLIENTCURSORS 33
    00343 #define DBSETTIME       34
    00344 #define DBQUOTEDIDENT   35
    00345
    00346 #define DBNUMOPTIONS  36
    00347
    00348 #define DBPADOFF       0
    00349 #define DBPADON        1
    00350
    00351 #define OFF            0
    00352 #define ON             1
    00353
    00354 #define NOSUCHOPTION   2
    00355
    00356 #define MAXOPTTEXT    32
    00357
    00358 struct dboption
    00359 {
    00360         char opttext[MAXOPTTEXT];
    00361         DBSTRING *optparam;
    00362         DBUSMALLINT optstatus;
    00363         DBBOOL optactive;
    00364         struct dboption *optnext;
    00365 };
    00366 typedef struct dboption DBOPTION;
    00367
    00368 typedef struct tds_dblib_dbprocess DBPROCESS;
    00369
    00370 typedef struct dbdaterec
    00371 {
    00372 #ifdef MSDBLIB
    00373         DBINT year;
    00374         DBINT month;
    00375         DBINT day;
    00376         DBINT dayofyear;
    00377         DBINT weekday;
    00378         DBINT hour;
    00379         DBINT minute;
    00380         DBINT second;
    00381         DBINT millisecond;
    00382         DBINT tzone;
    00383 #else
    00384         DBINT dateyear;
    00385         DBINT datemonth;
    00386         DBINT datedmonth;
    00387         DBINT datedyear;
    00388         DBINT datedweek;
    00389         DBINT datehour;
    00390         DBINT dateminute;
    00391         DBINT datesecond;
    00392         DBINT datemsecond;
    00393         DBINT datetzone;
    00394 #endif
    00395 } DBDATEREC;
    00396
    00397 typedef int (*EHANDLEFUNC) (DBPROCESS * dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr);
    00398
    00399 typedef int (*MHANDLEFUNC) (DBPROCESS * dbproc, DBINT msgno, int msgstate, int severity, char *msgtext, char *srvname,
    00400                             char *proc, int line);
    00401
    00402 /* dbpoll() result codes, sybtcl needs DBRESULT */
    00403 #define DBRESULT       1
    00404 #define DBNOTIFICATION 2
    00405 #define DBTIMEOUT      3
    00406 #define DBINTERRUPT    4
    00407
    00408 /* more sybtcl needs: */
    00409 #define DBTXTSLEN    8
    00410
    00411 /* bind types */
    00412 #define CHARBIND          0
    00413 #define STRINGBIND        1
    00414 #define NTBSTRINGBIND     2
    00415 #define VARYCHARBIND      3
    00416 #define TINYBIND          6
    00417 #define SMALLBIND         7
    00418 #define INTBIND           8
    00419 #define FLT8BIND          9
    00420 #define REALBIND          10
    00421 #define DATETIMEBIND      11
    00422 #define SMALLDATETIMEBIND 12
    00423 #define MONEYBIND         13
    00424 #define SMALLMONEYBIND    14
    00425 #define BINARYBIND        15
    00426 #define BITBIND           16
    00427 #define NUMERICBIND       17
    00428 #define DECIMALBIND       18
    00429
    00430 #define DBPRCOLSEP  21
    00431 #define DBPRLINELEN 22
    00432 #define DBRPCRETURN 1
    00433
    00434 #define REG_ROW         -1
    00435 #define MORE_ROWS       -1
    00436 #define NO_MORE_ROWS    -2
    00437 #define BUF_FULL        -3
    00438 #define NO_MORE_RESULTS 2
    00439 #define SUCCEED         1
    00440 #define FAIL            0
    00441
    00442 #define DB_IN  1
    00443 #define DB_OUT 2
    00444 #define DB_QUERYOUT 3
    00445
    00446 #define DBSINGLE 0
    00447 #define DBDOUBLE 1
    00448 #define DBBOTH   2
    00449
    00450 /* remote procedure call (rpc) options */
    00451 #define DBRPCRECOMPILE ((DBSMALLINT) 0x0001)
    00452 #define DBRPCRESET ((DBSMALLINT) 0x0002)
    00453
    00454 DBBOOL db12hour(DBPROCESS * dbprocess, char *language);
    00455 BYTE *dbadata(DBPROCESS * dbproc, int computeid, int column);
    00456 DBINT dbadlen(DBPROCESS * dbproc, int computeid, int column);
    00457 RETCODE dbaltbind(DBPROCESS * dbprocess, int computeid, int column, int vartype, DBINT varlen, BYTE * varaddr);
    00458 RETCODE dbaltbind_ps(DBPROCESS * dbprocess, int computeid, int column, int vartype, DBINT varlen, BYTE * varaddr,
    00459                      DBTYPEINFO * typeinfo);
    00460 int dbaltcolid(DBPROCESS * dbproc, int computeid, int column);
    00461 RETCODE dbaltlen(DBPROCESS * dbproc, int computeid, int column);
    00462 int dbaltop(DBPROCESS * dbproc, int computeid, int column);
    00463 int dbalttype(DBPROCESS * dbproc, int computeid, int column);
    00464 RETCODE dbaltutype(DBPROCESS * dbproc, int computeid, int column);
    00465 RETCODE dbanullbind(DBPROCESS * dbprocess, int computeid, int column, DBINT * indicator);
    00466 RETCODE dbbind(DBPROCESS * dbproc, int column, int vartype, DBINT varlen, BYTE * varaddr);
    00467 RETCODE dbbind_ps(DBPROCESS * dbprocess, int column, int vartype, DBINT varlen, BYTE * varaddr, DBTYPEINFO * typeinfo);
    00468 int dbbufsize(DBPROCESS * dbprocess);
    00469 BYTE *dbbylist(DBPROCESS * dbproc, int computeid, int *size);
    00470 RETCODE dbcancel(DBPROCESS * dbproc);
    00471 RETCODE dbcanquery(DBPROCESS * dbproc);
    00472 char *dbchange(DBPROCESS * dbprocess);
    00473 DBBOOL dbcharsetconv(DBPROCESS * dbprocess);
    00474 void dbclose(DBPROCESS * dbproc);
    00475 void dbclrbuf(DBPROCESS * dbproc, DBINT n);
    00476 RETCODE dbclropt(DBPROCESS * dbproc, int option, char *param);
    00477 RETCODE dbcmd(DBPROCESS * dbproc, const char *cmdstring);
    00478 RETCODE dbcmdrow(DBPROCESS * dbproc);
    00479
    00480 #define DBCMDROW(x) dbcmdrow((x))
    00481 DBBOOL dbcolbrowse(DBPROCESS * dbprocess, int colnum);
    00482 RETCODE dbcolinfo (DBPROCESS *dbproc, CI_TYPE type, DBINT column, DBINT computeid, DBCOL *pdbcol);
    00483 DBINT dbcollen(DBPROCESS * dbproc, int column);
    00484 char *dbcolname(DBPROCESS * dbproc, int column);
    00485 char *dbcolsource(DBPROCESS * dbproc, int colnum);
    00486 int dbcoltype(DBPROCESS * dbproc, int column);
    00487 DBTYPEINFO *dbcoltypeinfo(DBPROCESS * dbproc, int column);
    00488 DBINT dbcolutype(DBPROCESS * dbprocess, int column);
    00489 DBINT dbconvert(DBPROCESS * dbproc, int srctype, const BYTE * src, DBINT srclen, int desttype, BYTE * dest, DBINT destlen);
    00490 DBINT dbconvert_ps(DBPROCESS * dbprocess, int srctype, BYTE * src, DBINT srclen, int desttype, BYTE * dest, DBINT destlen,
    00491                    DBTYPEINFO * typeinfo);
    00492 DBINT dbcount(DBPROCESS * dbproc);
    00493
    00494 #define DBCOUNT(x) dbcount((x))
    00495 int dbcurcmd(DBPROCESS * dbproc);
    00496
    00497 #define DBCURCMD(x) dbcurcmd((x))
    00498 DBINT dbcurrow(DBPROCESS * dbproc);
    00499
    00500 #define DBCURROW(x) dbcurrow((x))
    00501 RETCODE dbcursor(DBCURSOR * hc, DBINT optype, DBINT bufno, BYTE * table, BYTE * values);
    00502 RETCODE dbcursorbind(DBCURSOR * hc, int col, int vartype, DBINT varlen, DBINT * poutlen, BYTE * pvaraddr, DBTYPEINFO * typeinfo);
    00503 void dbcursorclose(DBCURSOR * hc);
    00504 RETCODE dbcursorcolinfo(DBCURSOR * hc, DBINT column, DBCHAR * colname, DBINT * coltype, DBINT * collen, DBINT * usertype);
    00505 RETCODE dbcursorfetch(DBCURSOR * hc, DBINT fetchtype, DBINT rownum);
    00506 RETCODE dbcursorinfo(DBCURSOR * hc, DBINT * ncols, DBINT * nrows);
    00507 DBCURSOR *dbcursoropen(DBPROCESS * dbprocess, BYTE * stmt, SHORT scollopt, SHORT concuropt, USHORT nrows, DBINT * pstatus);
    00508 BYTE *dbdata(DBPROCESS * dbproc, int column);
    00509 int dbdate4cmp(DBPROCESS * dbprocess, DBDATETIME4 * d1, DBDATETIME4 * d2);
    00510 RETCODE dbdate4zero(DBPROCESS * dbprocess, DBDATETIME4 * d1);
    00511 RETCODE dbdatechar(DBPROCESS * dbprocess, char *buf, int datepart, int value);
    00512 RETCODE dbdatecmp(DBPROCESS * dbproc, DBDATETIME * d1, DBDATETIME * d2);
    00513 RETCODE dbdatecrack(DBPROCESS * dbproc, DBDATEREC * di, DBDATETIME * dt);
    00514 int dbdatename(DBPROCESS * dbprocess, char *buf, int date, DBDATETIME * datetime);
    00515 char *dateorder(DBPROCESS * dbprocess, char *language);
    00516 DBINT dbdatepart(DBPROCESS * dbprocess, int datepart, DBDATETIME * datetime);
    00517 RETCODE dbdatezero(DBPROCESS * dbprocess, DBDATETIME * d1);
    00518 DBINT dbdatlen(DBPROCESS * dbproc, int column);
    00519 char *dbdayname(DBPROCESS * dbprocess, char *language, int daynum);
    00520 DBBOOL dbdead(DBPROCESS * dbproc);
    00521
    00522 #define DBDEAD(x) dbdead((x))
    00523 EHANDLEFUNC dberrhandle(EHANDLEFUNC handler);
    00524 void dbexit(void);
    00525 RETCODE dbfcmd(DBPROCESS * dbproc, const char *fmt, ...);
    00526 DBINT dbfirstrow(DBPROCESS * dbproc);
    00527
    00528 #define DBFIRSTROW(x) dbfirstrow((x))
    00529 RETCODE dbfree_xlate(DBPROCESS * dbprocess, DBXLATE * xlt_tosrv, DBXLATE * clt_todisp);
    00530 void dbfreebuf(DBPROCESS * dbproc);
    00531 void dbfreequal(char *qualptr);
    00532 RETCODE dbfreesort(DBPROCESS * dbprocess, DBSORTORDER * sortorder);
    00533 char *dbgetchar(DBPROCESS * dbprocess, int n);
    00534 char *dbgetcharset(DBPROCESS * dbprocess);
    00535 RETCODE dbgetloginfo(DBPROCESS * dbprocess, DBLOGINFO ** loginfo);
    00536 int dbgetlusername(LOGINREC * login, BYTE * name_buffer, int buffer_len);
    00537 int dbgetmaxprocs(void);
    00538 char *dbgetnatlanf(DBPROCESS * dbprocess);
    00539 int dbgetoff(DBPROCESS * dbprocess, DBUSMALLINT offtype, int startfrom);
    00540 int dbgetpacket(DBPROCESS * dbproc);
    00541 RETCODE dbgetrow(DBPROCESS * dbproc, DBINT row);
    00542 int DBGETTIME(void);
    00543 BYTE *dbgetuserdata(DBPROCESS * dbproc);
    00544 DBBOOL dbhasretstat(DBPROCESS * dbproc);
    00545 RETCODE dbinit(void);
    00546 int dbiordesc(DBPROCESS * dbproc);
    00547
    00548 #define DBIORDESC(x) dbiordesc((x))
    00549 int dbiowdesc(DBPROCESS * dbproc);
    00550
    00551 #define DBIOWDESC(x) dbiowdesc((x))
    00552 DBBOOL dbisavail(DBPROCESS * dbprocess);
    00553
    00554 #define DBISAVAIL(x) dbisavail((x))
    00555 DBBOOL dbisopt(DBPROCESS * dbproc, int option, char *param);
    00556 DBINT dblastrow(DBPROCESS * dbproc);
    00557
    00558 #define DBLASTROW(x) dblastrow((x))
    00559 RETCODE dbload_xlate(DBPROCESS * dbprocess, char *srv_charset, char *clt_name, DBXLATE ** xlt_tosrv, DBXLATE ** xlt_todisp);
    00560 DBSORTORDER *dbloadsort(DBPROCESS * dbprocess);
    00561 LOGINREC *dblogin(void);
    00562 void dbloginfree(LOGINREC * login);
    00563 RETCODE dbmny4add(DBPROCESS * dbproc, DBMONEY4 * m1, DBMONEY4 * m2, DBMONEY4 * sum);
    00564 int dbmny4cmp(DBPROCESS * dbproc, DBMONEY4 * m1, DBMONEY4 * m2);
    00565 RETCODE dbmny4copy(DBPROCESS * dbprocess, DBMONEY4 * m1, DBMONEY4 * m2);
    00566 RETCODE dbmny4divide(DBPROCESS * dbproc, DBMONEY4 * m1, DBMONEY4 * m2, DBMONEY4 * quotient);
    00567 RETCODE dbmny4minus(DBPROCESS * dbproc, DBMONEY4 * src, DBMONEY4 * dest);
    00568 RETCODE dbmny4mul(DBPROCESS * dbproc, DBMONEY4 * m1, DBMONEY4 * m2, DBMONEY4 * prod);
    00569 RETCODE dbmny4sub(DBPROCESS * dbproc, DBMONEY4 * m1, DBMONEY4 * m2, DBMONEY4 * diff);
    00570 RETCODE dbmny4zero(DBPROCESS * dbproc, DBMONEY4 * dest);
    00571 RETCODE dbmnyadd(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2, DBMONEY * sum);
    00572 int dbmnycmp(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2);
    00573 RETCODE dbmnycopy(DBPROCESS * dbproc, DBMONEY * src, DBMONEY * dest);
    00574 RETCODE dbmnydec(DBPROCESS * dbproc, DBMONEY * mnyptr);
    00575 RETCODE dbmnydivide(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2, DBMONEY * quotient);
    00576 RETCODE dbmnydown(DBPROCESS * dbproc, DBMONEY * mnyptr, int divisor, int *remainder);
    00577 RETCODE dbmnyinc(DBPROCESS * dbproc, DBMONEY * mnyptr);
    00578 RETCODE dbmnyinit(DBPROCESS * dbproc, DBMONEY * mnyptr, int trim, DBBOOL * negative);
    00579 RETCODE dbmnymaxneg(DBPROCESS * dbproc, DBMONEY * dest);
    00580 RETCODE dbmnyndigit(DBPROCESS * dbproc, DBMONEY * mnyptr, DBCHAR * value, DBBOOL * zero);
    00581 RETCODE dbmnymaxpos(DBPROCESS * dbproc, DBMONEY * dest);
    00582 RETCODE dbmnyminus(DBPROCESS * dbproc, DBMONEY * src, DBMONEY * dest);
    00583 RETCODE dbmnymul(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2, DBMONEY * prod);
    00584 RETCODE dbmnydigit(DBPROCESS * dbprocess, DBMONEY * m1, DBCHAR * value, DBBOOL * zero);
    00585 RETCODE dbmnyscale(DBPROCESS * dbproc, DBMONEY * dest, int multiplier, int addend);
    00586 RETCODE dbmnysub(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2, DBMONEY * diff);
    00587 RETCODE dbmnyzero(DBPROCESS * dbproc, DBMONEY * dest);
    00588 const char *dbmonthname(DBPROCESS * dbproc, char *language, int monthnum, DBBOOL shortform);
    00589 RETCODE dbmorecmds(DBPROCESS * dbproc);
    00590
    00591 #define DBMORECMDS(x) dbmorecmds((x))
    00592 RETCODE dbmoretext(DBPROCESS * dbproc, DBINT size, BYTE * text);
    00593 MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler);
    00594 char *dbname(DBPROCESS * dbproc);
    00595 RETCODE dbnextrow(DBPROCESS * dbproc);
    00596 RETCODE dbnpcreate(DBPROCESS * dbprocess);
    00597 RETCODE dbnpdefine(DBPROCESS * dbprocess, DBCHAR * procedure_name, DBSMALLINT namelen);
    00598 RETCODE dbnullbind(DBPROCESS * dbproc, int column, DBINT * indicator);
    00599 int dbnumalts(DBPROCESS * dbproc, int computeid);
    00600 int dbnumcols(DBPROCESS * dbproc);
    00601 int dbnumcompute(DBPROCESS * dbprocess);
    00602 int DBNUMORDERS(DBPROCESS * dbprocess);
    00603 int dbnumrets(DBPROCESS * dbproc);
    00604 DBPROCESS *tdsdbopen(LOGINREC * login, char *server, int msdblib);
    00605 DBPROCESS *dbopen(LOGINREC * login, char *server);
    00606
    00607 #ifdef MSDBLIB
    00608 #define   dbopen(x,y) tdsdbopen((x),(y), 1)
    00609 #else
    00610 #define   dbopen(x,y) tdsdbopen((x),(y), 0)
    00611 #endif
    00612
    00613 /* fix PHP problem */
    00614 #ifdef PHP_SYBASE_DBOPEN
    00615 #undef PHP_SYBASE_DBOPEN
    00616 #define PHP_SYBASE_DBOPEN dbopen
    00617 #endif
    00618
    00619 int dbordercol(DBPROCESS * dbprocess, int order);
    00620 RETCODE dbpoll(DBPROCESS * dbproc, long milliseconds, DBPROCESS ** ready_dbproc, int *return_reason);
    00621 void dbprhead(DBPROCESS * dbproc);
    00622 RETCODE dbprrow(DBPROCESS * dbproc);
    00623 const char *dbprtype(int token);
    00624 char *dbqual(DBPROCESS * dbprocess, int tabnum, char *tabname);
    00625 DBBOOL DRBUF(DBPROCESS * dbprocess);
    00626 DBINT dbreadpage(DBPROCESS * dbprocess, char *p_dbname, DBINT pageno, BYTE * buf);
    00627 STATUS dbreadtext(DBPROCESS * dbproc, void *buf, DBINT bufsize);
    00628 void dbrecftos(char *filename);
    00629 RETCODE dbrecvpassthru(DBPROCESS * dbprocess, DBVOIDPTR * bufp);
    00630 RETCODE dbregdrop(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
    00631 RETCODE dbregexec(DBPROCESS * dbproc, DBUSMALLINT options);
    00632 RETCODE dbreghandle(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, INTFUNCPTR handler);
    00633 RETCODE dbreginit(DBPROCESS * dbproc, DBCHAR * procedure_name, DBSMALLINT namelen);
    00634 RETCODE dbreglist(DBPROCESS * dbproc);
    00635 RETCODE dbregnowatch(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
    00636 RETCODE dbregparam(DBPROCESS * dbproc, char *param_name, int type, DBINT datalen, BYTE * data);
    00637 RETCODE dbregwatch(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, DBUSMALLINT options);
    00638 RETCODE dbregwatchlist(DBPROCESS * dbprocess);
    00639 RETCODE dbresults(DBPROCESS * dbproc);
    00640 RETCODE dbresults_r(DBPROCESS * dbproc, int recursive);
    00641 BYTE *dbretdata(DBPROCESS * dbproc, int retnum);
    00642 int dbretlen(DBPROCESS * dbproc, int retnum);
    00643 char *dbretname(DBPROCESS * dbproc, int retnum);
    00644 DBINT dbretstatus(DBPROCESS * dbproc);
    00645 int dbrettype(DBPROCESS * dbproc, int retnum);
    00646 RETCODE dbrows(DBPROCESS * dbproc);
    00647
    00648 #define DBROWS(x) dbrows((x))
    00649 STATUS dbrowtype(DBPROCESS * dbprocess);
    00650
    00651 #define DBROWTYPE(x) dbrowtype((x))
    00652 RETCODE dbrpcinit(DBPROCESS * dbproc, char *rpcname, DBSMALLINT options);
    00653 RETCODE dbrpcparam(DBPROCESS * dbproc, char *paramname, BYTE status, int type, DBINT maxlen, DBINT datalen, BYTE * value);
    00654 RETCODE dbrpcsend(DBPROCESS * dbproc);
    00655 void dbrpwclr(LOGINREC * login);
    00656 RETCODE dbrpwset(LOGINREC * login, char *srvname, char *password, int pwlen);
    00657 RETCODE dbsafestr(DBPROCESS * dbproc, const char *src, DBINT srclen, char *dest, DBINT destlen, int quotetype);
    00658 RETCODE *dbsechandle(DBINT type, INTFUNCPTR handler);
    00659 RETCODE dbsendpassthru(DBPROCESS * dbprocess, DBVOIDPTR bufp);
    00660 char *dbservcharset(DBPROCESS * dbprocess);
    00661 void dbsetavail(DBPROCESS * dbprocess);
    00662 void dbsetbusy(DBPROCESS * dbprocess, DB_DBBUSY_FUNC busyfunc);
    00663 RETCODE dbsetdefcharset(char *charset);
    00664 RETCODE dbsetdeflang(char *language);
    00665 void dbsetidle(DBPROCESS * dbprocess, DB_DBIDLE_FUNC idlefunc);
    00666 void dbsetifile(char *filename);
    00667 void dbsetinterrupt(DBPROCESS * dbproc, DB_DBCHKINTR_FUNC chkintr, DB_DBHNDLINTR_FUNC hndlintr);
    00668 RETCODE dbsetloginfo(LOGINREC * loginrec, DBLOGINFO * loginfo);
    00669 RETCODE dbsetlogintime(int seconds);
    00670 RETCODE dbsetmaxprocs(int maxprocs);
    00671 RETCODE dbsetnull(DBPROCESS * dbprocess, int bindtype, int bindlen, BYTE * bindval);
    00672 RETCODE dbsetopt(DBPROCESS * dbproc, int option, const char *char_param, int int_param);
    00673 STATUS dbsetrow(DBPROCESS * dbprocess, DBINT row);
    00674 RETCODE dbsettime(int seconds);
    00675 void dbsetuserdata(DBPROCESS * dbproc, BYTE * ptr);
    00676 RETCODE dbsetversion(DBINT version);
    00677
    00678 int dbspid(DBPROCESS * dbproc);
    00679 RETCODE dbspr1row(DBPROCESS * dbproc, char *buffer, DBINT buf_len);
    00680 DBINT dbspr1rowlen(DBPROCESS * dbproc);
    00681 RETCODE dbsprhead(DBPROCESS * dbproc, char *buffer, DBINT buf_len);
    00682 RETCODE dbsprline(DBPROCESS * dbproc, char *buffer, DBINT buf_len, DBCHAR line_char);
    00683 RETCODE dbsqlexec(DBPROCESS * dbproc);
    00684 RETCODE dbsqlok(DBPROCESS * dbproc);
    00685 RETCODE dbsqlsend(DBPROCESS * dbproc);
    00686 int dbstrbuild(DBPROCESS * dbproc, char *charbuf, int bufsize, char *text, char *formats, ...);
    00687 int dbstrcmp(DBPROCESS * dbprocess, char *s1, int l1, char *s2, int l2, DBSORTORDER * sort);
    00688 RETCODE dbstrcpy(DBPROCESS * dbproc, int start, int numbytes, char *dest);
    00689 int dbstrlen(DBPROCESS * dbproc);
    00690 int dbstrsort(DBPROCESS * dbprocess, char *s1, int l1, char *s2, int l2, DBSORTORDER * sort);
    00691 DBBOOL dbtabbrowse(DBPROCESS * dbprocess, int tabnum);
    00692 int dbtabcount(DBPROCESS * dbprocess);
    00693 char *dbtabname(DBPROCESS * dbprocess, int tabnum);
    00694 char *dbtabsoruce(DBPROCESS * dbprocess, int colnum, int *tabnum);
    00695 DBINT dbvarylen(DBPROCESS * dbproc, int column);
    00696
    00697 #define SYBEICONVI       2403   /* Unconverted characters were changed to question marks while reading from SQL Server. */
    00698 #define SYBEICONVO       2402   /* Unable to write to SQL Server: error converting to server's character set. */
    00699 #define SYBESYNC        20001   /* Read attempted while out of synchronization with SQL Server. */
    00700 #define SYBEFCON        20002   /* SQL Server connection failed. */
    00701 #define SYBETIME        20003   /* SQL Server connection timed out. */
    00702 #define SYBEREAD        20004   /* Read from SQL Server failed. */
    00703 #define SYBEBUFL        20005   /* DB-LIBRARY internal error - send buffer length corrupted. */
    00704 #define SYBEWRIT        20006   /* Write to SQL Server failed. */
    00705 #define SYBEVMS         20007   /* Sendflush: VMS I/O error. */
    00706 #define SYBESOCK        20008   /* Unable to open socket */
    00707 #define SYBECONN        20009   /* Unable to connect socket -- SQL Server is unavailable or does not exist. */
    00708 #define SYBEMEM         20010   /* Unable to allocate sufficient memory */
    00709 #define SYBEDBPS        20011   /* Maximum number of DBPROCESSes already allocated. */
    00710 #define SYBEINTF        20012   /* Server name not found in interface file */
    00711 #define SYBEUHST        20013   /* Unknown host machine name */
    00712 #define SYBEPWD         20014   /* Incorrect password. */
    00713 #define SYBEOPIN        20015   /* Could not open interface file. */
    00714 #define SYBEINLN        20016   /* Interface file: unexpected end-of-line. */
    00715 #define SYBESEOF        20017   /* Unexpected EOF from SQL Server. */
    00716 #define SYBESMSG        20018   /* General SQL Server error: Check messages from the SQL Server. */
    00717 #define SYBERPND        20019   /* Attempt to initiate a new SQL Server operation with results pending. */
    00718 #define SYBEBTOK        20020   /* Bad token from SQL Server: Data-stream processing out of sync. */
    00719 #define SYBEITIM        20021   /* Illegal timeout value specified. */
    00720 #define SYBEOOB         20022   /* Error in sending out-of-band data to SQL Server. */
    00721 #define SYBEBTYP        20023   /* Unknown bind type passed to DB-LIBRARY function. */
    00722 #define SYBEBNCR        20024   /* Attempt to bind user variable to a non-existent compute row. */
    00723 #define SYBEIICL        20025   /* Illegal integer column length returned by SQL Server. Legal integer lengths are 1, 2, and 4 bytes. */
    00724 #define SYBECNOR        20026   /* Column number out of range. */
    00725 #define SYBENPRM        20027   /* NULL parameter not allowed for this dboption. */
    00726 #define SYBEUVDT        20028   /* Unknown variable-length datatype encountered. */
    00727 #define SYBEUFDT        20029   /* Unknown fixed-length datatype encountered. */
    00728 #define SYBEWAID        20030   /* DB-LIBRARY internal error: ALTFMT following ALTNAME has wrong id. */
    00729 #define SYBECDNS        20031   /* Datastream indicates that a compute column is derived from a non-existent select-list member. */
    00730 #define SYBEABNC        20032   /* Attempt to bind to a non-existent column. */
    00731 #define SYBEABMT        20033   /* User attempted a dbbind() with mismatched column and variable types. */
    00732 #define SYBEABNP        20034   /* Attempt to bind using NULL pointers. */
    00733 #define SYBEAAMT        20035   /* User attempted a dbaltbind() with mismatched column and variable types. */
    00734 #define SYBENXID        20036   /* The Server did not grant us a distributed-transaction ID. */
    00735 #define SYBERXID        20037   /* The Server did not recognize our distributed-transaction ID. */
    00736 #define SYBEICN         20038   /* Invalid computeid or compute column number. */
    00737 #define SYBENMOB        20039   /* No such member of 'order by' clause. */
    00738 #define SYBEAPUT        20040   /* Attempt to print unknown token. */
    00739 #define SYBEASNL        20041   /* Attempt to set fields in a null loginrec. */
    00740 #define SYBENTLL        20042   /* Name too long for loginrec field. */
    00741 #define SYBEASUL        20043   /* Attempt to set unknown loginrec field. */
    00742 #define SYBERDNR        20044   /* Attempt to retrieve data from a non-existent row. */
    00743 #define SYBENSIP        20045   /* Negative starting index passed to dbstrcpy(). */
    00744 #define SYBEABNV        20046   /* Attempt to bind to a NULL program variable. */
    00745 #define SYBEDDNE        20047   /* DBPROCESS is dead or not enabled. */
    00746 #define SYBECUFL        20048   /* Data-conversion resulted in underflow. */
    00747 #define SYBECOFL        20049   /* Data-conversion resulted in overflow. */
    00748 #define SYBECSYN        20050   /* Attempt to convert data stopped by syntax error in source field. */
    00749 #define SYBECLPR        20051   /* Data-conversion resulted in loss of precision. */
    00750 #define SYBECNOV        20052   /* Attempt to set variable to NULL resulted in overflow. */
    00751 #define SYBERDCN        20053   /* Requested data-conversion does not exist. */
    00752 #define SYBESFOV        20054   /* dbsafestr() overflowed its destination buffer. */
    00753 #define SYBEUNT         20055   /* Unknown network type found in interface file. */
    00754 #define SYBECLOS        20056   /* Error in closing network connection. */
    00755 #define SYBEUAVE        20057   /* Unable to allocate VMS event flag. */
    00756 #define SYBEUSCT        20058   /* Unable to set communications timer. */
    00757 #define SYBEEQVA        20059   /* Error in queueing VMS AST routine. */
    00758 #define SYBEUDTY        20060   /* Unknown datatype encountered. */
    00759 #define SYBETSIT        20061   /* Attempt to call dbtsput() with an invalid timestamp. */
    00760 #define SYBEAUTN        20062   /* Attempt to update the timestamp of a table which has no timestamp column. */
    00761 #define SYBEBDIO        20063   /* Bad bulk-copy direction.  Must be either IN or OUT. */
    00762 #define SYBEBCNT        20064   /* Attempt to use Bulk Copy with a non-existent Server table. */
    00763 #define SYBEIFNB        20065   /* Illegal field number passed to bcp_control(). */
    00764 #define SYBETTS         20066   /* The table which bulk-copy is attempting to copy to a host-file is shorter than the number of rows which bulk-copy was instructed to skip. */
    00765 #define SYBEKBCO        20067   /* 1000 rows successfully bulk-copied to host-file. */
    00766 #define SYBEBBCI        20068   /* Batch successfully bulk-copied to SQL Server. */
    00767 #define SYBEKBCI        20069   /* Bcp: 1000 rows sent to SQL Server. */
    00768 #define SYBEBCRE        20070   /* I/O error while reading bcp data-file. */
    00769 #define SYBETPTN        20071   /* Syntax error: only two periods are permitted in table names. */
    00770 #define SYBEBCWE        20072   /* I/O error while writing bcp data-file. */
    00771 #define SYBEBCNN        20073   /* Attempt to bulk-copy a NULL value into Server column %d,  which does not accept NULL values. */
    00772 #define SYBEBCOR        20074   /* Attempt to bulk-copy an oversized row to the SQL Server. */
    00773 #define SYBEBCIS        20075   /* Attempt to bulk-copy an illegally-sized column value to the SQL Server. */
    00774 #define SYBEBCPI        20076   /* bcp_init() must be called before any other bcp routines. */
    00775 #define SYBEBCPN        20077   /* bcp_bind(), bcp_collen(), bcp_colptr(), bcp_moretext() and bcp_sendrow() may be used only after bcp_init() has been called with the copy direction set to DB_IN. */
    00776 #define SYBEBCPB        20078   /* bcp_bind(), bcp_moretext() and bcp_sendrow() may NOT be used after bcp_init() has been passed a non-NULL input file name. */
    00777 #define SYBEVDPT        20079   /* For bulk copy, all variable-length data must have either a length-prefix or a terminator specified. */
    00778 #define SYBEBIVI        20080   /* bcp_columns(), bcp_colfmt() and bcp_colfmt_ps() may be used only after bcp_init() has been passed a valid input file. */
    00779 #define SYBEBCBC        20081   /* bcp_columns() must be called before bcp_colfmt() and bcp_colfmt_ps(). */
    00780 #define SYBEBCFO        20082   /* Bcp host-files must contain at least one column. */
    00781 #define SYBEBCVH        20083   /* bcp_exec() may be called only after bcp_init() has been passed a valid host file. */
    00782 #define SYBEBCUO        20084   /* Bcp: Unable to open host data-file. */
    00783 #define SYBEBCUC        20085   /* Bcp: Unable to close host data-file. */
    00784 #define SYBEBUOE        20086   /* Bcp: Unable to open error-file. */
    00785 #define SYBEBUCE        20087   /* Bcp: Unable to close error-file. */
    00786 #define SYBEBWEF        20088   /* I/O error while writing bcp error-file. */
    00787 #define SYBEASTF        20089   /* VMS: Unable to setmode for control_c ast. */
    00788 #define SYBEUACS        20090   /* VMS: Unable to assign channel to sys$command. */
    00789 #define SYBEASEC        20091   /* Attempt to send an empty command buffer to the SQL Server. */
    00790 #define SYBETMTD        20092   /* Attempt to send too much TEXT data via the dbmoretext() call. */
    00791 #define SYBENTTN        20093   /* Attempt to use dbtxtsput() to put a new text-timestamp into a non-existent data row. */
    00792 #define SYBEDNTI        20094   /* Attempt to use dbtxtsput() to put a new text-timestamp into a column whose datatype is neither SYBTEXT nor SYBIMAGE. */
    00793 #define SYBEBTMT        20095   /* Attempt to send too much TEXT data via the bcp_moretext() call. */
    00794 #define SYBEORPF        20096   /* Attempt to set remote password would overflow the login-record's remote-password field. */
    00795 #define SYBEUVBF        20097   /* Attempt to read an unknown version of BCP format-file. */
    00796 #define SYBEBUOF        20098   /* Bcp: Unable to open format-file. */
    00797 #define SYBEBUCF        20099   /* Bcp: Unable to close format-file. */
    00798 #define SYBEBRFF        20100   /* I/O error while reading bcp format-file. */
    00799 #define SYBEBWFF        20101   /* I/O error while writing bcp format-file. */
    00800 #define SYBEBUDF        20102   /* Bcp: Unrecognized datatype found in format-file. */
    00801 #define SYBEBIHC        20103   /* Incorrect host-column number found in bcp format-file. */
    00802 #define SYBEBEOF        20104   /* Unexpected EOF encountered in BCP data-file. */
    00803 #define SYBEBCNL        20105   /* Negative length-prefix found in BCP data-file. */
    00804 #define SYBEBCSI        20106   /* Host-file columns may be skipped only when copying INto the Server. */
    00805 #define SYBEBCIT        20107   /* It's illegal to use BCP terminators with program variables other than SYBCHAR, SYBBINARY, SYBTEXT, or SYBIMAGE. */
    00806 #define SYBEBCSA        20108   /* The BCP hostfile '%s' contains only %ld rows. Skipping all of these rows is not allowed. */
    00807 #define SYBENULL        20109   /* NULL DBPROCESS pointer passed to DB-Library. */
    00808 #define SYBEUNAM        20110   /* Unable to get current username from operating system. */
    00809 #define SYBEBCRO        20111   /* The BCP hostfile '%s' contains only %ld rows. It was impossible to read the requested %ld rows. */
    00810 #define SYBEMPLL        20112   /* Attempt to set maximum number of DBPROCESSes lower than 1. */
    00811 #define SYBERPIL        20113   /* It is illegal to pass -1 to dbrpcparam() for the datalen of parameters which are of type SYBCHAR, SYBVARCHAR, SYBBINARY, or SYBVARBINARY. */
    00812 #define SYBERPUL        20114   /* When passing a SYBINTN, SYBDATETIMN, SYBMONEYN, or SYBFLTN parameter via dbrpcparam(), it's necessary to specify the parameter's maximum or actual length, so that DB-Library can recognize it as a SYBINT1, SYBINT2, SYBINT4, SYBMONEY, or SYBMONEY4, etc. */
    00813 #define SYBEUNOP        20115   /* Unknown option passed to dbsetopt(). */
    00814 #define SYBECRNC        20116   /* The current row is not a result of compute clause %d, so it is illegal to attempt to extract that data from this row. */
    00815 #define SYBERTCC        20117   /* dbreadtext() may not be used to receive the results of a query which contains a COMPUTE clause. */
    00816 #define SYBERTSC        20118   /* dbreadtext() may only be used to receive the results of a query which contains a single result column. */
    00817 #define SYBEUCRR        20119   /* Internal software error: Unknown connection result reported by                                                 * dbpasswd(). */
    00818 #define SYBERPNA        20120   /* The RPC facility is available only when using a SQL Server whose version number is 4.0 or greater. */
    00819 #define SYBEOPNA        20121   /* The text/image facility is available only when using a SQL Server whose version number is 4.0 or greater. */
    00820 #define SYBEFGTL        20122   /* Bcp: Row number of the first row to be copied cannot be greater than the row number for the last row to be copied.  */
    00821 #define SYBECWLL        20123   /* Attempt to set column width less than 1.  */
    00822 #define SYBEUFDS        20124   /* Unrecognized format encountered in dbstrbuild(). */
    00823 #define SYBEUCPT        20125   /* Unrecognized custom-format parameter-type encountered in dbstrbuild(). */
    00824 #define SYBETMCF        20126   /* Attempt to install too many custom formats via dbfmtinstall(). */
    00825 #define SYBEAICF        20127   /* Error in attempting to install custom format. */
    00826 #define SYBEADST        20128   /* Error in attempting to determine the size of a pair of translation tables. */
    00827 #define SYBEALTT        20129   /* Error in attempting to load a pair of translation tables. */
    00828 #define SYBEAPCT        20130   /* Error in attempting to perform a character-set translation. */
    00829 #define SYBEXOCI        20131   /* A character-set translation overflowed its destination buffer while using bcp to copy data from a host-file to the SQL Server. */
    00830 #define SYBEFSHD        20132   /* Error in attempting to find the Sybase home directory. */
    00831 #define SYBEAOLF        20133   /* Error in attempting to open a localization file. */
    00832 #define SYBEARDI        20134   /* Error in attempting to read datetime information from a localization file. */
    00833 #define SYBEURCI        20135   /* Unable to read copyright information from the dblib localization file. */
    00834 #define SYBEARDL        20136   /* Error in attempting to read the dblib.loc localization file. */
    00835 #define SYBEURMI        20137   /* Unable to read money-format information from the dblib localization file. */
    00836 #define SYBEUREM        20138   /* Unable to read error mnemonic from the dblib localization file. */
    00837 #define SYBEURES        20139   /* Unable to read error string from the dblib localization file. */
    00838 #define SYBEUREI        20140   /* Unable to read error information from the dblib localization file. */
    00839 #define SYBEOREN        20141   /* Warning: an out-of-range error-number was encountered in dblib.loc. The maximum permissible error-number is defined as DBERRCOUNT in sybdb.h. */
    00840 #define SYBEISOI        20142   /* Invalid sort-order information found. */
    00841 #define SYBEIDCL        20143   /* Illegal datetime column length returned by DataServer. Legal datetime lengths are 4 and 8 bytes. */
    00842 #define SYBEIMCL        20144   /* Illegal money column length returned by DataServer. Legal money lengths are 4 and 8 bytes. */
    00843 #define SYBEIFCL        20145   /* Illegal floating-point column length returned by DataServer. Legal floating-point lengths are 4 and 8 bytes. */
    00844 #define SYBEUTDS        20146   /* Unrecognized TDS version received from SQL Server. */
    00845 #define SYBEBUFF        20147   /* Bcp: Unable to create format-file. */
    00846 #define SYBEACNV        20148   /* Attemp to do conversion with NULL destination variable. */
    00847 #define SYBEDPOR        20149   /* Out-of-range datepart constant. */
    00848 #define SYBENDC         20150   /* Cannot have negative component in date in numeric form. */
    00849 #define SYBEMVOR        20151   /* Month values must be between 1 and 12. */
    00850 #define SYBEDVOR        20152   /* Day values must be between 1 and 7. */
    00851 #define SYBENBVP        20153   /* Cannot pass dbsetnull() a NULL bindval pointer. */
    00852 #define SYBESPID        20154   /* Called dbspid() with a NULL dbproc. */
    00853 #define SYBENDTP        20155   /* Called dbdatecrack() with a NULL datetime  parameter. */
    00854 #define SYBEXTN         20156   /* The xlt_todisp and xlt_tosrv parameters to dbfree_xlate() were NULL. */
    00855 #define SYBEXTDN        20157   /* Warning:  the xlt_todisp parameter to dbfree_xlate() was NULL.  The space associated with the xlt_tosrv parameter has been freed. */
    00856 #define SYBEXTSN        20158   /* Warning:  the xlt_tosrv parameter to dbfree_xlate() was NULL.  The space associated with the xlt_todisp parameter has been freed. */
    00857 #define SYBENUM         20159   /* Incorrect number of arguments given  to DB-Library.  */
    00858 #define SYBETYPE        20160   /* Invalid argument type given to DB-Library. */
    00859 #define SYBEGENOS       20161   /* General Operating System Error. */
    00860 #define SYBEPAGE        20162   /* wrong resource type or length given for  dbpage() operation.  */
    00861 #define SYBEOPTNO       20163   /* Option is not allowed or is unreconized */
    00862 #define SYBEETD         20164   /*"Failure to send the expected amount of  TEXT or IMAGE data via dbmoretext(). */
    00863 #define SYBERTYPE       20165   /* Invalid resource type given to DB-Library. */
    00864 #define SYBERFILE       20166   /* "Can not open resource file." */
    00865 #define SYBEFMODE       20167   /* Read/Write/Append mode denied on file. */
    00866 #define SYBESLCT        20168   /* Could not select or copy field specified */
    00867 #define SYBEZTXT        20169   /* Attempt to send zero length TEXT or  IMAGE to dataserver via dbwritetext(). */
    00868 #define SYBENTST        20170   /* The file being opened must be a stream_lf. */
    00869 #define SYBEOSSL        20171   /* Operating system login level not in range of Secure SQL Server */
    00870 #define SYBEESSL        20172   /* Login security level entered does not agree with operating system level */
    00871 #define SYBENLNL        20173   /* Program not linked with specified network library. */
    00872 #define SYBENHAN        20174   /* called dbrecvpassthru() with a NULL handler parameter. */
    00873 #define SYBENBUF        20175   /* called dbsendpassthru() with a NULL buf pointer. */
    00874 #define SYBENULP        20176   /* Called %s with a NULL %s parameter. */
    00875 #define SYBENOTI        20177   /* No event handler installed. */
    00876 #define SYBEEVOP        20178   /* Called dbregwatch() with a bad options parameter. */
    00877 #define SYBENEHA        20179   /* Called dbreghandle() with a NULL handler parameter. */
    00878 #define SYBETRAN        20180   /* DBPROCESS is being used for another transaction. */
    00879 #define SYBEEVST        20181   /* Must initiate a transaction before calling dbregparam(). */
    00880 #define SYBEEINI        20182   /* Must call dbreginit() before dbregraise(). */
    00881 #define SYBEECRT        20183   /* Must call dbregdefine() before dbregcreate(). */
    00882 #define SYBEECAN        20184   /* Attempted to cancel unrequested event notification. */
    00883 #define SYBEEUNR        20185   /* Unsolicited event notification received. */
    00884 #define SYBERPCS        20186   /* Must call dbrpcinit() before dbrpcparam(). */
    00885 #define SYBETPAR        20187   /* No SYBTEXT or SYBIMAGE parameters were defined. */
    00886 #define SYBETEXS        20188   /* Called dbmoretext() with a bad size parameter. */
    00887 #define SYBETRAC        20189   /* Attempted to turn off a trace flag that was not on. */
    00888 #define SYBETRAS        20190   /* DB-Library internal error - trace structure not found. */
    00889 #define SYBEPRTF        20191   /* dbtracestring() may only be called from a printfunc(). */
    00890 #define SYBETRSN        20192   /* Bad numbytes parameter passed to dbtracestring(). */
    00891 #define SYBEBPKS        20193   /* In DBSETLPACKET(), the packet size parameter must be between 0 and 999999. */
    00892 #define SYBEIPV         20194   /* %1! is an illegal value for the %2! parameter of %3!. */
    00893 #define SYBEMOV         20195   /* Money arithmetic resulted in overflow in function %1!. */
    00894 #define SYBEDIVZ        20196   /* Attempt to divide by $0.00 in function %1!. */
    00895 #define SYBEASTL        20197   /* Synchronous I/O attempted at AST level. */
    00896 #define SYBESEFA        20198   /* DBSETNOTIFS cannot be called if connections are present. */
    00897 #define SYBEPOLL 20199          /* Only one dbpoll() can be active at a time. */
    00898 #define SYBENOEV 20200          /* dbpoll() cannot be called if registered procedure notifications have been disabled. */
    00899 #define SYBEBADPK 20201         /* Packet size of %1! not supported. -- size of %2! used instead. */
    00900 #define SYBESECURE 20202        /* Secure Server function not supported in this version. */
    00901 #define SYBECAP 20203           /* DB-Library capabilities not accepted by the Server. */
    00902 #define SYBEFUNC 20204          /* Functionality not supported at the specified version level. */
    00903 #define SYBERESP 20205          /* Response function address passed to dbresponse() must be non-NULL. */
    00904 #define SYBEIVERS       20206   /* Illegal version level specified. */
    00905 #define SYBEONCE 20207          /* Function can be called only once. */
    00906 #define SYBERPNULL 20208        /* value parameter for dbprcparam() can be NULL, only if the datalen parameter is 0 */
    00907 #define SYBERPTXTIM 20209       /* RPC parameters cannot be of type Text/Image. */
    00908 #define SYBENEG 20210           /* Negotiated login attempt failed. */
    00909 #define SYBELBLEN 20211         /* Security labels should be less than 256 characters long. */
    00910 #define SYBEUMSG 20212          /* Unknown message-id in MSG datastream. */
    00911 #define SYBECAPTYP 20213        /* Unexpected capability type in CAPABILITY datastream. */
    00912 #define SYBEBNUM 20214          /* Bad numbytes parameter passed to dbstrcpy() */
    00913 #define SYBEBBL 20215           /* Bad bindlen parameter passed to dbsetnull() */
    00914 #define SYBEBPREC 20216         /* Illegal precision specified */
    00915 #define SYBEBSCALE 20217        /* Illegal scale specified */
    00916 #define SYBECDOMAIN 20218       /* Source field value is not within the domain of legal values. */
    00917 #define SYBECINTERNAL 20219     /* Internal Conversion error. */
    00918 #define SYBEBTYPSRV 20220       /* Datatype is not supported by the server. */
    00919 #define SYBEBCSET 20221         /* Unknown character-set encountered." */
    00920 #define SYBEFENC 20222          /* Password Encryption failed." */
    00921 #define SYBEFRES 20223          /* Challenge-Response function failed.", */
    00922 #define SYBEISRVPREC 20224      /* Illegal precision value returned by the server. */
    00923 #define SYBEISRVSCL 20225       /* Illegal scale value returned by the server. */
    00924 #define SYBEINUMCL 20226        /* Invalid numeric column length returned by the server. */
    00925 #define SYBEIDECCL 20227        /* Invalid decimal column length returned by the server. */
    00926 #define SYBEBCMTXT 20228        /* bcp_moretext() may be used only when there is at least one text or image column in the server table. */
    00927 #define SYBEBCPREC 20229        /* Column %1!: Illegal precision value encountered. */
    00928 #define SYBEBCBNPR 20230        /* bcp_bind(): if varaddr is NULL, prefixlen must be 0 and no terminator should be specified. */
    00929 #define SYBEBCBNTYP 20231       /* bcp_bind(): if varaddr is NULL and varlen greater than 0, the table column type must be SYBTEXT or SYBIMAGE and the program variable type must be SYBTEXT, SYBCHAR, SYBIMAGE or SYBBINARY. */
    00930 #define SYBEBCSNTYP 20232       /* column number %1!: if varaddr is NULL and varlen greater than 0, the table column type must be SYBTEXT or SYBIMAGE and the program variable type must be SYBTEXT, SYBCHAR, SYBIMAGE or SYBBINARY. */
    00931 #define SYBEBCPCTYP 20233       /* bcp_colfmt(): If table_colnum is 0, host_type cannot be 0. */
    00932 #define SYBEBCVLEN 20234        /* varlen should be greater than or equal to -1. */
    00933 #define SYBEBCHLEN 20235        /* host_collen should be greater than or equal to -1. */
    00934 #define SYBEBCBPREF 20236       /* Illegal prefix length. Legal values are 0, 1, 2 or 4. */
    00935 #define SYBEBCPREF 20237        /* Illegal prefix length. Legal values are -1, 0, 1, 2 or 4. */
    00936 #define SYBEBCITBNM 20238       /* bcp_init(): tblname parameter cannot be NULL. */
    00937 #define SYBEBCITBLEN 20239      /* bcp_init(): tblname parameter is too long. */
    00938 #define SYBEBCSNDROW 20240      /* bcp_sendrow() may NOT be called unless all text data for the previous row has been sent using bcp_moretext(). */
    00939 #define SYBEBPROCOL 20241       /* bcp protocol error: returned column count differs from the actual number of columns received. */
    00940 #define SYBEBPRODEF 20242       /* bcp protocol error: expected default information and got none. */
    00941 #define SYBEBPRONUMDEF 20243    /* bcp protocol error: expected number of defaults differs from the actual number of defaults received. */
    00942 #define SYBEBPRODEFID 20244     /* bcp protocol error: default column id and actual column id are not same */
    00943 #define SYBEBPRONODEF 20245     /* bcp protocol error:  default value received for column that does not have default. */
    00944 #define SYBEBPRODEFTYP 20246    /* bcp protocol error:  default value datatype differs from column datatype. */
    00945 #define SYBEBPROEXTDEF 20247    /* bcp protocol error: more than one row of default information received. */
    00946 #define SYBEBPROEXTRES 20248    /* bcp protocol error: unexpected set of results received. */
    00947 #define SYBEBPROBADDEF 20249    /* bcp protocol error: illegal default column id received. */
    00948 #define SYBEBPROBADTYP 20250    /* bcp protocol error: unknown column datatype. */
    00949 #define SYBEBPROBADLEN 20251    /* bcp protocol error: illegal datatype length received. */
    00950 #define SYBEBPROBADPREC 20252   /* bcp protocol error: illegal precision value received. */
    00951 #define SYBEBPROBADSCL 20253    /* bcp protocol error: illegal scale value received. */
    00952 #define SYBEBADTYPE 20254       /* Illegal value for type parameter  given to %1!. */
    00953 #define SYBECRSNORES  20255     /* Cursor statement generated no results. */
    00954 #define SYBECRSNOIND 20256      /* One of the tables involved in the cursor  statement does not have a unique index. */
    00955 #define SYBECRSVIEW 20257       /* A view cannot be joined with another table  or a view in a cursor statement. */
    00956 #define SYBECRSVIIND 20258      /* The view used in the cursor statement does  not include all the unique index columns of  the underlying tables. */
    00957 #define SYBECRSORD 20259        /* Only fully keyset driven cursors can have 'order by', ' group by', or 'having' phrases. */
    00958 #define SYBECRSBUFR 20260       /* Row buffering should not be turned on when  using cursor APIs. */
    00959 #define SYBECRSNOFREE 20261     /* The DBNOAUTOFREE option should not be  turned on when using cursor APIs. */
    00960 #define SYBECRSDIS 20262        /* Cursor statement contains one of the  disallowed phrases 'compute', 'union', 'for browse', or 'select into'. */
    00961 #define SYBECRSAGR 20263        /* Aggregate functions are not allowed in a  cursor statement. */
    00962 #define SYBECRSFRAND 20264      /* Fetch types RANDOM and RELATIVE can only be  used within the keyset of keyset driven  cursors. */
    00963 #define SYBECRSFLAST 20265      /* Fetch type LAST requires fully keyset  driven cursors. */
    00964 #define SYBECRSBROL 20266       /* Backward scrolling cannot be used in a  forward scrolling cursor. */
    00965 #define SYBECRSFROWN 20267      /* Row number to be fetched is outside valid  range. */
    00966 #define SYBECRSBSKEY 20268      /* Keyset cannot be scrolled backward in mixed  cursors with a previous fetch type. */
    00967 #define SYBECRSRO 20269         /* Data locking or modifications cannot be  made in a READONLY cursor. */
    00968 #define SYBECRSNOCOUNT 20270    /* The DBNOCOUNT option should not be  turned on when doing updates or deletes with  dbcursor(). */
    00969 #define SYBECRSTAB 20271        /* Table name must be determined in operations  involving data locking or modifications. */
    00970 #define SYBECRSUPDNB 20272      /* Update or insert operations cannot use bind  variables when binding type is NOBIND. */
    00971 #define SYBECRSNOWHERE 20273    /* A WHERE clause is not allowed in a cursor  update or insert. */
    00972 #define SYBECRSSET 20274        /* A SET clause is required for a cursor  update or insert.  */
    00973 #define SYBECRSUPDTAB 20275     /* Update or insert operations using bind  variables require single table cursors. */
    00974 #define SYBECRSNOUPD 20276      /* Update or delete operation did not affect  any rows. */
    00975 #define SYBECRSINV 20277        /* Invalid cursor statement. */
    00976 #define SYBECRSNOKEYS 20278     /* The entire keyset must be defined for KEYSET cursors. */
    00977 #define SYBECRSNOBIND  20279    /* Cursor bind must be called prior to updating cursor */
    00978 #define SYBECRSFTYPE    20280   /* Unknown fetch type. */
    00979 #define SYBECRSINVALID  20281   /* The cursor handle is invalid. */
    00980 #define SYBECRSMROWS  20282     /* Multiple rows are returned, only one is expected. */
    00981 #define SYBECRSNROWS 20283      /* No rows returned, at least one is expected. */
    00982 #define SYBECRSNOLEN  20284     /* No unique index found. */
    00983 #define SYBECRSNOPTCC 20285     /* No OPTCC was found. */
    00984 #define SYBECRSNORDER  20286    /* The order of clauses must be from, where, and order by. */
    00985 #define SYBECRSNOTABLE  20287   /* Table name is NULL. */
    00986 #define SYBECRSNUNIQUE  20288   /* No unique keys associated with this view. */
    00987 #define SYBECRSVAR  20289       /* There is no valid address associated with this bind. */
    00988 #define SYBENOVALUE  20290      /* Security labels require both a name and a value */
    00989 #define SYBEVOIDRET 20291       /* Parameter of type SYBVOID cannot  be a return parameter. */
    00990 #define SYBECLOSEIN 20292       /* Unable to close interface file. */
    00991 #define SYBEBOOL 20293          /* Boolean parameters must be TRUE or FALSE. */
    00992 #define SYBEBCPOPT 20294        /* The %s option cannot be called while a bulk copy operation is progress. */
    00993 #define SYBEERRLABEL 20295      /* An illegal value was returned from the security label handler. */
    00994 #define SYBEATTNACK 20296       /* Timed out waiting for server to acknowledge attention." */
    00995 #define SYBEBBFL 20297          /* -001- Batch failed in bulk-copy to SQL Server */
    00996 #define SYBEDCL 20298           /* -004- DCL Error */
    00997 #define SYBECS 20299            /* -004- cs context Error */
    00998 #define SYBEBULKINSERT 20599    /* cannot build bulk insert statement */
    00999
    01000 int dbtds(DBPROCESS * dbprocess);
    01001
    01002 #define DBTDS(a)                dbtds(a)
    01003 DBINT dbtextsize(DBPROCESS * dbprocess);
    01004 int dbtsnewlen(DBPROCESS * dbprocess);
    01005 DBBINARY *dbtsnewval(DBPROCESS * dbprocess);
    01006 RETCODE dbtsput(DBPROCESS * dbprocess, DBBINARY * newts, int newtslen, int tabnum, char *tabname);
    01007 DBBINARY *dbtxptr(DBPROCESS * dbproc, int column);
    01008 DBBINARY *dbtxtimestamp(DBPROCESS * dbproc, int column);
    01009 DBBINARY *dbtxtsnewval(DBPROCESS * dbprocess);
    01010 RETCODE dbtxtsput(DBPROCESS * dbprocess, DBBINARY newtxts, int colnum);
    01011 RETCODE dbuse(DBPROCESS * dbproc, char *name);
    01012 DBBOOL dbcarylen(DBPROCESS * dbprocess, int column);
    01013 const char *dbversion(void);
    01014 DBBOOL dbwillconvert(int srctype, int desttype);
    01015 RETCODE dbwritepage(DBPROCESS * dbprocess, char *p_dbname, DBINT pageno, DBINT size, BYTE * buf);
    01016 RETCODE dbwritetext(DBPROCESS * dbproc, char *objname, DBBINARY * textptr, DBTINYINT textptrlen, DBBINARY * timestamp,
    01017                     DBBOOL log, DBINT size, BYTE * text);
    01018 int dbxlate(DBPROCESS * dbprocess, char *src, int srclen, char *dest, int destlen, DBXLATE * xlt, int *srcbytes_used,
    01019             DBBOOL srcend, int status);
    01020
    01021 /* LOGINREC manipulation */
    01022 RETCODE dbsetlname(LOGINREC * login, const char *value, int which);
    01023 RETCODE dbsetlbool(LOGINREC * login, int value, int which);
    01024 RETCODE dbsetlshort(LOGINREC * login, int value, int which);
    01025 RETCODE dbsetllong(LOGINREC * login, long value, int which);
    01026 RETCODE dbsetlversion (LOGINREC * login, BYTE version);
    01027
    01028 #define DBSETHOST               1
    01029 #define DBSETLHOST(x,y)         dbsetlname((x), (y), DBSETHOST)
    01030 #define DBSETUSER               2
    01031 #define DBSETLUSER(x,y)         dbsetlname((x), (y), DBSETUSER)
    01032 #define DBSETPWD                3
    01033 #define DBSETLPWD(x,y)          dbsetlname((x), (y), DBSETPWD)
    01034 #define DBSETHID                4       /* not implemented */
    01035 #define DBSETLHID(x,y)          dbsetlname((x), (y), DBSETHID)
    01036 #define DBSETAPP                5
    01037 #define DBSETLAPP(x,y)          dbsetlname((x), (y), DBSETAPP)
    01038 #define DBSETBCP                6
    01039 #define BCP_SETL(x,y)           dbsetlbool((x), (y), DBSETBCP)
    01040 #define DBSETNATLANG            7
    01041 #define DBSETLNATLANG(x,y)      dbsetlname((x), (y), DBSETNATLANG)
    01042 #define DBSETNOSHORT            8       /* not implemented */
    01043 #define DBSETLNOSHORT(x,y)      dbsetlbool((x), (y), DBSETNOSHORT)
    01044 #define DBSETHIER               9       /* not implemented */
    01045 #define DBSETLHIER(x,y)         dbsetlshort((x), (y), DBSETHIER)
    01046 #define DBSETCHARSET            10
    01047 #define DBSETLCHARSET(x,y)      dbsetlname((x), (y), DBSETCHARSET)
    01048 #define DBSETPACKET             11
    01049 #define DBSETLPACKET(x,y)       dbsetllong((x), (y), DBSETPACKET)
    01050 #define DBSETENCRYPT            12
    01051 #define DBSETLENCRYPT(x,y)      dbsetlbool((x), (y), DBSETENCRYPT)
    01052 #define DBSETLABELED            13
    01053 #define DBSETLLABELED(x,y)      dbsetlbool((x), (y), DBSETLABELED)
    01054 #define BCP_SETLABELED(x,y)     dbsetlbool((x), (y), DBSETLABELED)
    01055 #define DBSETLVERSION(login, version) dbsetlversion((login), (version))
    01056
    01057 RETCODE bcp_init(DBPROCESS * dbproc, const char *tblname, const char *hfile, const char *errfile, int direction);
    01058 RETCODE bcp_done(DBPROCESS * dbproc);
    01059
    01060 RETCODE bcp_batch(DBPROCESS * dbproc);
    01061 RETCODE bcp_bind(DBPROCESS * dbproc, BYTE * varaddr, int prefixlen, DBINT varlen, BYTE * terminator, int termlen, int type,
    01062                  int table_column);
    01063 RETCODE bcp_collen(DBPROCESS * dbproc, DBINT varlen, int table_column);
    01064 RETCODE bcp_columns(DBPROCESS * dbproc, int host_colcount);
    01065 RETCODE bcp_colfmt(DBPROCESS * dbproc, int host_column, int host_type, int host_prefixlen, DBINT host_collen,
    01066                    const BYTE * host_term, int host_termlen, int colnum);
    01067 RETCODE bcp_colfmt_ps(DBPROCESS * dbproc, int host_column, int host_type, int host_prefixlen, DBINT host_collen,
    01068                       BYTE * host_term, int host_termlen, int colnum, DBTYPEINFO * typeinfo);
    01069 RETCODE bcp_colptr(DBPROCESS * dbproc, BYTE * colptr, int table_column);
    01070 RETCODE bcp_control(DBPROCESS * dbproc, int field, DBINT value);
    01071 RETCODE bcp_exec(DBPROCESS * dbproc, DBINT * rows_copied);
    01072 DBBOOL bcp_getl(LOGINREC * login);
    01073 RETCODE bcp_moretext(DBPROCESS * dbproc, DBINT size, BYTE * text);
    01074 RETCODE bcp_options(DBPROCESS * dbproc, int option, BYTE * value, int valuelen);
    01075 RETCODE bcp_readfmt(DBPROCESS * dbproc, char *filename);
    01076 RETCODE bcp_sendrow(DBPROCESS * dbproc);
    01077 RETCODE bcp_writefmt(DBPROCESS * dbproc, char *filename);
    01078
    01079 void build_xact_string(char *xact_name, char *service_name, DBINT commid, char *result);
    01080 RETCODE remove_xact(DBPROCESS * connect, DBINT commid, int n);
    01081 RETCODE abort_xact(DBPROCESS * connect, DBINT commid);
    01082 void close_commit(DBPROCESS * connect);
    01083 RETCODE commit_xact(DBPROCESS * connect, DBINT commid);
    01084 DBPROCESS *open_commit(LOGINREC * login, char *servername);
    01085 RETCODE scan_xact(DBPROCESS * connect, DBINT commid);
    01086 DBINT start_xact(DBPROCESS * connect, char *application_name, char *xact_name, int site_count);
    01087 DBINT stat_xact(DBPROCESS * connect, DBINT commid);
    01088
    01089 #ifdef __cplusplus
    01090 #if 0
    01091 {
    01092 #endif
    01093 }
    01094 #endif
    01095
    01096 #endif