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