00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00028 #ifndef _sybdb_h_
00029 #define _sybdb_h_
00030
00031 #include "tds_sysdep_public.h"
00032
00033 #undef TDS_STATIC_CAST
00034 #ifdef __cplusplus
00035 #define TDS_STATIC_CAST(type, a) static_cast<type>(a)
00036 extern "C"
00037 {
00038 #if 0
00039 }
00040 #endif
00041 #else
00042 #define TDS_STATIC_CAST(type, a) ((type)(a))
00043 #endif
00044
00045 static const char rcsid_sybdb_h[] = "$Id: sybdb.h,v 1.106 2011-12-05 02:26:31 jklowden Exp $";
00046 static const void *const no_unused_sybdb_h_warn[] = { rcsid_sybdb_h, no_unused_sybdb_h_warn };
00047
00048 #ifdef FALSE
00049 #undef FALSE
00050 #endif
00051 #ifdef TRUE
00052 #undef TRUE
00053 #endif
00054 #define FALSE 0
00055 #define TRUE 1
00056
00057 #define DBSAVE 1
00058 #define DBNOSAVE 0
00059 #define DBNOERR -1
00060
00061 #define INT_EXIT 0
00062 #define INT_CONTINUE 1
00063 #define INT_CANCEL 2
00064 #define INT_TIMEOUT 3
00065
00066 #define DBMAXNUMLEN 33
00067 #define DBMAXNAME 30
00068
00072 #define DBVERSION_UNKNOWN 0
00073 #define DBVERSION_46 1
00074 #define DBVERSION_100 2
00075 #define DBVERSION_42 3
00076 #define DBVERSION_70 4
00077 #define DBVERSION_71 5
00078 #define DBVERSION_80 DBVERSION_71
00079 #define DBVERSION_72 6
00080 #define DBVERSION_73 7
00081
00082
00083 #define DBVER42 DBVERSION_42
00084 #define DBVER60 DBVERSION_70
00085
00090 #define DBTDS_UNKNOWN 0
00091 #define DBTDS_2_0 1
00092 #define DBTDS_3_4 2
00093 #define DBTDS_4_0 3
00094 #define DBTDS_4_2 4
00095 #define DBTDS_4_6 5
00096 #define DBTDS_4_9_5 6
00097 #define DBTDS_5_0 7
00098 #define DBTDS_7_0 8
00099 #define DBTDS_8_0 9
00100 #define DBTDS_9_0 10
00101 #define DBTDS_7_1 9
00102 #define DBTDS_7_2 10
00103 #define DBTDS_7_3 11
00104
00105 #define DBTXPLEN 16
00106
00107 #define BCPMAXERRS 1
00108 #define BCPFIRST 2
00109 #define BCPLAST 3
00110 #define BCPBATCH 4
00111 #define BCPKEEPIDENTITY 8
00112
00113 #define BCPLABELED 5
00114 #define BCPHINTS 6
00115
00116 #define DBCMDNONE 0
00117 #define DBCMDPEND 1
00118 #define DBCMDSENT 2
00119
00120 typedef int RETCODE;
00121
00122 typedef void DBCURSOR;
00123 typedef void DBXLATE;
00124 typedef void DBSORTORDER;
00125 typedef void DBLOGINFO;
00126 typedef void *DBVOIDPTR;
00127 typedef short SHORT;
00128 typedef unsigned short USHORT;
00129 typedef int (*INTFUNCPTR) (void *, ...);
00130 typedef int (*DBWAITFUNC) (void);
00131 typedef DBWAITFUNC(*DB_DBBUSY_FUNC) (void *dbproc);
00132 typedef void (*DB_DBIDLE_FUNC) (DBWAITFUNC dfunc, void *dbproc);
00133 typedef int (*DB_DBCHKINTR_FUNC) (void *dbproc);
00134 typedef int (*DB_DBHNDLINTR_FUNC) (void *dbproc);
00135
00136 #ifndef __INCvxWorksh
00137
00138
00139
00140
00141 #ifdef STATUS
00142
00143
00144
00145 #undef STATUS
00146 #endif
00147 typedef int STATUS;
00148 #if !defined(_WINDEF_) && !defined(_WINDEF_H) && !defined(DOS32X)
00149 typedef int BOOL;
00150 #endif
00151 #endif
00152
00153 #ifndef _tds_h_
00154
00155
00156 enum
00157 {
00158 SYBCHAR = 47,
00159 #define SYBCHAR SYBCHAR
00160 SYBVARCHAR = 39,
00161 #define SYBVARCHAR SYBVARCHAR
00162 SYBINTN = 38,
00163 #define SYBINTN SYBINTN
00164 SYBINT1 = 48,
00165 #define SYBINT1 SYBINT1
00166 SYBINT2 = 52,
00167 #define SYBINT2 SYBINT2
00168 SYBINT4 = 56,
00169 #define SYBINT4 SYBINT4
00170 SYBINT8 = 127,
00171 #define SYBINT8 SYBINT8
00172 SYBFLT8 = 62,
00173 #define SYBFLT8 SYBFLT8
00174 SYBDATETIME = 61,
00175 #define SYBDATETIME SYBDATETIME
00176 SYBBIT = 50,
00177 #define SYBBIT SYBBIT
00178 SYBBITN = 104,
00179 #define SYBBITN SYBBITN
00180 SYBTEXT = 35,
00181 #define SYBTEXT SYBTEXT
00182 SYBNTEXT = 99,
00183 #define SYBNTEXT SYBNTEXT
00184 SYBIMAGE = 34,
00185 #define SYBIMAGE SYBIMAGE
00186 SYBMONEY4 = 122,
00187 #define SYBMONEY4 SYBMONEY4
00188 SYBMONEY = 60,
00189 #define SYBMONEY SYBMONEY
00190 SYBDATETIME4 = 58,
00191 #define SYBDATETIME4 SYBDATETIME4
00192 SYBREAL = 59,
00193 #define SYBREAL SYBREAL
00194 SYBBINARY = 45,
00195 #define SYBBINARY SYBBINARY
00196 SYBVOID = 31,
00197 #define SYBVOID SYBVOID
00198 SYBVARBINARY = 37,
00199 #define SYBVARBINARY SYBVARBINARY
00200 SYBNUMERIC = 108,
00201 #define SYBNUMERIC SYBNUMERIC
00202 SYBDECIMAL = 106,
00203 #define SYBDECIMAL SYBDECIMAL
00204 SYBFLTN = 109,
00205 #define SYBFLTN SYBFLTN
00206 SYBMONEYN = 110,
00207 #define SYBMONEYN SYBMONEYN
00208 SYBDATETIMN = 111,
00209 #define SYBDATETIMN SYBDATETIMN
00210 SYBNVARCHAR = 103
00211 #define SYBNVARCHAR SYBNVARCHAR
00212 };
00213
00214 #define SYBAOPCNT 0x4b
00215 #define SYBAOPCNTU 0x4c
00216 #define SYBAOPSUM 0x4d
00217 #define SYBAOPSUMU 0x4e
00218 #define SYBAOPAVG 0x4f
00219 #define SYBAOPAVGU 0x50
00220 #define SYBAOPMIN 0x51
00221 #define SYBAOPMAX 0x52
00222
00223
00224 #define SYBAOPCNT_BIG 0x09
00225 #define SYBAOPSTDEV 0x30
00226 #define SYBAOPSTDEVP 0x31
00227 #define SYBAOPVAR 0x32
00228 #define SYBAOPVARP 0x33
00229 #define SYBAOPCHECKSUM_AGG 0x72
00230
00231 #endif
00232
00233 typedef unsigned char DBBOOL;
00234 typedef char DBCHAR;
00235 typedef unsigned char DBBIT;
00236 typedef unsigned char DBTINYINT;
00237 typedef tds_sysdep_int16_type DBSMALLINT;
00238 typedef tds_sysdep_int32_type DBINT;
00239 typedef tds_sysdep_int64_type DBBIGINT;
00240 typedef unsigned char DBBINARY;
00241 typedef tds_sysdep_real32_type DBREAL;
00242 typedef tds_sysdep_real64_type DBFLT8;
00243 typedef unsigned tds_sysdep_int16_type DBUSMALLINT;
00244
00245 typedef struct
00246 {
00247 DBSMALLINT len;
00248 char str[256];
00249 } DBVARYCHAR;
00250
00251 typedef struct
00252 {
00253 DBSMALLINT len;
00254 unsigned char array[256];
00255 } DBVARYBIN;
00256
00257 typedef struct
00258 {
00259 unsigned char precision;
00260 unsigned char scale;
00261 unsigned char array[33];
00262 } DBNUMERIC;
00263
00264 typedef DBNUMERIC DBDECIMAL;
00265
00266 typedef struct
00267 {
00268 DBINT mnyhigh;
00269 unsigned tds_sysdep_int32_type mnylow;
00270 } DBMONEY;
00271
00272 typedef struct
00273 {
00274 DBINT mny4;
00275 } DBMONEY4;
00276
00277 typedef struct
00278 {
00279 DBINT dtdays;
00280 DBINT dttime;
00281 } DBDATETIME;
00282
00283 typedef struct
00284 {
00285 DBUSMALLINT days;
00286 DBUSMALLINT minutes;
00287 } DBDATETIME4;
00288
00289 #ifdef MSDBLIB
00290 # define SQLCHAR SYBCHAR
00291 typedef struct
00292 {
00293 DBUSMALLINT numdays;
00294 DBUSMALLINT nummins;
00295 } DBDATETIM4;
00296 #endif
00297
00298 typedef struct tds_dblib_loginrec LOGINREC;
00299
00300 #ifndef DOS32X
00301 typedef unsigned char BYTE;
00302 #endif
00303
00304 typedef struct dbtypeinfo
00305 {
00306 DBINT precision;
00307 DBINT scale;
00308 } DBTYPEINFO;
00309
00310 struct dbstring
00311 {
00312 BYTE *strtext;
00313 DBINT strtotlen;
00314 struct dbstring *strnext;
00315 };
00316 typedef struct dbstring DBSTRING;
00317
00318
00319 enum
00320 { MAXCOLNAMELEN = 512 };
00321 typedef enum { CI_REGULAR=1, CI_ALTERNATE=2, CI_CURSOR=3 } CI_TYPE;
00322
00323 typedef struct
00324 {
00325 DBINT SizeOfStruct;
00326 DBCHAR Name[MAXCOLNAMELEN+2];
00327 DBCHAR ActualName[MAXCOLNAMELEN+2];
00328 DBCHAR TableName[MAXCOLNAMELEN+2];
00329 SHORT Type;
00330 DBINT UserType;
00331 DBINT MaxLength;
00332 BYTE Precision;
00333 BYTE Scale;
00334 BOOL VarLength;
00335 BYTE Null;
00336 BYTE CaseSensitive;
00337 BYTE Updatable;
00338 BOOL Identity;
00339
00340 } DBCOL;
00341
00342
00343
00344
00345
00346 #define DBPARSEONLY 0
00347 #define DBESTIMATE 1
00348 #define DBSHOWPLAN 2
00349 #define DBNOEXEC 3
00350 #define DBARITHIGNORE 4
00351 #define DBNOCOUNT 5
00352 #define DBARITHABORT 6
00353 #define DBTEXTLIMIT 7
00354 #define DBBROWSE 8
00355 #define DBOFFSET 9
00356 #define DBSTAT 10
00357 #define DBERRLVL 11
00358 #define DBCONFIRM 12
00359 #define DBSTORPROCID 13
00360 #define DBBUFFER 14
00361 #define DBNOAUTOFREE 15
00362 #define DBROWCOUNT 16
00363 #define DBTEXTSIZE 17
00364 #define DBNATLANG 18
00365 #define DBDATEFORMAT 19
00366 #define DBPRPAD 20
00367 #define DBPRCOLSEP 21
00368 #define DBPRLINELEN 22
00369 #define DBPRLINESEP 23
00370 #define DBLFCONVERT 24
00371 #define DBDATEFIRST 25
00372 #define DBCHAINXACTS 26
00373 #define DBFIPSFLAG 27
00374 #define DBISOLATION 28
00375 #define DBAUTH 29
00376 #define DBIDENTITY 30
00377 #define DBNOIDCOL 31
00378 #define DBDATESHORT 32
00379 #define DBCLIENTCURSORS 33
00380 #define DBSETTIME 34
00381 #define DBQUOTEDIDENT 35
00382
00383 #define DBNUMOPTIONS 36
00384
00385 #define DBPADOFF 0
00386 #define DBPADON 1
00387
00388 #define OFF 0
00389 #define ON 1
00390
00391 #define NOSUCHOPTION 2
00392
00393 #define MAXOPTTEXT 32
00394
00395 typedef struct tds_dblib_dbprocess DBPROCESS;
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405 struct tds_microsoft_dbdaterec
00406 {
00407 DBINT year;
00408 DBINT quarter;
00409 DBINT month;
00410 DBINT day;
00411 DBINT dayofyear;
00412 DBINT week;
00413 DBINT weekday;
00414 DBINT hour;
00415 DBINT minute;
00416 DBINT second;
00417 DBINT millisecond;
00418 DBINT tzone;
00419 };
00420
00421 struct tds_sybase_dbdaterec
00422 {
00423 DBINT dateyear;
00424 DBINT quarter;
00425 DBINT datemonth;
00426 DBINT datedmonth;
00427 DBINT datedyear;
00428 DBINT week;
00429 DBINT datedweek;
00430 DBINT datehour;
00431 DBINT dateminute;
00432 DBINT datesecond;
00433 DBINT datemsecond;
00434 DBINT datetzone;
00435 };
00436
00437 #ifdef MSDBLIB
00438 typedef struct tds_microsoft_dbdaterec DBDATEREC;
00439 #else
00440 typedef struct tds_sybase_dbdaterec DBDATEREC;
00441 #endif
00442
00443 typedef int (*EHANDLEFUNC) (DBPROCESS * dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr);
00444
00445 typedef int (*MHANDLEFUNC) (DBPROCESS * dbproc, DBINT msgno, int msgstate, int severity, char *msgtext, char *srvname,
00446 char *proc, int line);
00447
00448
00449 #define DBRESULT 1
00450 #define DBNOTIFICATION 2
00451 #define DBTIMEOUT 3
00452 #define DBINTERRUPT 4
00453
00454
00455 #define DBTXTSLEN 8
00456
00457
00458 #define CHARBIND 0
00459 #define STRINGBIND 1
00460 #define NTBSTRINGBIND 2
00461 #define VARYCHARBIND 3
00462 #define VARYBINBIND 4
00463 #define TINYBIND 6
00464 #define SMALLBIND 7
00465 #define INTBIND 8
00466 #define FLT8BIND 9
00467 #define REALBIND 10
00468 #define DATETIMEBIND 11
00469 #define SMALLDATETIMEBIND 12
00470 #define MONEYBIND 13
00471 #define SMALLMONEYBIND 14
00472 #define BINARYBIND 15
00473 #define BITBIND 16
00474 #define NUMERICBIND 17
00475 #define DECIMALBIND 18
00476 #define BIGINTBIND 30
00477 #define MAXBINDTYPES 31
00478
00479 #define DBPRCOLSEP 21
00480 #define DBPRLINELEN 22
00481 #define DBRPCRETURN 1
00482 #define DBRPCDEFAULT 2
00483
00484 #define REG_ROW -1
00485 #define MORE_ROWS -1
00486 #define NO_MORE_ROWS -2
00487 #define BUF_FULL -3
00488 #define NO_MORE_RESULTS 2
00489 #define SUCCEED 1
00490 #define FAIL 0
00491
00492 #define DB_IN 1
00493 #define DB_OUT 2
00494 #define DB_QUERYOUT 3
00495
00496 #define DBSINGLE 0
00497 #define DBDOUBLE 1
00498 #define DBBOTH 2
00499
00500
00501 #define DBRPCRECOMPILE TDS_STATIC_CAST(DBSMALLINT, 0x0001)
00502 #define DBRPCRESET TDS_STATIC_CAST(DBSMALLINT, 0x0002)
00503 #define DBRPCCURSOR TDS_STATIC_CAST(DBSMALLINT, 0x0008)
00504
00505 #if defined(DBLIB_UNIMPLEMENTED)
00506 DBBOOL db12hour(DBPROCESS * dbprocess, const char language[]);
00507
00508 DBBOOL dbcolbrowse(DBPROCESS * dbprocess, int colnum);
00509
00510 RETCODE dbcursor(DBCURSOR * hc, DBINT optype, DBINT bufno, BYTE * table, BYTE * values);
00511 RETCODE dbcursorbind(DBCURSOR * hc, int col, int vartype, DBINT varlen, DBINT * poutlen, BYTE * pvaraddr, DBTYPEINFO * typeinfo);
00512 void dbcursorclose(DBCURSOR * hc);
00513 RETCODE dbcursorcolinfo(DBCURSOR * hc, DBINT column, DBCHAR * colname, DBINT * coltype, DBINT * collen, DBINT * usertype);
00514 RETCODE dbcursorfetch(DBCURSOR * hc, DBINT fetchtype, DBINT rownum);
00515 RETCODE dbcursorinfo(DBCURSOR * hc, DBINT * ncols, DBINT * nrows);
00516 DBCURSOR *dbcursoropen(DBPROCESS * dbprocess, BYTE * stmt, SHORT scollopt, SHORT concuropt, USHORT nrows, DBINT * pstatus);
00517
00518 int dbdate4cmp(DBPROCESS * dbprocess, DBDATETIME4 * d1, DBDATETIME4 * d2);
00519 RETCODE dbdate4zero(DBPROCESS * dbprocess, DBDATETIME4 * d1);
00520 RETCODE dbdatechar(DBPROCESS * dbprocess, char *buf, int datepart, int value);
00521 int dbdatename(DBPROCESS * dbprocess, char *buf, int date, DBDATETIME * datetime);
00522 char *dateorder(DBPROCESS * dbprocess, char *language);
00523 DBINT dbdatepart(DBPROCESS * dbprocess, int datepart, DBDATETIME * datetime);
00524 RETCODE dbdatezero(DBPROCESS * dbprocess, DBDATETIME * d1);
00525 char *dbdayname(DBPROCESS * dbprocess, char *language, int daynum);
00526
00527 int dbgetoff(DBPROCESS * dbprocess, DBUSMALLINT offtype, int startfrom);
00528
00529 char *dbqual(DBPROCESS * dbprocess, int tabnum, char *tabname);
00530 void dbfreequal(char *qualptr);
00531
00532 DBSORTORDER *dbloadsort(DBPROCESS * dbprocess);
00533 RETCODE dbfreesort(DBPROCESS * dbprocess, DBSORTORDER * sortorder);
00534
00535 RETCODE dbload_xlate(DBPROCESS * dbprocess, char *srv_charset, char *clt_name, DBXLATE ** xlt_tosrv, DBXLATE ** xlt_todisp);
00536
00537 RETCODE dbmny4divide(DBPROCESS * dbproc, DBMONEY4 * m1, DBMONEY4 * m2, DBMONEY4 * quotient);
00538 RETCODE dbmny4mul(DBPROCESS * dbproc, DBMONEY4 * m1, DBMONEY4 * m2, DBMONEY4 * prod);
00539 RETCODE dbmnyadd(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2, DBMONEY * sum);
00540 RETCODE dbmnydivide(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2, DBMONEY * quotient);
00541 RETCODE dbmnydown(DBPROCESS * dbproc, DBMONEY * mnyptr, int divisor, int *remainder);
00542 RETCODE dbmnyinit(DBPROCESS * dbproc, DBMONEY * mnyptr, int trim, DBBOOL * negative);
00543 RETCODE dbmnyndigit(DBPROCESS * dbproc, DBMONEY * mnyptr, DBCHAR * value, DBBOOL * zero);
00544 RETCODE dbmnymul(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2, DBMONEY * prod);
00545 RETCODE dbmnydigit(DBPROCESS * dbprocess, DBMONEY * m1, DBCHAR * value, DBBOOL * zero);
00546 RETCODE dbmnyscale(DBPROCESS * dbproc, DBMONEY * dest, int multiplier, int addend);
00547
00548
00549 RETCODE dbnpcreate(DBPROCESS * dbprocess);
00550 RETCODE dbnpdefine(DBPROCESS * dbprocess, DBCHAR * procedure_name, DBSMALLINT namelen);
00551
00552 int DBNUMORDERS(DBPROCESS * dbprocess);
00553
00554 RETCODE dbpoll(DBPROCESS * dbproc, long milliseconds, DBPROCESS ** ready_dbproc, int *return_reason);
00555 int dbordercol(DBPROCESS * dbprocess, int order);
00556
00557 RETCODE dbregdrop(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
00558 RETCODE dbregexec(DBPROCESS * dbproc, DBUSMALLINT options);
00559 RETCODE dbreghandle(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, INTFUNCPTR handler);
00560 RETCODE dbreginit(DBPROCESS * dbproc, DBCHAR * procedure_name, DBSMALLINT namelen);
00561 RETCODE dbreglist(DBPROCESS * dbproc);
00562 RETCODE dbregnowatch(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
00563 RETCODE dbregparam(DBPROCESS * dbproc, char *param_name, int type, DBINT datalen, BYTE * data);
00564 RETCODE dbregwatch(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, DBUSMALLINT options);
00565 RETCODE dbregwatchlist(DBPROCESS * dbprocess);
00566
00567 void dbrpwclr(LOGINREC * login);
00568 RETCODE dbrpwset(LOGINREC * login, char *srvname, char *password, int pwlen);
00569
00570 DBINT dbreadpage(DBPROCESS * dbprocess, char *p_dbname, DBINT pageno, BYTE * buf);
00571 RETCODE dbwritepage(DBPROCESS * dbprocess, char *p_dbname, DBINT pageno, DBINT size, BYTE * buf);
00572
00573 RETCODE dbsetdeflang(char *language);
00574
00575 int dbstrcmp(DBPROCESS * dbprocess, char *s1, int l1, char *s2, int l2, DBSORTORDER * sort);
00576 int dbstrsort(DBPROCESS * dbprocess, char *s1, int l1, char *s2, int l2, DBSORTORDER * sort);
00577
00578 DBBOOL dbtabbrowse(DBPROCESS * dbprocess, int tabnum);
00579 int dbtabcount(DBPROCESS * dbprocess);
00580 char *dbtabname(DBPROCESS * dbprocess, int tabnum);
00581 char *dbtabsoruce(DBPROCESS * dbprocess, int colnum, int *tabnum);
00582
00583 RETCODE dbsetlshort(LOGINREC * login, int value, int which);
00584
00585 RETCODE dbsendpassthru(DBPROCESS * dbprocess, DBVOIDPTR bufp);
00586 RETCODE dbrecvpassthru(DBPROCESS * dbprocess, DBVOIDPTR * bufp);
00587
00588 RETCODE dbgetloginfo(DBPROCESS * dbprocess, DBLOGINFO ** loginfo);
00589 RETCODE dbsetloginfo(LOGINREC * loginrec, DBLOGINFO * loginfo);
00590
00591 int dbtsnewlen(DBPROCESS * dbprocess);
00592 DBBINARY *dbtsnewval(DBPROCESS * dbprocess);
00593 RETCODE dbtsput(DBPROCESS * dbprocess, DBBINARY * newts, int newtslen, int tabnum, char *tabname);
00594
00595 RETCODE dbfree_xlate(DBPROCESS * dbprocess, DBXLATE * xlt_tosrv, DBXLATE * clt_todisp);
00596 int dbxlate(DBPROCESS * dbprocess, char *src, int srclen, char *dest, int destlen, DBXLATE * xlt, int *srcbytes_used,
00597 DBBOOL srcend, int status);
00598
00599 RETCODE bcp_moretext(DBPROCESS * dbproc, DBINT size, BYTE * text);
00600 RETCODE bcp_writefmt(DBPROCESS * dbproc, const char filename[]);
00601
00602 void build_xact_string(char *xact_name, char *service_name, DBINT commid, char *result);
00603 RETCODE remove_xact(DBPROCESS * connect, DBINT commid, int n);
00604 RETCODE abort_xact(DBPROCESS * connect, DBINT commid);
00605 void close_commit(DBPROCESS * connect);
00606 RETCODE commit_xact(DBPROCESS * connect, DBINT commid);
00607 DBPROCESS *open_commit(LOGINREC * login, char *servername);
00608 RETCODE scan_xact(DBPROCESS * connect, DBINT commid);
00609 DBINT start_xact(DBPROCESS * connect, char *application_name, char *xact_name, int site_count);
00610 DBINT stat_xact(DBPROCESS * connect, DBINT commid);
00611
00612 #endif
00613
00614 BYTE *dbadata(DBPROCESS * dbproc, int computeid, int column);
00615 DBINT dbadlen(DBPROCESS * dbproc, int computeid, int column);
00616 RETCODE dbaltbind(DBPROCESS * dbprocess, int computeid, int column, int vartype, DBINT varlen, BYTE * varaddr);
00617 RETCODE dbaltbind_ps(DBPROCESS * dbprocess, int computeid, int column, int vartype, DBINT varlen, BYTE * varaddr,
00618 DBTYPEINFO * typeinfo);
00619 int dbaltcolid(DBPROCESS * dbproc, int computeid, int column);
00620 DBINT dbaltlen(DBPROCESS * dbproc, int computeid, int column);
00621 int dbaltop(DBPROCESS * dbproc, int computeid, int column);
00622 int dbalttype(DBPROCESS * dbproc, int computeid, int column);
00623 DBINT dbaltutype(DBPROCESS * dbproc, int computeid, int column);
00624 RETCODE dbanullbind(DBPROCESS * dbprocess, int computeid, int column, DBINT * indicator);
00625 RETCODE dbbind(DBPROCESS * dbproc, int column, int vartype, DBINT varlen, BYTE * varaddr);
00626 RETCODE dbbind_ps(DBPROCESS * dbprocess, int column, int vartype, DBINT varlen, BYTE * varaddr, DBTYPEINFO * typeinfo);
00627 int dbbufsize(DBPROCESS * dbprocess);
00628 BYTE *dbbylist(DBPROCESS * dbproc, int computeid, int *size);
00629 RETCODE dbcancel(DBPROCESS * dbproc);
00630 RETCODE dbcanquery(DBPROCESS * dbproc);
00631 char *dbchange(DBPROCESS * dbprocess);
00632 DBBOOL dbcharsetconv(DBPROCESS * dbprocess);
00633 void dbclose(DBPROCESS * dbproc);
00634 void dbclrbuf(DBPROCESS * dbproc, DBINT n);
00635 RETCODE dbclropt(DBPROCESS * dbproc, int option, const char param[]);
00636 RETCODE dbcmd(DBPROCESS * dbproc, const char cmdstring[]);
00637 RETCODE dbcmdrow(DBPROCESS * dbproc);
00638
00639 #define DBCMDROW(x) dbcmdrow((x))
00640 RETCODE dbtablecolinfo (DBPROCESS *dbproc, DBINT column, DBCOL *pdbcol );
00641 RETCODE dbcolinfo (DBPROCESS *dbproc, CI_TYPE type, DBINT column, DBINT computeid, DBCOL *pdbcol);
00642 DBINT dbcollen(DBPROCESS * dbproc, int column);
00643 char *dbcolname(DBPROCESS * dbproc, int column);
00644 char *dbcolsource(DBPROCESS * dbproc, int colnum);
00645 int dbcoltype(DBPROCESS * dbproc, int column);
00646 DBTYPEINFO *dbcoltypeinfo(DBPROCESS * dbproc, int column);
00647 DBINT dbcolutype(DBPROCESS * dbprocess, int column);
00648 DBINT dbconvert(DBPROCESS * dbproc, int srctype, const BYTE * src, DBINT srclen, int desttype, BYTE * dest, DBINT destlen);
00649 DBINT dbconvert_ps(DBPROCESS * dbprocess, int srctype, BYTE * src, DBINT srclen, int desttype, BYTE * dest, DBINT destlen,
00650 DBTYPEINFO * typeinfo);
00651 BOOL dbiscount(DBPROCESS * dbproc);
00652 DBINT dbcount(DBPROCESS * dbproc);
00653
00654 #define DBCOUNT(x) dbcount((x))
00655 int dbcurcmd(DBPROCESS * dbproc);
00656
00657 #define DBCURCMD(x) dbcurcmd((x))
00658 DBINT dbcurrow(DBPROCESS * dbproc);
00659
00660 #define DBCURROW(x) dbcurrow((x))
00661 BYTE *dbdata(DBPROCESS * dbproc, int column);
00662 int dbdatecmp(DBPROCESS * dbproc, DBDATETIME * d1, DBDATETIME * d2);
00663 RETCODE dbdatecrack(DBPROCESS * dbproc, DBDATEREC * di, DBDATETIME * dt);
00664 DBINT dbdatlen(DBPROCESS * dbproc, int column);
00665 DBBOOL dbdead(DBPROCESS * dbproc);
00666
00667 #define DBDEAD(x) dbdead((x))
00668 EHANDLEFUNC dberrhandle(EHANDLEFUNC handler);
00669 void dbexit(void);
00670 RETCODE dbfcmd(DBPROCESS * dbproc, const char *fmt, ...);
00671 DBINT dbfirstrow(DBPROCESS * dbproc);
00672
00673 #define DBFIRSTROW(x) dbfirstrow((x))
00674 void dbfreebuf(DBPROCESS * dbproc);
00675 char *dbgetchar(DBPROCESS * dbprocess, int n);
00676 char *dbgetcharset(DBPROCESS * dbprocess);
00677 int dbgetlusername(LOGINREC * login, BYTE * name_buffer, int buffer_len);
00678 int dbgetmaxprocs(void);
00679 char *dbgetnatlanf(DBPROCESS * dbprocess);
00680 int dbgetpacket(DBPROCESS * dbproc);
00681 RETCODE dbgetrow(DBPROCESS * dbproc, DBINT row);
00682 int dbgettime(void);
00683 #define DBGETTIME dbgettime
00684 BYTE *dbgetuserdata(DBPROCESS * dbproc);
00685 DBBOOL dbhasretstat(DBPROCESS * dbproc);
00686 RETCODE dbinit(void);
00687 int dbiordesc(DBPROCESS * dbproc);
00688
00689 #define DBIORDESC(x) dbiordesc((x))
00690 int dbiowdesc(DBPROCESS * dbproc);
00691
00692 #define DBIOWDESC(x) dbiowdesc((x))
00693 DBBOOL dbisavail(DBPROCESS * dbprocess);
00694
00695 #define DBISAVAIL(x) dbisavail((x))
00696 DBBOOL dbisopt(DBPROCESS * dbproc, int option, const char param[]);
00697 DBINT dblastrow(DBPROCESS * dbproc);
00698
00699 #define DBLASTROW(x) dblastrow((x))
00700 LOGINREC *dblogin(void);
00701 void dbloginfree(LOGINREC * login);
00702
00703 int dbmny4cmp(DBPROCESS * dbproc, DBMONEY4 * m1, DBMONEY4 * m2);
00704 int dbmnycmp(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2);
00705
00706 RETCODE dbmny4add(DBPROCESS * dbproc, DBMONEY4 * m1, DBMONEY4 * m2, DBMONEY4 * sum);
00707 RETCODE dbmnydec(DBPROCESS * dbproc, DBMONEY * mnyptr);
00708 RETCODE dbmnyinc(DBPROCESS * dbproc, DBMONEY * mnyptr);
00709 RETCODE dbmnymaxpos(DBPROCESS * dbproc, DBMONEY * dest);
00710 RETCODE dbmnymaxneg(DBPROCESS * dbproc, DBMONEY * dest);
00711 RETCODE dbmny4minus(DBPROCESS * dbproc, DBMONEY4 * src, DBMONEY4 * dest);
00712 RETCODE dbmnyminus(DBPROCESS * dbproc, DBMONEY * src, DBMONEY * dest);
00713 RETCODE dbmny4sub(DBPROCESS * dbproc, DBMONEY4 * m1, DBMONEY4 * m2, DBMONEY4 * diff);
00714 RETCODE dbmnysub(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2, DBMONEY * diff);
00715
00716 RETCODE dbmny4copy(DBPROCESS * dbprocess, DBMONEY4 * m1, DBMONEY4 * m2);
00717 RETCODE dbmnycopy(DBPROCESS * dbproc, DBMONEY * src, DBMONEY * dest);
00718
00719 RETCODE dbmny4zero(DBPROCESS * dbproc, DBMONEY4 * dest);
00720 RETCODE dbmnyzero(DBPROCESS * dbproc, DBMONEY * dest);
00721
00722 const char *dbmonthname(DBPROCESS * dbproc, char *language, int monthnum, DBBOOL shortform);
00723 RETCODE dbmorecmds(DBPROCESS * dbproc);
00724
00725 #define DBMORECMDS(x) dbmorecmds((x))
00726 RETCODE dbmoretext(DBPROCESS * dbproc, DBINT size, const BYTE text[]);
00727 MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler);
00728 char *dbname(DBPROCESS * dbproc);
00729 STATUS dbnextrow(DBPROCESS * dbproc);
00730 RETCODE dbnullbind(DBPROCESS * dbproc, int column, DBINT * indicator);
00731 int dbnumalts(DBPROCESS * dbproc, int computeid);
00732 int dbnumcols(DBPROCESS * dbproc);
00733 int dbnumcompute(DBPROCESS * dbprocess);
00734 int dbnumrets(DBPROCESS * dbproc);
00735 DBPROCESS *tdsdbopen(LOGINREC * login, const char *server, int msdblib);
00736 DBPROCESS *dbopen(LOGINREC * login, const char *server);
00737
00738
00739 struct col_t;
00740 void dbpivot_count (struct col_t *output, const struct col_t *input);
00741 void dbpivot_sum (struct col_t *output, const struct col_t *input);
00742 void dbpivot_min (struct col_t *output, const struct col_t *input);
00743 void dbpivot_max (struct col_t *output, const struct col_t *input);
00744
00745 struct pivot_t;
00746 typedef void (*DBPIVOT_FUNC)(struct col_t *output, const struct col_t *input);
00747 struct pivot_t * dbrows_pivoted(DBPROCESS *dbproc);
00748 STATUS dbnextrow_pivoted(DBPROCESS *dbproc, struct pivot_t *pp);
00749 RETCODE dbpivot(DBPROCESS *dbproc, int nkeys, int *keys, int ncols, int *cols, DBPIVOT_FUNC func, int val);
00750
00751 DBPIVOT_FUNC dbpivot_lookup_name( const char name[] );
00752
00753 #ifdef MSDBLIB
00754 #define dbopen(x,y) tdsdbopen((x),(y), 1)
00755 #else
00756 #define dbopen(x,y) tdsdbopen((x),(y), 0)
00757 #endif
00758
00759
00760 #ifdef PHP_SYBASE_DBOPEN
00761 #undef PHP_SYBASE_DBOPEN
00762 #define PHP_SYBASE_DBOPEN dbopen
00763 #endif
00764
00765 void dbprhead(DBPROCESS * dbproc);
00766 RETCODE dbprrow(DBPROCESS * dbproc);
00767 const char *dbprtype(int token);
00768 DBBOOL DRBUF(DBPROCESS * dbprocess);
00769 STATUS dbreadtext(DBPROCESS * dbproc, void *buf, DBINT bufsize);
00770 void dbrecftos(const char filename[]);
00771 RETCODE dbresults(DBPROCESS * dbproc);
00772 RETCODE dbresults_r(DBPROCESS * dbproc, int recursive);
00773 BYTE *dbretdata(DBPROCESS * dbproc, int retnum);
00774 int dbretlen(DBPROCESS * dbproc, int retnum);
00775 char *dbretname(DBPROCESS * dbproc, int retnum);
00776 DBINT dbretstatus(DBPROCESS * dbproc);
00777 int dbrettype(DBPROCESS * dbproc, int retnum);
00778 RETCODE dbrows(DBPROCESS * dbproc);
00779
00780 #define DBROWS(x) dbrows((x))
00781 STATUS dbrowtype(DBPROCESS * dbprocess);
00782
00783 #define DBROWTYPE(x) dbrowtype((x))
00784 RETCODE dbrpcinit(DBPROCESS * dbproc, const char rpcname[], DBSMALLINT options);
00785 RETCODE dbrpcparam(DBPROCESS * dbproc, const char paramname[], BYTE status, int type, DBINT maxlen, DBINT datalen, BYTE * value);
00786 RETCODE dbrpcsend(DBPROCESS * dbproc);
00787 RETCODE dbsafestr(DBPROCESS * dbproc, const char *src, DBINT srclen, char *dest, DBINT destlen, int quotetype);
00788 RETCODE *dbsechandle(DBINT type, INTFUNCPTR handler);
00789 char *dbservcharset(DBPROCESS * dbprocess);
00790 void dbsetavail(DBPROCESS * dbprocess);
00791 void dbsetbusy(DBPROCESS * dbprocess, DB_DBBUSY_FUNC busyfunc);
00792 RETCODE dbsetdefcharset(char *charset);
00793 void dbsetidle(DBPROCESS * dbprocess, DB_DBIDLE_FUNC idlefunc);
00794 void dbsetifile(char *filename);
00795 void dbsetinterrupt(DBPROCESS * dbproc, DB_DBCHKINTR_FUNC chkintr, DB_DBHNDLINTR_FUNC hndlintr);
00796 RETCODE dbsetlogintime(int seconds);
00797 RETCODE dbsetmaxprocs(int maxprocs);
00798 RETCODE dbsetnull(DBPROCESS * dbprocess, int bindtype, int bindlen, BYTE * bindval);
00799 RETCODE dbsetopt(DBPROCESS * dbproc, int option, const char *char_param, int int_param);
00800 STATUS dbsetrow(DBPROCESS * dbprocess, DBINT row);
00801 RETCODE dbsettime(int seconds);
00802 void dbsetuserdata(DBPROCESS * dbproc, BYTE * ptr);
00803 RETCODE dbsetversion(DBINT version);
00804
00805 int dbspid(DBPROCESS * dbproc);
00806 RETCODE dbspr1row(DBPROCESS * dbproc, char *buffer, DBINT buf_len);
00807 DBINT dbspr1rowlen(DBPROCESS * dbproc);
00808 RETCODE dbsprhead(DBPROCESS * dbproc, char *buffer, DBINT buf_len);
00809 RETCODE dbsprline(DBPROCESS * dbproc, char *buffer, DBINT buf_len, DBCHAR line_char);
00810 RETCODE dbsqlexec(DBPROCESS * dbproc);
00811 RETCODE dbsqlok(DBPROCESS * dbproc);
00812 RETCODE dbsqlsend(DBPROCESS * dbproc);
00813 int dbstrbuild(DBPROCESS * dbproc, char *charbuf, int bufsize, char *text, char *formats, ...);
00814 RETCODE dbstrcpy(DBPROCESS * dbproc, int start, int numbytes, char *dest);
00815 int dbstrlen(DBPROCESS * dbproc);
00816 DBINT dbvarylen(DBPROCESS * dbproc, int column);
00817
00818 #define SYBEVERDOWN 100
00819 #define SYBEICONVIU 2400
00820 #define SYBEICONVAVAIL 2401
00821 #define SYBEICONVO 2402
00822 #define SYBEICONVI 2403
00823 #define SYBEICONV2BIG 2404
00824
00825
00826 #define SYBETDSVER 2410
00827 #define SYBEPORT 2500
00828 #define SYBESYNC 20001
00829 #define SYBEFCON 20002
00830 #define SYBETIME 20003
00831 #define SYBEREAD 20004
00832 #define SYBEBUFL 20005
00833 #define SYBEWRIT 20006
00834 #define SYBEVMS 20007
00835 #define SYBESOCK 20008
00836 #define SYBECONN 20009
00837 #define SYBEMEM 20010
00838 #define SYBEDBPS 20011
00839 #define SYBEINTF 20012
00840 #define SYBEUHST 20013
00841 #define SYBEPWD 20014
00842 #define SYBEOPIN 20015
00843 #define SYBEINLN 20016
00844 #define SYBESEOF 20017
00845 #define SYBESMSG 20018
00846 #define SYBERPND 20019
00847 #define SYBEBTOK 20020
00848 #define SYBEITIM 20021
00849 #define SYBEOOB 20022
00850 #define SYBEBTYP 20023
00851 #define SYBEBNCR 20024
00852 #define SYBEIICL 20025
00853 #define SYBECNOR 20026
00854 #define SYBENPRM 20027
00855 #define SYBEUVDT 20028
00856 #define SYBEUFDT 20029
00857 #define SYBEWAID 20030
00858 #define SYBECDNS 20031
00859 #define SYBEABNC 20032
00860 #define SYBEABMT 20033
00861 #define SYBEABNP 20034
00862 #define SYBEAAMT 20035
00863 #define SYBENXID 20036
00864 #define SYBERXID 20037
00865 #define SYBEICN 20038
00866 #define SYBENMOB 20039
00867 #define SYBEAPUT 20040
00868 #define SYBEASNL 20041
00869 #define SYBENTLL 20042
00870 #define SYBEASUL 20043
00871 #define SYBERDNR 20044
00872 #define SYBENSIP 20045
00873 #define SYBEABNV 20046
00874 #define SYBEDDNE 20047
00875 #define SYBECUFL 20048
00876 #define SYBECOFL 20049
00877 #define SYBECSYN 20050
00878 #define SYBECLPR 20051
00879 #define SYBECNOV 20052
00880 #define SYBERDCN 20053
00881 #define SYBESFOV 20054
00882 #define SYBEUNT 20055
00883 #define SYBECLOS 20056
00884 #define SYBEUAVE 20057
00885 #define SYBEUSCT 20058
00886 #define SYBEEQVA 20059
00887 #define SYBEUDTY 20060
00888 #define SYBETSIT 20061
00889 #define SYBEAUTN 20062
00890 #define SYBEBDIO 20063
00891 #define SYBEBCNT 20064
00892 #define SYBEIFNB 20065
00893 #define SYBETTS 20066
00894 #define SYBEKBCO 20067
00895 #define SYBEBBCI 20068
00896 #define SYBEKBCI 20069
00897 #define SYBEBCRE 20070
00898 #define SYBETPTN 20071
00899 #define SYBEBCWE 20072
00900 #define SYBEBCNN 20073
00901 #define SYBEBCOR 20074
00902 #define SYBEBCIS 20075
00903 #define SYBEBCPI 20076
00904 #define SYBEBCPN 20077
00905 #define SYBEBCPB 20078
00906 #define SYBEVDPT 20079
00907 #define SYBEBIVI 20080
00908 #define SYBEBCBC 20081
00909 #define SYBEBCFO 20082
00910 #define SYBEBCVH 20083
00911 #define SYBEBCUO 20084
00912 #define SYBEBCUC 20085
00913 #define SYBEBUOE 20086
00914 #define SYBEBUCE 20087
00915 #define SYBEBWEF 20088
00916 #define SYBEASTF 20089
00917 #define SYBEUACS 20090
00918 #define SYBEASEC 20091
00919 #define SYBETMTD 20092
00920 #define SYBENTTN 20093
00921 #define SYBEDNTI 20094
00922 #define SYBEBTMT 20095
00923 #define SYBEORPF 20096
00924 #define SYBEUVBF 20097
00925 #define SYBEBUOF 20098
00926 #define SYBEBUCF 20099
00927 #define SYBEBRFF 20100
00928 #define SYBEBWFF 20101
00929 #define SYBEBUDF 20102
00930 #define SYBEBIHC 20103
00931 #define SYBEBEOF 20104
00932 #define SYBEBCNL 20105
00933 #define SYBEBCSI 20106
00934 #define SYBEBCIT 20107
00935 #define SYBEBCSA 20108
00936 #define SYBENULL 20109
00937 #define SYBEUNAM 20110
00938 #define SYBEBCRO 20111
00939 #define SYBEMPLL 20112
00940 #define SYBERPIL 20113
00941 #define SYBERPUL 20114
00942 #define SYBEUNOP 20115
00943 #define SYBECRNC 20116
00944 #define SYBERTCC 20117
00945 #define SYBERTSC 20118
00946 #define SYBEUCRR 20119
00947 #define SYBERPNA 20120
00948 #define SYBEOPNA 20121
00949 #define SYBEFGTL 20122
00950 #define SYBECWLL 20123
00951 #define SYBEUFDS 20124
00952 #define SYBEUCPT 20125
00953 #define SYBETMCF 20126
00954 #define SYBEAICF 20127
00955 #define SYBEADST 20128
00956 #define SYBEALTT 20129
00957 #define SYBEAPCT 20130
00958 #define SYBEXOCI 20131
00959 #define SYBEFSHD 20132
00960 #define SYBEAOLF 20133
00961 #define SYBEARDI 20134
00962 #define SYBEURCI 20135
00963 #define SYBEARDL 20136
00964 #define SYBEURMI 20137
00965 #define SYBEUREM 20138
00966 #define SYBEURES 20139
00967 #define SYBEUREI 20140
00968 #define SYBEOREN 20141
00969 #define SYBEISOI 20142
00970 #define SYBEIDCL 20143
00971 #define SYBEIMCL 20144
00972 #define SYBEIFCL 20145
00973 #define SYBEUTDS 20146
00974 #define SYBEBUFF 20147
00975 #define SYBEACNV 20148
00976 #define SYBEDPOR 20149
00977 #define SYBENDC 20150
00978 #define SYBEMVOR 20151
00979 #define SYBEDVOR 20152
00980 #define SYBENBVP 20153
00981 #define SYBESPID 20154
00982 #define SYBENDTP 20155
00983 #define SYBEXTN 20156
00984 #define SYBEXTDN 20157
00985 #define SYBEXTSN 20158
00986 #define SYBENUM 20159
00987 #define SYBETYPE 20160
00988 #define SYBEGENOS 20161
00989 #define SYBEPAGE 20162
00990 #define SYBEOPTNO 20163
00991 #define SYBEETD 20164
00992 #define SYBERTYPE 20165
00993 #define SYBERFILE 20166
00994 #define SYBEFMODE 20167
00995 #define SYBESLCT 20168
00996 #define SYBEZTXT 20169
00997 #define SYBENTST 20170
00998 #define SYBEOSSL 20171
00999 #define SYBEESSL 20172
01000 #define SYBENLNL 20173
01001 #define SYBENHAN 20174
01002 #define SYBENBUF 20175
01003 #define SYBENULP 20176
01004 #define SYBENOTI 20177
01005 #define SYBEEVOP 20178
01006 #define SYBENEHA 20179
01007 #define SYBETRAN 20180
01008 #define SYBEEVST 20181
01009 #define SYBEEINI 20182
01010 #define SYBEECRT 20183
01011 #define SYBEECAN 20184
01012 #define SYBEEUNR 20185
01013 #define SYBERPCS 20186
01014 #define SYBETPAR 20187
01015 #define SYBETEXS 20188
01016 #define SYBETRAC 20189
01017 #define SYBETRAS 20190
01018 #define SYBEPRTF 20191
01019 #define SYBETRSN 20192
01020 #define SYBEBPKS 20193
01021 #define SYBEIPV 20194
01022 #define SYBEMOV 20195
01023 #define SYBEDIVZ 20196
01024 #define SYBEASTL 20197
01025 #define SYBESEFA 20198
01026 #define SYBEPOLL 20199
01027 #define SYBENOEV 20200
01028 #define SYBEBADPK 20201
01029 #define SYBESECURE 20202
01030 #define SYBECAP 20203
01031 #define SYBEFUNC 20204
01032 #define SYBERESP 20205
01033 #define SYBEIVERS 20206
01034 #define SYBEONCE 20207
01035 #define SYBERPNULL 20208
01036 #define SYBERPTXTIM 20209
01037 #define SYBENEG 20210
01038 #define SYBELBLEN 20211
01039 #define SYBEUMSG 20212
01040 #define SYBECAPTYP 20213
01041 #define SYBEBNUM 20214
01042 #define SYBEBBL 20215
01043 #define SYBEBPREC 20216
01044 #define SYBEBSCALE 20217
01045 #define SYBECDOMAIN 20218
01046 #define SYBECINTERNAL 20219
01047 #define SYBEBTYPSRV 20220
01048 #define SYBEBCSET 20221
01049 #define SYBEFENC 20222
01050 #define SYBEFRES 20223
01051 #define SYBEISRVPREC 20224
01052 #define SYBEISRVSCL 20225
01053 #define SYBEINUMCL 20226
01054 #define SYBEIDECCL 20227
01055 #define SYBEBCMTXT 20228
01056 #define SYBEBCPREC 20229
01057 #define SYBEBCBNPR 20230
01058 #define SYBEBCBNTYP 20231
01059 #define SYBEBCSNTYP 20232
01060 #define SYBEBCPCTYP 20233
01061 #define SYBEBCVLEN 20234
01062 #define SYBEBCHLEN 20235
01063 #define SYBEBCBPREF 20236
01064 #define SYBEBCPREF 20237
01065 #define SYBEBCITBNM 20238
01066 #define SYBEBCITBLEN 20239
01067 #define SYBEBCSNDROW 20240
01068 #define SYBEBPROCOL 20241
01069 #define SYBEBPRODEF 20242
01070 #define SYBEBPRONUMDEF 20243
01071 #define SYBEBPRODEFID 20244
01072 #define SYBEBPRONODEF 20245
01073 #define SYBEBPRODEFTYP 20246
01074 #define SYBEBPROEXTDEF 20247
01075 #define SYBEBPROEXTRES 20248
01076 #define SYBEBPROBADDEF 20249
01077 #define SYBEBPROBADTYP 20250
01078 #define SYBEBPROBADLEN 20251
01079 #define SYBEBPROBADPREC 20252
01080 #define SYBEBPROBADSCL 20253
01081 #define SYBEBADTYPE 20254
01082 #define SYBECRSNORES 20255
01083 #define SYBECRSNOIND 20256
01084 #define SYBECRSVIEW 20257
01085 #define SYBECRSVIIND 20258
01086 #define SYBECRSORD 20259
01087 #define SYBECRSBUFR 20260
01088 #define SYBECRSNOFREE 20261
01089 #define SYBECRSDIS 20262
01090 #define SYBECRSAGR 20263
01091 #define SYBECRSFRAND 20264
01092 #define SYBECRSFLAST 20265
01093 #define SYBECRSBROL 20266
01094 #define SYBECRSFROWN 20267
01095 #define SYBECRSBSKEY 20268
01096 #define SYBECRSRO 20269
01097 #define SYBECRSNOCOUNT 20270
01098 #define SYBECRSTAB 20271
01099 #define SYBECRSUPDNB 20272
01100 #define SYBECRSNOWHERE 20273
01101 #define SYBECRSSET 20274
01102 #define SYBECRSUPDTAB 20275
01103 #define SYBECRSNOUPD 20276
01104 #define SYBECRSINV 20277
01105 #define SYBECRSNOKEYS 20278
01106 #define SYBECRSNOBIND 20279
01107 #define SYBECRSFTYPE 20280
01108 #define SYBECRSINVALID 20281
01109 #define SYBECRSMROWS 20282
01110 #define SYBECRSNROWS 20283
01111 #define SYBECRSNOLEN 20284
01112 #define SYBECRSNOPTCC 20285
01113 #define SYBECRSNORDER 20286
01114 #define SYBECRSNOTABLE 20287
01115 #define SYBECRSNUNIQUE 20288
01116 #define SYBECRSVAR 20289
01117 #define SYBENOVALUE 20290
01118 #define SYBEVOIDRET 20291
01119 #define SYBECLOSEIN 20292
01120 #define SYBEBOOL 20293
01121 #define SYBEBCPOPT 20294
01122 #define SYBEERRLABEL 20295
01123 #define SYBEATTNACK 20296
01124 #define SYBEBBFL 20297
01125 #define SYBEDCL 20298
01126 #define SYBECS 20299
01127 #define SYBEBULKINSERT 20599
01128
01129 int dbtds(DBPROCESS * dbprocess);
01130
01131 #define DBTDS(a) dbtds(a)
01132 DBINT dbtextsize(DBPROCESS * dbprocess);
01133 DBBINARY *dbtxptr(DBPROCESS * dbproc, int column);
01134 DBBINARY *dbtxtimestamp(DBPROCESS * dbproc, int column);
01135 DBBINARY *dbtxtsnewval(DBPROCESS * dbprocess);
01136 RETCODE dbtxtsput(DBPROCESS * dbprocess, DBBINARY newtxts, int colnum);
01137 RETCODE dbuse(DBPROCESS * dbproc, const char *name);
01138 const char *dbversion(void);
01139 DBBOOL dbwillconvert(int srctype, int desttype);
01140 RETCODE dbwritetext(DBPROCESS * dbproc, char *objname, DBBINARY * textptr, DBTINYINT textptrlen, DBBINARY * timestamp,
01141 DBBOOL log, DBINT size, BYTE * text);
01142
01143
01144 RETCODE dbsetlname(LOGINREC * login, const char *value, int which);
01145 RETCODE dbsetlbool(LOGINREC * login, int value, int which);
01146 RETCODE dbsetllong(LOGINREC * login, long value, int which);
01147 RETCODE dbsetlversion (LOGINREC * login, BYTE version);
01148
01149 #define DBSETHOST 1
01150 #define DBSETLHOST(x,y) dbsetlname((x), (y), DBSETHOST)
01151 #define dbsetlhost(x,y) dbsetlname((x), (y), DBSETHOST)
01152 #define DBSETUSER 2
01153 #define DBSETLUSER(x,y) dbsetlname((x), (y), DBSETUSER)
01154 #define dbsetluser(x,y) dbsetlname((x), (y), DBSETUSER)
01155 #define DBSETPWD 3
01156 #define DBSETLPWD(x,y) dbsetlname((x), (y), DBSETPWD)
01157 #define dbsetlpwd(x,y) dbsetlname((x), (y), DBSETPWD)
01158 #if defined(DBLIB_UNIMPLEMENTED)
01159 # define DBSETHID 4
01160 # define DBSETLHID(x,y) dbsetlname((x), (y), DBSETHID)
01161 #endif
01162 #define DBSETAPP 5
01163 #define DBSETLAPP(x,y) dbsetlname((x), (y), DBSETAPP)
01164 #define dbsetlapp(x,y) dbsetlname((x), (y), DBSETAPP)
01165 #define DBSETBCP 6
01166 #define BCP_SETL(x,y) dbsetlbool((x), (y), DBSETBCP)
01167 #define DBSETLSECURE(x) dbsetlbool((x), (1), DBSETBCP)
01168 #define DBSETNATLANG 7
01169 #define DBSETLNATLANG(x,y) dbsetlname((x), (y), DBSETNATLANG)
01170 #define dbsetlnatlang(x,y) dbsetlname((x), (y), DBSETNATLANG)
01171 #if defined(DBLIB_UNIMPLEMENTED)
01172 # define DBSETNOSHORT 8
01173 # define DBSETLNOSHORT(x,y) dbsetlbool((x), (y), DBSETNOSHORT)
01174 # define DBSETHIER 9
01175 # define DBSETLHIER(x,y) dbsetlshort((x), (y), DBSETHIER)
01176 #endif
01177 #define DBSETCHARSET 10
01178 #define DBSETLCHARSET(x,y) dbsetlname((x), (y), DBSETCHARSET)
01179 #define DBSETPACKET 11
01180 #define DBSETLPACKET(x,y) dbsetllong((x), (y), DBSETPACKET)
01181 #define dbsetlpacket(x,y) dbsetllong((x), (y), DBSETPACKET)
01182 #define DBSETENCRYPT 12
01183 #define DBSETLENCRYPT(x,y) dbsetlbool((x), (y), DBSETENCRYPT)
01184 #define DBSETLABELED 13
01185 #define DBSETLLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
01186 #define BCP_SETLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
01187 #define DBSETDBNAME 14
01188 #define DBSETLDBNAME(x,y) dbsetlname((x), (y), DBSETDBNAME)
01189 #define DBSETLVERSION(login, version) dbsetlversion((login), (version))
01190
01191 RETCODE bcp_init(DBPROCESS * dbproc, const char *tblname, const char *hfile, const char *errfile, int direction);
01192 DBINT bcp_done(DBPROCESS * dbproc);
01193
01194 DBINT bcp_batch(DBPROCESS * dbproc);
01195 RETCODE bcp_bind(DBPROCESS * dbproc, BYTE * varaddr, int prefixlen, DBINT varlen, BYTE * terminator, int termlen, int type,
01196 int table_column);
01197 RETCODE bcp_collen(DBPROCESS * dbproc, DBINT varlen, int table_column);
01198 RETCODE bcp_columns(DBPROCESS * dbproc, int host_colcount);
01199 RETCODE bcp_colfmt(DBPROCESS * dbproc, int host_column, int host_type, int host_prefixlen, DBINT host_collen,
01200 const BYTE * host_term, int host_termlen, int colnum);
01201 RETCODE bcp_colfmt_ps(DBPROCESS * dbproc, int host_column, int host_type, int host_prefixlen, DBINT host_collen,
01202 BYTE * host_term, int host_termlen, int colnum, DBTYPEINFO * typeinfo);
01203 RETCODE bcp_colptr(DBPROCESS * dbproc, BYTE * colptr, int table_column);
01204 RETCODE bcp_control(DBPROCESS * dbproc, int field, DBINT value);
01205 int bcp_getbatchsize(DBPROCESS * dbproc);
01206 RETCODE bcp_exec(DBPROCESS * dbproc, DBINT * rows_copied);
01207 DBBOOL bcp_getl(LOGINREC * login);
01208 RETCODE bcp_options(DBPROCESS * dbproc, int option, BYTE * value, int valuelen);
01209 RETCODE bcp_readfmt(DBPROCESS * dbproc, const char filename[]);
01210 RETCODE bcp_sendrow(DBPROCESS * dbproc);
01211
01212 #ifdef __cplusplus
01213 #if 0
01214 {
01215 #endif
01216 }
01217 #endif
01218
01219 #endif