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