NCBI C++ ToolKit
sybdb.h
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* FreeTDS - Library of routines accessing Sybase and Microsoft databases
2  * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Brian Bruns
3  * Copyright (C) 2010, 2011 Frediano Ziglio
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20 
21 /** \file ../include/sybdb.h
22  * \brief Primary include file for db-lib applications.
23  *
24  * Declares macros, functions, enumerated types, and defined tokens
25  * used by the db-lib API.
26  */
27 
28 #ifndef _sybdb_h_
29 #define _sybdb_h_
30 
31 #include "../impl/rename_ftds_dblib.h"
32 
33 #include "tds_sysdep_public.h"
34 
35 #undef TDS_STATIC_CAST
36 #ifdef __cplusplus
37 #define TDS_STATIC_CAST(type, a) static_cast<type>(a)
38 extern "C"
39 {
40 #if 0
41 }
42 #endif
43 #else
44 #define TDS_STATIC_CAST(type, a) ((type)(a))
45 #endif
46 
47 #ifdef FALSE
48 #undef FALSE
49 #endif
50 #ifdef TRUE
51 #undef TRUE
52 #endif
53 #define FALSE 0
54 #define TRUE 1
55 
56 #define DBSAVE 1
57 #define DBNOSAVE 0
58 #define DBNOERR -1
59 
60 #define INT_EXIT 0
61 #define INT_CONTINUE 1
62 #define INT_CANCEL 2
63 #define INT_TIMEOUT 3
64 
65 #define DBMAXNUMLEN 33
66 /* https://msdn.microsoft.com/en-us/library/ms176061.aspx */
67 #define DBMAXNAME 128
68 
69 /**
70  * DBVERSION_xxx are used with dbsetversion()
71  */
72 #define DBVERSION_UNKNOWN 0
73 #define DBVERSION_46 1
74 #define DBVERSION_100 2
75 #define DBVERSION_42 3
76 #define DBVERSION_70 4
77 #define DBVERSION_71 5
78 #define DBVERSION_72 6
79 #define DBVERSION_73 7
80 #define DBVERSION_74 8
81 
82 /* these two are defined by Microsoft for dbsetlversion() */
83 #define DBVER42 DBVERSION_42
84 #define DBVER60 DBVERSION_70 /* our best approximation */
85 
86 /**
87  * DBTDS_xxx are returned by DBTDS()
88  * The integer values of the constants are poorly chosen.
89  */
90 #define DBTDS_UNKNOWN 0
91 #define DBTDS_2_0 1 /* pre 4.0 SQL Server */
92 #define DBTDS_3_4 2 /* Microsoft SQL Server (3.0) */
93 #define DBTDS_4_0 3 /* 4.0 SQL Server */
94 #define DBTDS_4_2 4 /* 4.2 SQL Server */
95 #define DBTDS_4_6 5 /* 2.0 OpenServer and 4.6 SQL Server. */
96 #define DBTDS_4_9_5 6 /* 4.9.5 (NCR) SQL Server */
97 #define DBTDS_5_0 7 /* 5.0 SQL Server */
98 #define DBTDS_7_0 8 /* Microsoft SQL Server 7.0 */
99 #define DBTDS_8_0 9 /* Microsoft SQL Server 2000 */
100 #define DBTDS_9_0 10 /* Microsoft SQL Server 2005 */
101 #define DBTDS_7_1 9 /* Microsoft SQL Server 2000 */
102 #define DBTDS_7_2 10 /* Microsoft SQL Server 2005 */
103 #define DBTDS_7_3 11 /* Microsoft SQL Server 2008 */
104 #define DBTDS_7_4 12 /* Microsoft SQL Server 2012/2014 */
105 
106 #define DBTXPLEN 16
107 
108 #define BCPMAXERRS 1
109 #define BCPFIRST 2
110 #define BCPLAST 3
111 #define BCPBATCH 4
112 #define BCPKEEPIDENTITY 8
113 
114 #define BCPLABELED 5
115 #define BCPHINTS 6
116 
117 #define DBCMDNONE 0
118 #define DBCMDPEND 1
119 #define DBCMDSENT 2
120 
121 typedef int RETCODE;
122 
123 typedef void DBCURSOR;
124 typedef void DBXLATE;
125 typedef void DBSORTORDER;
126 typedef void DBLOGINFO;
127 typedef void *DBVOIDPTR;
128 typedef short SHORT;
129 typedef unsigned short USHORT;
130 typedef int (*INTFUNCPTR) (void *, ...);
131 typedef int (*DBWAITFUNC) (void);
132 typedef DBWAITFUNC(*DB_DBBUSY_FUNC) (void *dbproc);
133 typedef void (*DB_DBIDLE_FUNC) (DBWAITFUNC dfunc, void *dbproc);
134 typedef int (*DB_DBCHKINTR_FUNC) (void *dbproc);
135 typedef int (*DB_DBHNDLINTR_FUNC) (void *dbproc);
136 
137 #ifndef __INCvxWorksh
138 /* VxWorks already defines STATUS and BOOL. Compiler gets mad if you
139 ** redefine them. */
140 /* __INCvxWorksh will get #defined by std. include files included from tds.h
141 */
142 #ifdef STATUS
143 /* On DU4.0d we get a conflicting STATUS definition from arpa/nameser.h
144  when _REENTRANT is defined.
145 */
146 #undef STATUS
147 #endif
148 typedef int STATUS;
149 #if !defined(_WINDEF_) && !defined(_WINDEF_H) && !defined(DOS32X)
150 typedef int BOOL;
151 #endif
152 #endif
153 
154 #ifndef _tds_h_
155 /* copied from tds.h */
156 /* TODO find a best way... */
157 enum
158 {
159  SYBCHAR = 47, /* 0x2F */
160 #define SYBCHAR SYBCHAR
161  SYBVARCHAR = 39, /* 0x27 */
162 #define SYBVARCHAR SYBVARCHAR
163  SYBINTN = 38, /* 0x26 */
164 #define SYBINTN SYBINTN
165  SYBINT1 = 48, /* 0x30 */
166 #define SYBINT1 SYBINT1
167  SYBINT2 = 52, /* 0x34 */
168 #define SYBINT2 SYBINT2
169  SYBINT4 = 56, /* 0x38 */
170 #define SYBINT4 SYBINT4
171  SYBINT8 = 127, /* 0x7F */
172 #define SYBINT8 SYBINT8
173  SYBFLT8 = 62, /* 0x3E */
174 #define SYBFLT8 SYBFLT8
175  SYBDATETIME = 61, /* 0x3D */
176 #define SYBDATETIME SYBDATETIME
177  SYBBIT = 50, /* 0x32 */
178 #define SYBBIT SYBBIT
179  SYBBITN = 104, /* 0x68 */
180 #define SYBBITN SYBBITN
181  SYBTEXT = 35, /* 0x23 */
182 #define SYBTEXT SYBTEXT
183  SYBNTEXT = 99, /* 0x63 */
184 #define SYBNTEXT SYBNTEXT
185  SYBIMAGE = 34, /* 0x22 */
186 #define SYBIMAGE SYBIMAGE
187  SYBMONEY4 = 122, /* 0x7A */
188 #define SYBMONEY4 SYBMONEY4
189  SYBMONEY = 60, /* 0x3C */
190 #define SYBMONEY SYBMONEY
191  SYBDATETIME4 = 58, /* 0x3A */
192 #define SYBDATETIME4 SYBDATETIME4
193  SYBREAL = 59, /* 0x3B */
194 #define SYBREAL SYBREAL
195  SYBBINARY = 45, /* 0x2D */
196 #define SYBBINARY SYBBINARY
197  SYBVOID = 31, /* 0x1F */
198 #define SYBVOID SYBVOID
199  SYBVARBINARY = 37, /* 0x25 */
200 #define SYBVARBINARY SYBVARBINARY
201  SYBNUMERIC = 108, /* 0x6C */
202 #define SYBNUMERIC SYBNUMERIC
203  SYBDECIMAL = 106, /* 0x6A */
204 #define SYBDECIMAL SYBDECIMAL
205  SYBFLTN = 109, /* 0x6D */
206 #define SYBFLTN SYBFLTN
207  SYBMONEYN = 110, /* 0x6E */
208 #define SYBMONEYN SYBMONEYN
209  SYBDATETIMN = 111, /* 0x6F */
210 #define SYBDATETIMN SYBDATETIMN
211  SYBNVARCHAR = 103, /* 0x67 */
212 #define SYBNVARCHAR SYBNVARCHAR
213  SYBDATE = 49, /* 0x31 */
214 #define SYBDATE SYBDATE
215  SYBTIME = 51, /* 0x33 */
216 #define SYBTIME SYBTIME
217  SYBBIGDATETIME = 187, /* 0xBB */
218 #define SYBBIGDATETIME SYBBIGDATETIME
219  SYBBIGTIME = 188, /* 0xBC */
220 #define SYBBIGTIME SYBBIGTIME
221  SYBMSDATE = 40, /* 0x28 */
222 #define SYBMSDATE SYBMSDATE
223  SYBMSTIME = 41, /* 0x29 */
224 #define SYBMSTIME SYBMSTIME
225  SYBMSDATETIME2 = 42, /* 0x2A */
226 #define SYBMSDATETIME2 SYBMSDATETIME2
227  SYBMSDATETIMEOFFSET = 43, /* 0x2B */
228 #define SYBMSDATETIMEOFFSET SYBMSDATETIMEOFFSET
229 };
230 
231 #define SYBAOPCNT 0x4b
232 #define SYBAOPCNTU 0x4c
233 #define SYBAOPSUM 0x4d
234 #define SYBAOPSUMU 0x4e
235 #define SYBAOPAVG 0x4f
236 #define SYBAOPAVGU 0x50
237 #define SYBAOPMIN 0x51
238 #define SYBAOPMAX 0x52
239 
240 /* mssql2k compute operator */
241 #define SYBAOPCNT_BIG 0x09
242 #define SYBAOPSTDEV 0x30
243 #define SYBAOPSTDEVP 0x31
244 #define SYBAOPVAR 0x32
245 #define SYBAOPVARP 0x33
246 #define SYBAOPCHECKSUM_AGG 0x72
247 
248 #endif
249 
250 typedef unsigned char DBBOOL;
251 typedef char DBCHAR;
252 typedef unsigned char DBBIT;
253 typedef unsigned char DBTINYINT;
257 typedef unsigned char DBBINARY;
263 
264 typedef struct
265 {
267  char str[256];
268 } DBVARYCHAR;
269 
270 typedef struct
271 {
273  unsigned char array[256];
274 } DBVARYBIN;
275 
276 typedef struct
277 {
278  unsigned char precision;
279  unsigned char scale;
280  unsigned char array[33];
281 } DBNUMERIC;
282 
284 
285 typedef struct
286 {
289 } DBMONEY;
290 
291 typedef struct
292 {
294 } DBMONEY4;
295 
296 typedef struct
297 {
300 } DBDATETIME;
301 
302 typedef struct
303 {
304  DBUSMALLINT days; /* days since Jan-1-1900 */
305  DBUSMALLINT minutes; /* minutes since midnight */
306 } DBDATETIME4;
307 
308 typedef struct
309 {
310  DBUBIGINT time; /**< time, 7 digit precision */
311  DBINT date; /**< date, 0 = 1900-01-01 */
312  DBSMALLINT offset; /**< time offset */
314 // fix a problem with some public headers defining _res
315 #undef _res
320 } DBDATETIMEALL;
321 
322 #ifdef MSDBLIB
323 # define SQLCHAR SYBCHAR
324  typedef struct
325  {
326  DBUSMALLINT numdays;
327  DBUSMALLINT nummins;
328  } DBDATETIM4;
329 #endif
330 
331 typedef struct tds_dblib_loginrec LOGINREC;
332 
333 #ifndef DOS32X
334 typedef unsigned char BYTE;
335 #endif
336 
337 typedef struct dbtypeinfo
338 {
342 
343 struct dbstring
344 {
347  struct dbstring *strnext;
348 };
349 typedef struct dbstring DBSTRING;
350 
351 /* Used by dbcolinfo */
352 enum
353 { MAXCOLNAMELEN = 512 }; /* duplicates TDS_SYSNAME_SIZE */
354 typedef enum { CI_REGULAR=1, CI_ALTERNATE=2, CI_CURSOR=3 } CI_TYPE;
355 
356 typedef struct
357 {
360  DBCHAR ActualName[MAXCOLNAMELEN+2];
361  DBCHAR TableName[MAXCOLNAMELEN+2];
372 
373 } DBCOL;
374 
375 typedef struct
376 {
379  DBCHAR ActualName[MAXCOLNAMELEN+2];
380  DBCHAR TableName[MAXCOLNAMELEN+2];
393  DBCHAR ServerTypeDeclaration[256];
394 } DBCOL2;
395 /* end dbcolinfo stuff */
396 
397 
398 
399 /* a large list of options, DBTEXTSIZE is needed by sybtcl */
400 #define DBPARSEONLY 0
401 #define DBESTIMATE 1
402 #define DBSHOWPLAN 2
403 #define DBNOEXEC 3
404 #define DBARITHIGNORE 4
405 #define DBNOCOUNT 5
406 #define DBARITHABORT 6
407 #define DBTEXTLIMIT 7
408 #define DBBROWSE 8
409 #define DBOFFSET 9
410 #define DBSTAT 10
411 #define DBERRLVL 11
412 #define DBCONFIRM 12
413 #define DBSTORPROCID 13
414 #define DBBUFFER 14
415 #define DBNOAUTOFREE 15
416 #define DBROWCOUNT 16
417 #define DBTEXTSIZE 17
418 #define DBNATLANG 18
419 #define DBDATEFORMAT 19
420 #define DBPRPAD 20
421 #define DBPRCOLSEP 21
422 #define DBPRLINELEN 22
423 #define DBPRLINESEP 23
424 #define DBLFCONVERT 24
425 #define DBDATEFIRST 25
426 #define DBCHAINXACTS 26
427 #define DBFIPSFLAG 27
428 #define DBISOLATION 28
429 #define DBAUTH 29
430 #define DBIDENTITY 30
431 #define DBNOIDCOL 31
432 #define DBDATESHORT 32
433 #define DBCLIENTCURSORS 33
434 #define DBSETTIME 34
435 #define DBQUOTEDIDENT 35
436 
437 #define DBNUMOPTIONS 36
438 
439 #define DBPADOFF 0
440 #define DBPADON 1
441 
442 #define OFF 0
443 #define ON 1
444 
445 #define NOSUCHOPTION 2
446 
447 #define MAXOPTTEXT 32
448 
449 typedef struct tds_dblib_dbprocess DBPROCESS;
450 
451 /*
452  * Sybase & Microsoft use different names for the dbdaterec members.
453  * Keep these two structures physically identical in memory.
454  * dbdatecrack() casts one to the other for ease of implementation.
455  *
456  * Giving credit where credit is due, we can acknowledge that
457  * Microsoft chose the better names here, hands down. ("datedmonth"?!)
458  */
460 {
461  DBINT year; /* 1753 - 9999 */
462  DBINT quarter; /* 1 - 4 */
463  DBINT month; /* 1 - 12 */
464  DBINT day; /* 1 - 31 */
465  DBINT dayofyear; /* 1 - 366 */
466  DBINT week; /* 1 - 54 (for leap years) */
467  DBINT weekday; /* 1 - 7 (Mon. - Sun.) */
468  DBINT hour; /* 0 - 23 */
469  DBINT minute; /* 0 - 59 */
470  DBINT second; /* 0 - 59 */
471  DBINT millisecond; /* 0 - 999 */
472  DBINT tzone; /* -840 - 840 */
473 };
474 
476 {
477  DBINT dateyear; /* 1900 and counting */
478  DBINT quarter; /* 0 - 3 (Microsoft only) */
479  DBINT datemonth; /* 0 - 11 */
480  DBINT datedmonth; /* 1 - 31 */
481  DBINT datedyear; /* 1 - 366 */
482  DBINT week; /* 1 - 54 (Microsoft only) */
483  DBINT datedweek; /* 0 - 6 */
484  DBINT datehour; /* 0 - 23 */
485  DBINT dateminute; /* 0 - 59 */
486  DBINT datesecond; /* 0 - 59 */
487  DBINT datemsecond; /* 0 - 999 */
488  DBINT datetzone; /* -840 - 840 */
489 };
490 
492 {
493  DBINT year; /* 1753 - 9999 */
494  DBINT quarter; /* 1 - 4 */
495  DBINT month; /* 1 - 12 */
496  DBINT day; /* 1 - 31 */
497  DBINT dayofyear; /* 1 - 366 */
498  DBINT week; /* 1 - 54 (for leap years) */
499  DBINT weekday; /* 1 - 7 (Mon. - Sun.) */
500  DBINT hour; /* 0 - 23 */
501  DBINT minute; /* 0 - 59 */
502  DBINT second; /* 0 - 59 */
503  DBINT nanosecond; /* 0 - 999999999 */
504  DBINT tzone; /* 0 - 127 (Sybase only) */
505 };
506 
508 {
509  DBINT dateyear; /* 1900 and counting */
510  DBINT quarter; /* 0 - 3 (Microsoft only) */
511  DBINT datemonth; /* 0 - 11 */
512  DBINT datedmonth; /* 1 - 31 */
513  DBINT datedyear; /* 1 - 366 */
514  DBINT week; /* 1 - 54 (Microsoft only) */
515  DBINT datedweek; /* 0 - 6 */
516  DBINT datehour; /* 0 - 23 */
517  DBINT dateminute; /* 0 - 59 */
518  DBINT datesecond; /* 0 - 59 */
519  DBINT datensecond; /* 0 - 999999999 */
520  DBINT datetzone; /* 0 - 127 */
521 };
522 
523 
524 #ifdef MSDBLIB
525 typedef struct tds_microsoft_dbdaterec DBDATEREC;
526 typedef struct tds_microsoft_dbdaterec2 DBDATEREC2;
527 #else
528 typedef struct tds_sybase_dbdaterec DBDATEREC;
529 typedef struct tds_sybase_dbdaterec2 DBDATEREC2;
530 #endif
531 
532 typedef int (*EHANDLEFUNC) (DBPROCESS * dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr);
533 
534 typedef int (*MHANDLEFUNC) (DBPROCESS * dbproc, DBINT msgno, int msgstate, int severity, char *msgtext, char *srvname,
535  char *proc, int line);
536 
537 /* dbpoll() result codes, sybtcl needs DBRESULT */
538 #define DBRESULT 1
539 #define DBNOTIFICATION 2
540 #define DBTIMEOUT 3
541 #define DBINTERRUPT 4
542 
543 /* more sybtcl needs: */
544 #define DBTXTSLEN 8
545 
546 /* bind types */
547 #define CHARBIND 0
548 #define STRINGBIND 1
549 #define NTBSTRINGBIND 2
550 #define VARYCHARBIND 3
551 #define VARYBINBIND 4
552 #define TINYBIND 6
553 #define SMALLBIND 7
554 #define INTBIND 8
555 #define FLT8BIND 9
556 #define REALBIND 10
557 #define DATETIMEBIND 11
558 #define SMALLDATETIMEBIND 12
559 #define MONEYBIND 13
560 #define SMALLMONEYBIND 14
561 #define BINARYBIND 15
562 #define BITBIND 16
563 #define NUMERICBIND 17
564 #define DECIMALBIND 18
565 #define SRCNUMERICBIND 19
566 #define SRCDECIMALBIND 20
567 #define DATEBIND 21
568 #define TIMEBIND 22
569 #define BIGDATETIMEBIND 23
570 #define BIGTIMEBIND 24
571 #define BIGINTBIND 30
572 #define DATETIME2BIND 31
573 #define MAXBINDTYPES 32 /* keep last */
574 
575 #define DBPRCOLSEP 21
576 #define DBPRLINELEN 22
577 #define DBRPCRETURN 1
578 #define DBRPCDEFAULT 2
579 
580 #define REG_ROW -1
581 #define MORE_ROWS -1
582 #define NO_MORE_ROWS -2
583 #define BUF_FULL -3
584 #define NO_MORE_RESULTS 2
585 #define SUCCEED 1
586 #define FAIL 0
587 
588 #define DB_IN 1
589 #define DB_OUT 2
590 #define DB_QUERYOUT 3
591 
592 #define DBSINGLE 0
593 #define DBDOUBLE 1
594 #define DBBOTH 2
595 
596 /* remote procedure call (rpc) options */
597 #define DBRPCRECOMPILE TDS_STATIC_CAST(DBSMALLINT, 0x0001)
598 #define DBRPCRESET TDS_STATIC_CAST(DBSMALLINT, 0x0002)
599 #define DBRPCCURSOR TDS_STATIC_CAST(DBSMALLINT, 0x0008)
600 
601 #if defined(DBLIB_UNIMPLEMENTED)
602 DBBOOL db12hour(DBPROCESS * dbprocess, const char language[]);
603 
604 DBBOOL dbcolbrowse(DBPROCESS * dbprocess, int colnum);
605 
606 RETCODE dbcursor(DBCURSOR * hc, DBINT optype, DBINT bufno, BYTE * table, BYTE * values);
607 RETCODE dbcursorbind(DBCURSOR * hc, int col, int vartype, DBINT varlen, DBINT * poutlen, BYTE * pvaraddr, DBTYPEINFO * typeinfo);
608 void dbcursorclose(DBCURSOR * hc);
609 RETCODE dbcursorcolinfo(DBCURSOR * hc, DBINT column, DBCHAR * colname, DBINT * coltype, DBINT * collen, DBINT * usertype);
610 RETCODE dbcursorfetch(DBCURSOR * hc, DBINT fetchtype, DBINT rownum);
611 RETCODE dbcursorinfo(DBCURSOR * hc, DBINT * ncols, DBINT * nrows);
612 DBCURSOR *dbcursoropen(DBPROCESS * dbprocess, BYTE * stmt, SHORT scollopt, SHORT concuropt, USHORT nrows, DBINT * pstatus);
613 
614 int dbdate4cmp(DBPROCESS * dbprocess, DBDATETIME4 * d1, DBDATETIME4 * d2);
615 RETCODE dbdate4zero(DBPROCESS * dbprocess, DBDATETIME4 * d1);
616 RETCODE dbdatechar(DBPROCESS * dbprocess, char *buf, int datepart, int value);
617 int dbdatename(DBPROCESS * dbprocess, char *buf, int date, DBDATETIME * datetime);
618 char *dateorder(DBPROCESS * dbprocess, char *language);
619 DBINT dbdatepart(DBPROCESS * dbprocess, int datepart, DBDATETIME * datetime);
620 RETCODE dbdatezero(DBPROCESS * dbprocess, DBDATETIME * d1);
621 char *dbdayname(DBPROCESS * dbprocess, char *language, int daynum);
622 
623 int dbgetoff(DBPROCESS * dbprocess, DBUSMALLINT offtype, int startfrom);
624 
625 char *dbqual(DBPROCESS * dbprocess, int tabnum, char *tabname);
626 void dbfreequal(char *qualptr);
627 
628 DBSORTORDER *dbloadsort(DBPROCESS * dbprocess);
629 RETCODE dbfreesort(DBPROCESS * dbprocess, DBSORTORDER * sortorder);
630 
631 RETCODE dbload_xlate(DBPROCESS * dbprocess, char *srv_charset, char *clt_name, DBXLATE ** xlt_tosrv, DBXLATE ** xlt_todisp);
632 
633 RETCODE dbmny4divide(DBPROCESS * dbproc, DBMONEY4 * m1, DBMONEY4 * m2, DBMONEY4 * quotient);
634 RETCODE dbmny4mul(DBPROCESS * dbproc, DBMONEY4 * m1, DBMONEY4 * m2, DBMONEY4 * prod);
635 RETCODE dbmnyadd(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2, DBMONEY * sum);
636 RETCODE dbmnydivide(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2, DBMONEY * quotient);
637 RETCODE dbmnydown(DBPROCESS * dbproc, DBMONEY * mnyptr, int divisor, int *remainder);
638 RETCODE dbmnyinit(DBPROCESS * dbproc, DBMONEY * mnyptr, int trim, DBBOOL * negative);
639 RETCODE dbmnyndigit(DBPROCESS * dbproc, DBMONEY * mnyptr, DBCHAR * value, DBBOOL * zero);
640 RETCODE dbmnymul(DBPROCESS * dbproc, DBMONEY * m1, DBMONEY * m2, DBMONEY * prod);
641 RETCODE dbmnydigit(DBPROCESS * dbprocess, DBMONEY * m1, DBCHAR * value, DBBOOL * zero);
642 RETCODE dbmnyscale(DBPROCESS * dbproc, DBMONEY * dest, int multiplier, int addend);
643 
644 
645 RETCODE dbnpcreate(DBPROCESS * dbprocess);
646 RETCODE dbnpdefine(DBPROCESS * dbprocess, DBCHAR * procedure_name, DBSMALLINT namelen);
647 
648 int DBNUMORDERS(DBPROCESS * dbprocess);
649 
650 RETCODE dbpoll(DBPROCESS * dbproc, long milliseconds, DBPROCESS ** ready_dbproc, int *return_reason);
651 int dbordercol(DBPROCESS * dbprocess, int order);
652 
653 RETCODE dbregdrop(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
654 RETCODE dbregexec(DBPROCESS * dbproc, DBUSMALLINT options);
655 RETCODE dbreghandle(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, INTFUNCPTR handler);
656 RETCODE dbreginit(DBPROCESS * dbproc, DBCHAR * procedure_name, DBSMALLINT namelen);
657 RETCODE dbreglist(DBPROCESS * dbproc);
658 RETCODE dbregnowatch(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
659 RETCODE dbregparam(DBPROCESS * dbproc, char *param_name, int type, DBINT datalen, BYTE * data);
660 RETCODE dbregwatch(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, DBUSMALLINT options);
661 RETCODE dbregwatchlist(DBPROCESS * dbprocess);
662 
663 void dbrpwclr(LOGINREC * login);
664 RETCODE dbrpwset(LOGINREC * login, char *srvname, char *password, int pwlen);
665 
666 DBINT dbreadpage(DBPROCESS * dbprocess, char *p_dbname, DBINT pageno, BYTE * buf);
667 RETCODE dbwritepage(DBPROCESS * dbprocess, char *p_dbname, DBINT pageno, DBINT size, BYTE * buf);
668 
669 RETCODE dbsetdeflang(char *language);
670 
671 int dbstrcmp(DBPROCESS * dbprocess, char *s1, int l1, char *s2, int l2, DBSORTORDER * sort);
672 int dbstrsort(DBPROCESS * dbprocess, char *s1, int l1, char *s2, int l2, DBSORTORDER * sort);
673 
674 DBBOOL dbtabbrowse(DBPROCESS * dbprocess, int tabnum);
675 int dbtabcount(DBPROCESS * dbprocess);
676 char *dbtabname(DBPROCESS * dbprocess, int tabnum);
677 char *dbtabsource(DBPROCESS * dbprocess, int colnum, int *tabnum);
678 
679 RETCODE dbsendpassthru(DBPROCESS * dbprocess, DBVOIDPTR bufp);
680 RETCODE dbrecvpassthru(DBPROCESS * dbprocess, DBVOIDPTR * bufp);
681 
682 RETCODE dbgetloginfo(DBPROCESS * dbprocess, DBLOGINFO ** loginfo);
683 RETCODE dbsetloginfo(LOGINREC * loginrec, DBLOGINFO * loginfo);
684 
685 int dbtsnewlen(DBPROCESS * dbprocess);
686 DBBINARY *dbtsnewval(DBPROCESS * dbprocess);
687 RETCODE dbtsput(DBPROCESS * dbprocess, DBBINARY * newts, int newtslen, int tabnum, char *tabname);
688 
689 RETCODE dbfree_xlate(DBPROCESS * dbprocess, DBXLATE * xlt_tosrv, DBXLATE * clt_todisp);
690 int dbxlate(DBPROCESS * dbprocess, char *src, int srclen, char *dest, int destlen, DBXLATE * xlt, int *srcbytes_used,
691  DBBOOL srcend, int status);
692 
693 RETCODE bcp_moretext(DBPROCESS * dbproc, DBINT size, BYTE * text);
694 RETCODE bcp_writefmt(DBPROCESS * dbproc, const char filename[]);
695 
696 void build_xact_string(char *xact_name, char *service_name, DBINT commid, char *result);
697 RETCODE remove_xact(DBPROCESS * connect, DBINT commid, int n);
698 RETCODE abort_xact(DBPROCESS * connect, DBINT commid);
699 void close_commit(DBPROCESS * connect);
700 RETCODE commit_xact(DBPROCESS * connect, DBINT commid);
701 DBPROCESS *open_commit(LOGINREC * login, char *servername);
702 RETCODE scan_xact(DBPROCESS * connect, DBINT commid);
703 DBINT start_xact(DBPROCESS * connect, char *application_name, char *xact_name, int site_count);
704 DBINT stat_xact(DBPROCESS * connect, DBINT commid);
705 
706 #endif /* define unimplemented */
707 
708 BYTE *dbadata(DBPROCESS * dbproc, int computeid, int column);
709 DBINT dbadlen(DBPROCESS * dbproc, int computeid, int column);
710 RETCODE dbaltbind(DBPROCESS * dbprocess, int computeid, int column, int vartype, DBINT varlen, BYTE * varaddr);
711 RETCODE dbaltbind_ps(DBPROCESS * dbprocess, int computeid, int column, int vartype, DBINT varlen, BYTE * varaddr,
712  DBTYPEINFO * typeinfo);
713 int dbaltcolid(DBPROCESS * dbproc, int computeid, int column);
714 DBINT dbaltlen(DBPROCESS * dbproc, int computeid, int column);
715 int dbaltop(DBPROCESS * dbproc, int computeid, int column);
716 int dbalttype(DBPROCESS * dbproc, int computeid, int column);
717 DBINT dbaltutype(DBPROCESS * dbproc, int computeid, int column);
718 RETCODE dbanullbind(DBPROCESS * dbprocess, int computeid, int column, DBINT * indicator);
719 RETCODE dbbind(DBPROCESS * dbproc, int column, int vartype, DBINT varlen, BYTE * varaddr);
720 RETCODE dbbind_ps(DBPROCESS * dbprocess, int column, int vartype, DBINT varlen, BYTE * varaddr, DBTYPEINFO * typeinfo);
721 int dbbufsize(DBPROCESS * dbprocess);
722 BYTE *dbbylist(DBPROCESS * dbproc, int computeid, int *size);
725 char *dbchange(DBPROCESS * dbprocess);
729 RETCODE dbclropt(DBPROCESS * dbproc, int option, const char param[]);
730 RETCODE dbcmd(DBPROCESS * dbproc, const char cmdstring[]);
732 
733 #define DBCMDROW(x) dbcmdrow((x))
738 char *dbcolsource(DBPROCESS * dbproc, int colnum);
741 DBINT dbcolutype(DBPROCESS * dbprocess, int column);
742 DBINT dbconvert(DBPROCESS * dbproc, int srctype, const BYTE * src, DBINT srclen, int desttype, BYTE * dest, DBINT destlen);
743 DBINT dbconvert_ps(DBPROCESS * dbprocess, int srctype, const BYTE * src, DBINT srclen, int desttype, BYTE * dest, DBINT destlen,
744  DBTYPEINFO * typeinfo);
747 
748 #define DBCOUNT(x) dbcount((x))
750 
751 #define DBCURCMD(x) dbcurcmd((x))
753 
754 #define DBCURROW(x) dbcurrow((x))
761 
762 #define DBDEAD(x) dbdead((x))
764 void dbexit(void);
765 RETCODE dbfcmd(DBPROCESS * dbproc, const char *fmt, ...);
767 
768 #define DBFIRSTROW(x) dbfirstrow((x))
770 char *dbgetchar(DBPROCESS * dbprocess, int n);
771 char *dbgetcharset(DBPROCESS * dbprocess);
772 int dbgetlusername(LOGINREC * login, BYTE * name_buffer, int buffer_len);
773 int dbgetmaxprocs(void);
774 char *dbgetnatlanf(DBPROCESS * dbprocess);
777 int dbgettime(void);
778 #define DBGETTIME dbgettime
783 
784 #define DBIORDESC(x) dbiordesc((x))
786 
787 #define DBIOWDESC(x) dbiowdesc((x))
789 
790 #define DBISAVAIL(x) dbisavail((x))
791 DBBOOL dbisopt(DBPROCESS * dbproc, int option, const char param[]);
793 
794 #define DBLASTROW(x) dblastrow((x))
797 
800 
810 
811 RETCODE dbmny4copy(DBPROCESS * dbprocess, DBMONEY4 * m1, DBMONEY4 * m2);
813 
816 
817 const char *dbmonthname(DBPROCESS * dbproc, char *language, int monthnum, DBBOOL shortform);
819 
820 #define DBMORECMDS(x) dbmorecmds((x))
826 int dbnumalts(DBPROCESS * dbproc, int computeid);
828 int dbnumcompute(DBPROCESS * dbprocess);
830 DBPROCESS *tdsdbopen(LOGINREC * login, const char *server, int msdblib);
831 DBPROCESS *dbopen(LOGINREC * login, const char *server);
832 
833 /* pivot functions */
834 struct col_t;
835 void dbpivot_count (struct col_t *output, const struct col_t *input);
836 void dbpivot_sum (struct col_t *output, const struct col_t *input);
837 void dbpivot_min (struct col_t *output, const struct col_t *input);
838 void dbpivot_max (struct col_t *output, const struct col_t *input);
839 
840 struct pivot_t;
841 typedef void (*DBPIVOT_FUNC)(struct col_t *output, const struct col_t *input);
844 RETCODE dbpivot(DBPROCESS *dbproc, int nkeys, int *keys, int ncols, int *cols, DBPIVOT_FUNC func, int val);
845 
846 DBPIVOT_FUNC dbpivot_lookup_name( const char name[] );
847 
848 #ifndef _FREETDS_LIBRARY_SOURCE
849 #ifdef dbopen
850 #undef dbopen
851 #endif
852 #ifdef MSDBLIB
853 #define dbopen(x,y) tdsdbopen((x),(y), 1)
854 #else
855 #define dbopen(x,y) tdsdbopen((x),(y), 0)
856 #endif
857 #endif
858 
859 /* fix PHP problem */
860 #ifdef PHP_SYBASE_DBOPEN
861 #undef PHP_SYBASE_DBOPEN
862 #define PHP_SYBASE_DBOPEN dbopen
863 #endif
864 
868 const char *dbprtype(int token);
869 DBBOOL DRBUF(DBPROCESS * dbprocess);
871 void dbrecftos(const char filename[]);
874 BYTE *dbretdata(DBPROCESS * dbproc, int retnum);
875 int dbretlen(DBPROCESS * dbproc, int retnum);
876 char *dbretname(DBPROCESS * dbproc, int retnum);
878 int dbrettype(DBPROCESS * dbproc, int retnum);
880 
881 #define DBROWS(x) dbrows((x))
883 
884 #define DBROWTYPE(x) dbrowtype((x))
885 RETCODE dbrpcinit(DBPROCESS * dbproc, const char rpcname[], DBSMALLINT options);
886 RETCODE dbrpcparam(DBPROCESS * dbproc, const char paramname[], BYTE status, int type, DBINT maxlen, DBINT datalen, BYTE * value);
888 RETCODE dbsafestr(DBPROCESS * dbproc, const char *src, DBINT srclen, char *dest, DBINT destlen, int quotetype);
890 char *dbservcharset(DBPROCESS * dbprocess);
891 void dbsetavail(DBPROCESS * dbprocess);
892 void dbsetbusy(DBPROCESS * dbprocess, DB_DBBUSY_FUNC busyfunc);
893 RETCODE dbsetdefcharset(char *charset);
894 void dbsetidle(DBPROCESS * dbprocess, DB_DBIDLE_FUNC idlefunc);
895 void dbsetifile(char *filename);
897 RETCODE dbsetlogintime(int seconds);
898 RETCODE dbsetmaxprocs(int maxprocs);
899 RETCODE dbsetnull(DBPROCESS * dbprocess, int bindtype, int bindlen, BYTE * bindval);
900 RETCODE dbsetopt(DBPROCESS * dbproc, int option, const char *char_param, int int_param);
902 RETCODE dbsettime(int seconds);
905 
910 RETCODE dbsprline(DBPROCESS * dbproc, char *buffer, DBINT buf_len, DBCHAR line_char);
914 int dbstrbuild(DBPROCESS * dbproc, char *charbuf, int bufsize, char *text, char *formats, ...);
915 RETCODE dbstrcpy(DBPROCESS * dbproc, int start, int numbytes, char *dest);
918 
919 #define SYBEVERDOWN 100 /* TDS version downgraded . */
920 #define SYBEICONVIU 2400 /* Some character(s) could not be converted into client's character set. */
921 #define SYBEICONVAVAIL 2401 /* Character set conversion is not available between client character set '%.*s' and server character set '%.*s'.*/
922 #define SYBEICONVO 2402 /* Error converting characters into server's character set. Some character(s) could not be converted.*/
923 #define SYBEICONVI 2403 /* Some character(s) could not be converted into client's character set. Unconverted bytes were changed to question marks ('?').*/
924 #define SYBEICONV2BIG 2404 /* Buffer overflow converting characters from client into server's character set.*/
925  /* cf. doc/dblib_errors.txt for more iconv error values. */
926  /* Reserve a few slots for other iconv-related issues. */
927 #define SYBETDSVER 2410 /* Cannot bcp with TDSVER < 5.0 */
928 #define SYBEPORT 2500 /* Both port and instance specified */
929 #define SYBESYNC 20001 /* Read attempted while out of synchronization with SQL Server. */
930 #define SYBEFCON 20002 /* SQL Server connection failed. */
931 #define SYBETIME 20003 /* SQL Server connection timed out. */
932 #define SYBEREAD 20004 /* Read from SQL Server failed. */
933 #define SYBEBUFL 20005 /* DB-LIBRARY internal error - send buffer length corrupted. */
934 #define SYBEWRIT 20006 /* Write to SQL Server failed. */
935 #define SYBEVMS 20007 /* Sendflush: VMS I/O error. */
936 #define SYBESOCK 20008 /* Unable to open socket */
937 #define SYBECONN 20009 /* Unable to connect socket -- SQL Server is unavailable or does not exist. */
938 #define SYBEMEM 20010 /* Unable to allocate sufficient memory */
939 #define SYBEDBPS 20011 /* Maximum number of DBPROCESSes already allocated. */
940 #define SYBEINTF 20012 /* Server name not found in interface file */
941 #define SYBEUHST 20013 /* Unknown host machine name */
942 #define SYBEPWD 20014 /* Incorrect password. */
943 #define SYBEOPIN 20015 /* Could not open interface file. */
944 #define SYBEINLN 20016 /* Interface file: unexpected end-of-line. */
945 #define SYBESEOF 20017 /* Unexpected EOF from SQL Server. */
946 #define SYBESMSG 20018 /* General SQL Server error: Check messages from the SQL Server. */
947 #define SYBERPND 20019 /* Attempt to initiate a new SQL Server operation with results pending. */
948 #define SYBEBTOK 20020 /* Bad token from SQL Server: Data-stream processing out of sync. */
949 #define SYBEITIM 20021 /* Illegal timeout value specified. */
950 #define SYBEOOB 20022 /* Error in sending out-of-band data to SQL Server. */
951 #define SYBEBTYP 20023 /* Unknown bind type passed to DB-LIBRARY function. */
952 #define SYBEBNCR 20024 /* Attempt to bind user variable to a non-existent compute row. */
953 #define SYBEIICL 20025 /* Illegal integer column length returned by SQL Server. Legal integer lengths are 1, 2, and 4 bytes. */
954 #define SYBECNOR 20026 /* Column number out of range. */
955 #define SYBENPRM 20027 /* NULL parameter not allowed for this dboption. */
956 #define SYBEUVDT 20028 /* Unknown variable-length datatype encountered. */
957 #define SYBEUFDT 20029 /* Unknown fixed-length datatype encountered. */
958 #define SYBEWAID 20030 /* DB-LIBRARY internal error: ALTFMT following ALTNAME has wrong id. */
959 #define SYBECDNS 20031 /* Datastream indicates that a compute column is derived from a non-existent select-list member. */
960 #define SYBEABNC 20032 /* Attempt to bind to a non-existent column. */
961 #define SYBEABMT 20033 /* User attempted a dbbind() with mismatched column and variable types. */
962 #define SYBEABNP 20034 /* Attempt to bind using NULL pointers. */
963 #define SYBEAAMT 20035 /* User attempted a dbaltbind() with mismatched column and variable types. */
964 #define SYBENXID 20036 /* The Server did not grant us a distributed-transaction ID. */
965 #define SYBERXID 20037 /* The Server did not recognize our distributed-transaction ID. */
966 #define SYBEICN 20038 /* Invalid computeid or compute column number. */
967 #define SYBENMOB 20039 /* No such member of 'order by' clause. */
968 #define SYBEAPUT 20040 /* Attempt to print unknown token. */
969 #define SYBEASNL 20041 /* Attempt to set fields in a null loginrec. */
970 #define SYBENTLL 20042 /* Name too long for loginrec field. */
971 #define SYBEASUL 20043 /* Attempt to set unknown loginrec field. */
972 #define SYBERDNR 20044 /* Attempt to retrieve data from a non-existent row. */
973 #define SYBENSIP 20045 /* Negative starting index passed to dbstrcpy(). */
974 #define SYBEABNV 20046 /* Attempt to bind to a NULL program variable. */
975 #define SYBEDDNE 20047 /* DBPROCESS is dead or not enabled. */
976 #define SYBECUFL 20048 /* Data-conversion resulted in underflow. */
977 #define SYBECOFL 20049 /* Data-conversion resulted in overflow. */
978 #define SYBECSYN 20050 /* Attempt to convert data stopped by syntax error in source field. */
979 #define SYBECLPR 20051 /* Data-conversion resulted in loss of precision. */
980 #define SYBECNOV 20052 /* Attempt to set variable to NULL resulted in overflow. */
981 #define SYBERDCN 20053 /* Requested data-conversion does not exist. */
982 #define SYBESFOV 20054 /* dbsafestr() overflowed its destination buffer. */
983 #define SYBEUNT 20055 /* Unknown network type found in interface file. */
984 #define SYBECLOS 20056 /* Error in closing network connection. */
985 #define SYBEUAVE 20057 /* Unable to allocate VMS event flag. */
986 #define SYBEUSCT 20058 /* Unable to set communications timer. */
987 #define SYBEEQVA 20059 /* Error in queueing VMS AST routine. */
988 #define SYBEUDTY 20060 /* Unknown datatype encountered. */
989 #define SYBETSIT 20061 /* Attempt to call dbtsput() with an invalid timestamp. */
990 #define SYBEAUTN 20062 /* Attempt to update the timestamp of a table which has no timestamp column. */
991 #define SYBEBDIO 20063 /* Bad bulk-copy direction. Must be either IN or OUT. */
992 #define SYBEBCNT 20064 /* Attempt to use Bulk Copy with a non-existent Server table. */
993 #define SYBEIFNB 20065 /* Illegal field number passed to bcp_control(). */
994 #define SYBETTS 20066 /* The table which bulk-copy is attempting to copy to a host-file is shorter than the number of rows which bulk-copy was instructed to skip. */
995 #define SYBEKBCO 20067 /* 1000 rows successfully bulk-copied to host-file. */
996 #define SYBEBBCI 20068 /* Batch successfully bulk-copied to SQL Server. */
997 #define SYBEKBCI 20069 /* Bcp: 1000 rows sent to SQL Server. */
998 #define SYBEBCRE 20070 /* I/O error while reading bcp data-file. */
999 #define SYBETPTN 20071 /* Syntax error: only two periods are permitted in table names. */
1000 #define SYBEBCWE 20072 /* I/O error while writing bcp data-file. */
1001 #define SYBEBCNN 20073 /* Attempt to bulk-copy a NULL value into Server column %d, which does not accept NULL values. */
1002 #define SYBEBCOR 20074 /* Attempt to bulk-copy an oversized row to the SQL Server. */
1003 #define SYBEBCIS 20075 /* Attempt to bulk-copy an illegally-sized column value to the SQL Server. */
1004 #define SYBEBCPI 20076 /* bcp_init() must be called before any other bcp routines. */
1005 #define SYBEBCPN 20077 /* bcp_bind(), bcp_collen(), bcp_colptr(), bcp_moretext() and bcp_sendrow() may be used only after bcp_init() has been called with the copy direction set to DB_IN. */
1006 #define SYBEBCPB 20078 /* bcp_bind(), bcp_moretext() and bcp_sendrow() may NOT be used after bcp_init() has been passed a non-NULL input file name. */
1007 #define SYBEVDPT 20079 /* For bulk copy, all variable-length data must have either a length-prefix or a terminator specified. */
1008 #define SYBEBIVI 20080 /* bcp_columns(), bcp_colfmt() and bcp_colfmt_ps() may be used only after bcp_init() has been passed a valid input file. */
1009 #define SYBEBCBC 20081 /* bcp_columns() must be called before bcp_colfmt() and bcp_colfmt_ps(). */
1010 #define SYBEBCFO 20082 /* Bcp host-files must contain at least one column. */
1011 #define SYBEBCVH 20083 /* bcp_exec() may be called only after bcp_init() has been passed a valid host file. */
1012 #define SYBEBCUO 20084 /* Bcp: Unable to open host data-file. */
1013 #define SYBEBCUC 20085 /* Bcp: Unable to close host data-file. */
1014 #define SYBEBUOE 20086 /* Bcp: Unable to open error-file. */
1015 #define SYBEBUCE 20087 /* Bcp: Unable to close error-file. */
1016 #define SYBEBWEF 20088 /* I/O error while writing bcp error-file. */
1017 #define SYBEASTF 20089 /* VMS: Unable to setmode for control_c ast. */
1018 #define SYBEUACS 20090 /* VMS: Unable to assign channel to sys$command. */
1019 #define SYBEASEC 20091 /* Attempt to send an empty command buffer to the SQL Server. */
1020 #define SYBETMTD 20092 /* Attempt to send too much TEXT data via the dbmoretext() call. */
1021 #define SYBENTTN 20093 /* Attempt to use dbtxtsput() to put a new text-timestamp into a non-existent data row. */
1022 #define SYBEDNTI 20094 /* Attempt to use dbtxtsput() to put a new text-timestamp into a column whose datatype is neither SYBTEXT nor SYBIMAGE. */
1023 #define SYBEBTMT 20095 /* Attempt to send too much TEXT data via the bcp_moretext() call. */
1024 #define SYBEORPF 20096 /* Attempt to set remote password would overflow the login-record's remote-password field. */
1025 #define SYBEUVBF 20097 /* Attempt to read an unknown version of BCP format-file. */
1026 #define SYBEBUOF 20098 /* Bcp: Unable to open format-file. */
1027 #define SYBEBUCF 20099 /* Bcp: Unable to close format-file. */
1028 #define SYBEBRFF 20100 /* I/O error while reading bcp format-file. */
1029 #define SYBEBWFF 20101 /* I/O error while writing bcp format-file. */
1030 #define SYBEBUDF 20102 /* Bcp: Unrecognized datatype found in format-file. */
1031 #define SYBEBIHC 20103 /* Incorrect host-column number found in bcp format-file. */
1032 #define SYBEBEOF 20104 /* Unexpected EOF encountered in BCP data-file. */
1033 #define SYBEBCNL 20105 /* Negative length-prefix found in BCP data-file. */
1034 #define SYBEBCSI 20106 /* Host-file columns may be skipped only when copying INto the Server. */
1035 #define SYBEBCIT 20107 /* It's illegal to use BCP terminators with program variables other than SYBCHAR, SYBBINARY, SYBTEXT, or SYBIMAGE. */
1036 #define SYBEBCSA 20108 /* The BCP hostfile '%s' contains only %ld rows. Skipping all of these rows is not allowed. */
1037 #define SYBENULL 20109 /* NULL DBPROCESS pointer passed to DB-Library. */
1038 #define SYBEUNAM 20110 /* Unable to get current username from operating system. */
1039 #define SYBEBCRO 20111 /* The BCP hostfile '%s' contains only %ld rows. It was impossible to read the requested %ld rows. */
1040 #define SYBEMPLL 20112 /* Attempt to set maximum number of DBPROCESSes lower than 1. */
1041 #define SYBERPIL 20113 /* It is illegal to pass -1 to dbrpcparam() for the datalen of parameters which are of type SYBCHAR, SYBVARCHAR, SYBBINARY, or SYBVARBINARY. */
1042 #define SYBERPUL 20114 /* When passing a SYBINTN, SYBDATETIMN, SYBMONEYN, or SYBFLTN parameter via dbrpcparam(), it's necessary to specify the parameter's maximum or actual length, so that DB-Library can recognize it as a SYBINT1, SYBINT2, SYBINT4, SYBMONEY, or SYBMONEY4, etc. */
1043 #define SYBEUNOP 20115 /* Unknown option passed to dbsetopt(). */
1044 #define SYBECRNC 20116 /* The current row is not a result of compute clause %d, so it is illegal to attempt to extract that data from this row. */
1045 #define SYBERTCC 20117 /* dbreadtext() may not be used to receive the results of a query which contains a COMPUTE clause. */
1046 #define SYBERTSC 20118 /* dbreadtext() may only be used to receive the results of a query which contains a single result column. */
1047 #define SYBEUCRR 20119 /* Internal software error: Unknown connection result reported by * dbpasswd(). */
1048 #define SYBERPNA 20120 /* The RPC facility is available only when using a SQL Server whose version number is 4.0 or greater. */
1049 #define SYBEOPNA 20121 /* The text/image facility is available only when using a SQL Server whose version number is 4.0 or greater. */
1050 #define SYBEFGTL 20122 /* Bcp: Row number of the first row to be copied cannot be greater than the row number for the last row to be copied. */
1051 #define SYBECWLL 20123 /* Attempt to set column width less than 1. */
1052 #define SYBEUFDS 20124 /* Unrecognized format encountered in dbstrbuild(). */
1053 #define SYBEUCPT 20125 /* Unrecognized custom-format parameter-type encountered in dbstrbuild(). */
1054 #define SYBETMCF 20126 /* Attempt to install too many custom formats via dbfmtinstall(). */
1055 #define SYBEAICF 20127 /* Error in attempting to install custom format. */
1056 #define SYBEADST 20128 /* Error in attempting to determine the size of a pair of translation tables. */
1057 #define SYBEALTT 20129 /* Error in attempting to load a pair of translation tables. */
1058 #define SYBEAPCT 20130 /* Error in attempting to perform a character-set translation. */
1059 #define SYBEXOCI 20131 /* A character-set translation overflowed its destination buffer while using bcp to copy data from a host-file to the SQL Server. */
1060 #define SYBEFSHD 20132 /* Error in attempting to find the Sybase home directory. */
1061 #define SYBEAOLF 20133 /* Error in attempting to open a localization file. */
1062 #define SYBEARDI 20134 /* Error in attempting to read datetime information from a localization file. */
1063 #define SYBEURCI 20135 /* Unable to read copyright information from the dblib localization file. */
1064 #define SYBEARDL 20136 /* Error in attempting to read the dblib.loc localization file. */
1065 #define SYBEURMI 20137 /* Unable to read money-format information from the dblib localization file. */
1066 #define SYBEUREM 20138 /* Unable to read error mnemonic from the dblib localization file. */
1067 #define SYBEURES 20139 /* Unable to read error string from the dblib localization file. */
1068 #define SYBEUREI 20140 /* Unable to read error information from the dblib localization file. */
1069 #define SYBEOREN 20141 /* Warning: an out-of-range error-number was encountered in dblib.loc. The maximum permissible error-number is defined as DBERRCOUNT in sybdb.h. */
1070 #define SYBEISOI 20142 /* Invalid sort-order information found. */
1071 #define SYBEIDCL 20143 /* Illegal datetime column length returned by DataServer. Legal datetime lengths are 4 and 8 bytes. */
1072 #define SYBEIMCL 20144 /* Illegal money column length returned by DataServer. Legal money lengths are 4 and 8 bytes. */
1073 #define SYBEIFCL 20145 /* Illegal floating-point column length returned by DataServer. Legal floating-point lengths are 4 and 8 bytes. */
1074 #define SYBEUTDS 20146 /* Unrecognized TDS version received from SQL Server. */
1075 #define SYBEBUFF 20147 /* Bcp: Unable to create format-file. */
1076 #define SYBEACNV 20148 /* Attemp to do conversion with NULL destination variable. */
1077 #define SYBEDPOR 20149 /* Out-of-range datepart constant. */
1078 #define SYBENDC 20150 /* Cannot have negative component in date in numeric form. */
1079 #define SYBEMVOR 20151 /* Month values must be between 1 and 12. */
1080 #define SYBEDVOR 20152 /* Day values must be between 1 and 7. */
1081 #define SYBENBVP 20153 /* Cannot pass dbsetnull() a NULL bindval pointer. */
1082 #define SYBESPID 20154 /* Called dbspid() with a NULL dbproc. */
1083 #define SYBENDTP 20155 /* Called dbdatecrack() with a NULL datetime parameter. */
1084 #define SYBEXTN 20156 /* The xlt_todisp and xlt_tosrv parameters to dbfree_xlate() were NULL. */
1085 #define SYBEXTDN 20157 /* Warning: the xlt_todisp parameter to dbfree_xlate() was NULL. The space associated with the xlt_tosrv parameter has been freed. */
1086 #define SYBEXTSN 20158 /* Warning: the xlt_tosrv parameter to dbfree_xlate() was NULL. The space associated with the xlt_todisp parameter has been freed. */
1087 #define SYBENUM 20159 /* Incorrect number of arguments given to DB-Library. */
1088 #define SYBETYPE 20160 /* Invalid argument type given to DB-Library. */
1089 #define SYBEGENOS 20161 /* General Operating System Error. */
1090 #define SYBEPAGE 20162 /* wrong resource type or length given for dbpage() operation. */
1091 #define SYBEOPTNO 20163 /* Option is not allowed or is unreconized */
1092 #define SYBEETD 20164 /* Failure to send the expected amount of TEXT or IMAGE data via dbmoretext(). */
1093 #define SYBERTYPE 20165 /* Invalid resource type given to DB-Library. */
1094 #define SYBERFILE 20166 /* "Can not open resource file." */
1095 #define SYBEFMODE 20167 /* Read/Write/Append mode denied on file. */
1096 #define SYBESLCT 20168 /* Could not select or copy field specified */
1097 #define SYBEZTXT 20169 /* Attempt to send zero length TEXT or IMAGE to dataserver via dbwritetext(). */
1098 #define SYBENTST 20170 /* The file being opened must be a stream_lf. */
1099 #define SYBEOSSL 20171 /* Operating system login level not in range of Secure SQL Server */
1100 #define SYBEESSL 20172 /* Login security level entered does not agree with operating system level */
1101 #define SYBENLNL 20173 /* Program not linked with specified network library. */
1102 #define SYBENHAN 20174 /* called dbrecvpassthru() with a NULL handler parameter. */
1103 #define SYBENBUF 20175 /* called dbsendpassthru() with a NULL buf pointer. */
1104 #define SYBENULP 20176 /* Called %s with a NULL %s parameter. */
1105 #define SYBENOTI 20177 /* No event handler installed. */
1106 #define SYBEEVOP 20178 /* Called dbregwatch() with a bad options parameter. */
1107 #define SYBENEHA 20179 /* Called dbreghandle() with a NULL handler parameter. */
1108 #define SYBETRAN 20180 /* DBPROCESS is being used for another transaction. */
1109 #define SYBEEVST 20181 /* Must initiate a transaction before calling dbregparam(). */
1110 #define SYBEEINI 20182 /* Must call dbreginit() before dbregraise(). */
1111 #define SYBEECRT 20183 /* Must call dbregdefine() before dbregcreate(). */
1112 #define SYBEECAN 20184 /* Attempted to cancel unrequested event notification. */
1113 #define SYBEEUNR 20185 /* Unsolicited event notification received. */
1114 #define SYBERPCS 20186 /* Must call dbrpcinit() before dbrpcparam(). */
1115 #define SYBETPAR 20187 /* No SYBTEXT or SYBIMAGE parameters were defined. */
1116 #define SYBETEXS 20188 /* Called dbmoretext() with a bad size parameter. */
1117 #define SYBETRAC 20189 /* Attempted to turn off a trace flag that was not on. */
1118 #define SYBETRAS 20190 /* DB-Library internal error - trace structure not found. */
1119 #define SYBEPRTF 20191 /* dbtracestring() may only be called from a printfunc(). */
1120 #define SYBETRSN 20192 /* Bad numbytes parameter passed to dbtracestring(). */
1121 #define SYBEBPKS 20193 /* In DBSETLPACKET(), the packet size parameter must be between 0 and 999999. */
1122 #define SYBEIPV 20194 /* %1! is an illegal value for the %2! parameter of %3!. */
1123 #define SYBEMOV 20195 /* Money arithmetic resulted in overflow in function %1!. */
1124 #define SYBEDIVZ 20196 /* Attempt to divide by $0.00 in function %1!. */
1125 #define SYBEASTL 20197 /* Synchronous I/O attempted at AST level. */
1126 #define SYBESEFA 20198 /* DBSETNOTIFS cannot be called if connections are present. */
1127 #define SYBEPOLL 20199 /* Only one dbpoll() can be active at a time. */
1128 #define SYBENOEV 20200 /* dbpoll() cannot be called if registered procedure notifications have been disabled. */
1129 #define SYBEBADPK 20201 /* Packet size of %1! not supported. -- size of %2! used instead. */
1130 #define SYBESECURE 20202 /* Secure Server function not supported in this version. */
1131 #define SYBECAP 20203 /* DB-Library capabilities not accepted by the Server. */
1132 #define SYBEFUNC 20204 /* Functionality not supported at the specified version level. */
1133 #define SYBERESP 20205 /* Response function address passed to dbresponse() must be non-NULL. */
1134 #define SYBEIVERS 20206 /* Illegal version level specified. */
1135 #define SYBEONCE 20207 /* Function can be called only once. */
1136 #define SYBERPNULL 20208 /* value parameter for dbprcparam() can be NULL, only if the datalen parameter is 0 */
1137 #define SYBERPTXTIM 20209 /* RPC parameters cannot be of type Text/Image. */
1138 #define SYBENEG 20210 /* Negotiated login attempt failed. */
1139 #define SYBELBLEN 20211 /* Security labels should be less than 256 characters long. */
1140 #define SYBEUMSG 20212 /* Unknown message-id in MSG datastream. */
1141 #define SYBECAPTYP 20213 /* Unexpected capability type in CAPABILITY datastream. */
1142 #define SYBEBNUM 20214 /* Bad numbytes parameter passed to dbstrcpy() */
1143 #define SYBEBBL 20215 /* Bad bindlen parameter passed to dbsetnull() */
1144 #define SYBEBPREC 20216 /* Illegal precision specified */
1145 #define SYBEBSCALE 20217 /* Illegal scale specified */
1146 #define SYBECDOMAIN 20218 /* Source field value is not within the domain of legal values. */
1147 #define SYBECINTERNAL 20219 /* Internal Conversion error. */
1148 #define SYBEBTYPSRV 20220 /* Datatype is not supported by the server. */
1149 #define SYBEBCSET 20221 /* Unknown character-set encountered." */
1150 #define SYBEFENC 20222 /* Password Encryption failed." */
1151 #define SYBEFRES 20223 /* Challenge-Response function failed.", */
1152 #define SYBEISRVPREC 20224 /* Illegal precision value returned by the server. */
1153 #define SYBEISRVSCL 20225 /* Illegal scale value returned by the server. */
1154 #define SYBEINUMCL 20226 /* Invalid numeric column length returned by the server. */
1155 #define SYBEIDECCL 20227 /* Invalid decimal column length returned by the server. */
1156 #define SYBEBCMTXT 20228 /* bcp_moretext() may be used only when there is at least one text or image column in the server table. */
1157 #define SYBEBCPREC 20229 /* Column %1!: Illegal precision value encountered. */
1158 #define SYBEBCBNPR 20230 /* bcp_bind(): if varaddr is NULL, prefixlen must be 0 and no terminator should be specified. */
1159 #define SYBEBCBNTYP 20231 /* bcp_bind(): if varaddr is NULL and varlen greater than 0, the table column type must be SYBTEXT or SYBIMAGE and the program variable type must be SYBTEXT, SYBCHAR, SYBIMAGE or SYBBINARY. */
1160 #define SYBEBCSNTYP 20232 /* column number %1!: if varaddr is NULL and varlen greater than 0, the table column type must be SYBTEXT or SYBIMAGE and the program variable type must be SYBTEXT, SYBCHAR, SYBIMAGE or SYBBINARY. */
1161 #define SYBEBCPCTYP 20233 /* bcp_colfmt(): If table_colnum is 0, host_type cannot be 0. */
1162 #define SYBEBCVLEN 20234 /* varlen should be greater than or equal to -1. */
1163 #define SYBEBCHLEN 20235 /* host_collen should be greater than or equal to -1. */
1164 #define SYBEBCBPREF 20236 /* Illegal prefix length. Legal values are 0, 1, 2 or 4. */
1165 #define SYBEBCPREF 20237 /* Illegal prefix length. Legal values are -1, 0, 1, 2 or 4. */
1166 #define SYBEBCITBNM 20238 /* bcp_init(): tblname parameter cannot be NULL. */
1167 #define SYBEBCITBLEN 20239 /* bcp_init(): tblname parameter is too long. */
1168 #define SYBEBCSNDROW 20240 /* bcp_sendrow() may NOT be called unless all text data for the previous row has been sent using bcp_moretext(). */
1169 #define SYBEBPROCOL 20241 /* bcp protocol error: returned column count differs from the actual number of columns received. */
1170 #define SYBEBPRODEF 20242 /* bcp protocol error: expected default information and got none. */
1171 #define SYBEBPRONUMDEF 20243 /* bcp protocol error: expected number of defaults differs from the actual number of defaults received. */
1172 #define SYBEBPRODEFID 20244 /* bcp protocol error: default column id and actual column id are not same */
1173 #define SYBEBPRONODEF 20245 /* bcp protocol error: default value received for column that does not have default. */
1174 #define SYBEBPRODEFTYP 20246 /* bcp protocol error: default value datatype differs from column datatype. */
1175 #define SYBEBPROEXTDEF 20247 /* bcp protocol error: more than one row of default information received. */
1176 #define SYBEBPROEXTRES 20248 /* bcp protocol error: unexpected set of results received. */
1177 #define SYBEBPROBADDEF 20249 /* bcp protocol error: illegal default column id received. */
1178 #define SYBEBPROBADTYP 20250 /* bcp protocol error: unknown column datatype. */
1179 #define SYBEBPROBADLEN 20251 /* bcp protocol error: illegal datatype length received. */
1180 #define SYBEBPROBADPREC 20252 /* bcp protocol error: illegal precision value received. */
1181 #define SYBEBPROBADSCL 20253 /* bcp protocol error: illegal scale value received. */
1182 #define SYBEBADTYPE 20254 /* Illegal value for type parameter given to %1!. */
1183 #define SYBECRSNORES 20255 /* Cursor statement generated no results. */
1184 #define SYBECRSNOIND 20256 /* One of the tables involved in the cursor statement does not have a unique index. */
1185 #define SYBECRSVIEW 20257 /* A view cannot be joined with another table or a view in a cursor statement. */
1186 #define SYBECRSVIIND 20258 /* The view used in the cursor statement does not include all the unique index columns of the underlying tables. */
1187 #define SYBECRSORD 20259 /* Only fully keyset driven cursors can have 'order by', ' group by', or 'having' phrases. */
1188 #define SYBECRSBUFR 20260 /* Row buffering should not be turned on when using cursor APIs. */
1189 #define SYBECRSNOFREE 20261 /* The DBNOAUTOFREE option should not be turned on when using cursor APIs. */
1190 #define SYBECRSDIS 20262 /* Cursor statement contains one of the disallowed phrases 'compute', 'union', 'for browse', or 'select into'. */
1191 #define SYBECRSAGR 20263 /* Aggregate functions are not allowed in a cursor statement. */
1192 #define SYBECRSFRAND 20264 /* Fetch types RANDOM and RELATIVE can only be used within the keyset of keyset driven cursors. */
1193 #define SYBECRSFLAST 20265 /* Fetch type LAST requires fully keyset driven cursors. */
1194 #define SYBECRSBROL 20266 /* Backward scrolling cannot be used in a forward scrolling cursor. */
1195 #define SYBECRSFROWN 20267 /* Row number to be fetched is outside valid range. */
1196 #define SYBECRSBSKEY 20268 /* Keyset cannot be scrolled backward in mixed cursors with a previous fetch type. */
1197 #define SYBECRSRO 20269 /* Data locking or modifications cannot be made in a READONLY cursor. */
1198 #define SYBECRSNOCOUNT 20270 /* The DBNOCOUNT option should not be turned on when doing updates or deletes with dbcursor(). */
1199 #define SYBECRSTAB 20271 /* Table name must be determined in operations involving data locking or modifications. */
1200 #define SYBECRSUPDNB 20272 /* Update or insert operations cannot use bind variables when binding type is NOBIND. */
1201 #define SYBECRSNOWHERE 20273 /* A WHERE clause is not allowed in a cursor update or insert. */
1202 #define SYBECRSSET 20274 /* A SET clause is required for a cursor update or insert. */
1203 #define SYBECRSUPDTAB 20275 /* Update or insert operations using bind variables require single table cursors. */
1204 #define SYBECRSNOUPD 20276 /* Update or delete operation did not affect any rows. */
1205 #define SYBECRSINV 20277 /* Invalid cursor statement. */
1206 #define SYBECRSNOKEYS 20278 /* The entire keyset must be defined for KEYSET cursors. */
1207 #define SYBECRSNOBIND 20279 /* Cursor bind must be called prior to updating cursor */
1208 #define SYBECRSFTYPE 20280 /* Unknown fetch type. */
1209 #define SYBECRSINVALID 20281 /* The cursor handle is invalid. */
1210 #define SYBECRSMROWS 20282 /* Multiple rows are returned, only one is expected. */
1211 #define SYBECRSNROWS 20283 /* No rows returned, at least one is expected. */
1212 #define SYBECRSNOLEN 20284 /* No unique index found. */
1213 #define SYBECRSNOPTCC 20285 /* No OPTCC was found. */
1214 #define SYBECRSNORDER 20286 /* The order of clauses must be from, where, and order by. */
1215 #define SYBECRSNOTABLE 20287 /* Table name is NULL. */
1216 #define SYBECRSNUNIQUE 20288 /* No unique keys associated with this view. */
1217 #define SYBECRSVAR 20289 /* There is no valid address associated with this bind. */
1218 #define SYBENOVALUE 20290 /* Security labels require both a name and a value */
1219 #define SYBEVOIDRET 20291 /* Parameter of type SYBVOID cannot be a return parameter. */
1220 #define SYBECLOSEIN 20292 /* Unable to close interface file. */
1221 #define SYBEBOOL 20293 /* Boolean parameters must be TRUE or FALSE. */
1222 #define SYBEBCPOPT 20294 /* The option cannot be called while a bulk copy operation is progress. */
1223 #define SYBEERRLABEL 20295 /* An illegal value was returned from the security label handler. */
1224 #define SYBEATTNACK 20296 /* Timed out waiting for server to acknowledge attention." */
1225 #define SYBEBBFL 20297 /* -001- Batch failed in bulk-copy to SQL Server */
1226 #define SYBEDCL 20298 /* -004- DCL Error */
1227 #define SYBECS 20299 /* -004- cs context Error */
1228 #define SYBEBULKINSERT 20599 /* cannot build bulk insert statement */
1229 #define SYBECOLSIZE 22000 /* Invalid column information structure size */
1230 
1231 int dbtds(DBPROCESS * dbprocess);
1232 
1233 #define DBTDS(a) dbtds(a)
1238 RETCODE dbtxtsput(DBPROCESS * dbprocess, DBBINARY newtxts, int colnum);
1239 RETCODE dbuse(DBPROCESS * dbproc, const char *name);
1240 const char *dbversion(void);
1241 DBBOOL dbwillconvert(int srctype, int desttype);
1242 RETCODE dbwritetext(DBPROCESS * dbproc, char *objname, DBBINARY * textptr, DBTINYINT textptrlen, DBBINARY * timestamp,
1243  DBBOOL log, DBINT size, BYTE * text);
1244 
1245 /* LOGINREC manipulation */
1246 RETCODE dbsetlname(LOGINREC * login, const char *value, int which);
1249 RETCODE dbsetllong(LOGINREC * login, long value, int which);
1251 
1252 #define DBSETHOST 1
1253 #define DBSETLHOST(x,y) dbsetlname((x), (y), DBSETHOST)
1254 #define dbsetlhost(x,y) dbsetlname((x), (y), DBSETHOST)
1255 #define DBSETUSER 2
1256 #define DBSETLUSER(x,y) dbsetlname((x), (y), DBSETUSER)
1257 #define dbsetluser(x,y) dbsetlname((x), (y), DBSETUSER)
1258 #define DBSETPWD 3
1259 #define DBSETLPWD(x,y) dbsetlname((x), (y), DBSETPWD)
1260 #define dbsetlpwd(x,y) dbsetlname((x), (y), DBSETPWD)
1261 #if defined(DBLIB_UNIMPLEMENTED)
1262 # define DBSETHID 4 /* not implemented */
1263 # define DBSETLHID(x,y) dbsetlname((x), (y), DBSETHID)
1264 #endif
1265 #define DBSETAPP 5
1266 #define DBSETLAPP(x,y) dbsetlname((x), (y), DBSETAPP)
1267 #define dbsetlapp(x,y) dbsetlname((x), (y), DBSETAPP)
1268 #define DBSETBCP 6
1269 #define BCP_SETL(x,y) dbsetlbool((x), (y), DBSETBCP)
1270 #define DBSETLSECURE(x) dbsetlbool((x), (1), DBSETBCP)
1271 #define DBSETNATLANG 7
1272 #define DBSETLNATLANG(x,y) dbsetlname((x), (y), DBSETNATLANG)
1273 #define dbsetlnatlang(x,y) dbsetlname((x), (y), DBSETNATLANG)
1274 #if defined(DBLIB_UNIMPLEMENTED)
1275 # define DBSETNOSHORT 8 /* not implemented */
1276 # define DBSETLNOSHORT(x,y) dbsetlbool((x), (y), DBSETNOSHORT)
1277 # define DBSETHIER 9 /* not implemented */
1278 # define DBSETLHIER(x,y) dbsetlshort((x), (y), DBSETHIER)
1279 #endif
1280 #define DBSETCHARSET 10
1281 #define DBSETLCHARSET(x,y) dbsetlname((x), (y), DBSETCHARSET)
1282 #define DBSETPACKET 11
1283 #define DBSETLPACKET(x,y) dbsetllong((x), (y), DBSETPACKET)
1284 #define dbsetlpacket(x,y) dbsetllong((x), (y), DBSETPACKET)
1285 #define DBSETENCRYPT 12
1286 #define DBSETLENCRYPT(x,y) dbsetlbool((x), (y), DBSETENCRYPT)
1287 #define DBSETLABELED 13
1288 #define DBSETLLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1289 #define BCP_SETLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1290 #define DBSETDBNAME 14
1291 #define DBSETLDBNAME(x,y) dbsetlname((x), (y), DBSETDBNAME)
1292 #define DBSETLVERSION(login, version) dbsetlversion((login), (version))
1293 /* settings from here are purely FreeTDS extensions */
1294 #define DBSETUTF16 1001
1295 #define DBSETLUTF16(x,y) dbsetlbool((x), (y), DBSETUTF16)
1296 #define DBSETNTLMV2 1002
1297 #define DBSETLNTLMV2(x,y) dbsetlbool((x), (y), DBSETNTLMV2)
1298 #define DBSETREADONLY 1003
1299 #define DBSETLREADONLY(x,y) dbsetlbool((x), (y), DBSETREADONLY)
1300 
1301 RETCODE bcp_init(DBPROCESS * dbproc, const char *tblname, const char *hfile, const char *errfile, int direction);
1303 
1305 RETCODE bcp_bind(DBPROCESS * dbproc, BYTE * varaddr, int prefixlen, DBINT varlen, BYTE * terminator, int termlen, int type,
1306  int table_column);
1307 RETCODE bcp_collen(DBPROCESS * dbproc, DBINT varlen, int table_column);
1308 RETCODE bcp_columns(DBPROCESS * dbproc, int host_colcount);
1309 RETCODE bcp_colfmt(DBPROCESS * dbproc, int host_column, int host_type, int host_prefixlen, DBINT host_collen,
1310  const BYTE * host_term, int host_termlen, int colnum);
1311 RETCODE bcp_colfmt_ps(DBPROCESS * dbproc, int host_column, int host_type, int host_prefixlen, DBINT host_collen,
1312  BYTE * host_term, int host_termlen, int colnum, DBTYPEINFO * typeinfo);
1313 RETCODE bcp_colptr(DBPROCESS * dbproc, BYTE * colptr, int table_column);
1315 int bcp_getbatchsize(DBPROCESS * dbproc); /* FreeTDS only */
1319 RETCODE bcp_readfmt(DBPROCESS * dbproc, const char filename[]);
1321 
1322 #ifdef __cplusplus
1323 #if 0
1324 {
1325 #endif
1326 }
1327 #endif
1328 
1329 #endif
void(*)(CSeq_entry_Handle seh, IWorkbench *wb, const CSerialObject &obj) handler
static DBPROCESS * dbproc
Definition: done_handling.c:29
static int msdblib
Definition: numeric.c:38
static int hndlintr(DBPROCESS *dbproc)
Definition: timeout.c:86
static int chkintr(DBPROCESS *dbproc)
Definition: timeout.c:79
static SQLCHAR output[256]
Definition: print.c:5
static HSTMT stmt
Definition: rebindpar.c:12
static const char * str(char *buf, int n)
Definition: stats.c:84
static const char * proc
Definition: stats.c:21
static const char * column
Definition: stats.c:23
int dbbufsize(DBPROCESS *dbprocess)
unsigned char DBBOOL
Definition: sybdb.h:250
int BOOL
Definition: sybdb.h:150
#define SYBMSDATE
Definition: sybdb.h:222
unsigned char DBBIT
Definition: sybdb.h:252
#define SYBBIGTIME
Definition: sybdb.h:220
#define dbopen(x, y)
Definition: sybdb.h:855
int STATUS
Definition: sybdb.h:148
#define SYBVOID
Definition: sybdb.h:198
#define SYBINT4
Definition: sybdb.h:170
void DBCURSOR
Definition: sybdb.h:123
Uint2 DBUSMALLINT
Definition: sybdb.h:260
struct dbtypeinfo DBTYPEINFO
void DBXLATE
Definition: sybdb.h:124
void DBLOGINFO
Definition: sybdb.h:126
Uint4 DBUINT
Definition: sybdb.h:261
RETCODE dbsetlshort(LOGINREC *login, int value, int which)
DBBINARY * dbtxtsnewval(DBPROCESS *dbprocess)
DBBOOL dbcharsetconv(DBPROCESS *dbprocess)
#define SYBNUMERIC
Definition: sybdb.h:202
RETCODE dbaltbind_ps(DBPROCESS *dbprocess, int computeid, int column, int vartype, DBINT varlen, BYTE *varaddr, DBTYPEINFO *typeinfo)
DBWAITFUNC(* DB_DBBUSY_FUNC)(void *dbproc)
Definition: sybdb.h:132
#define SYBVARCHAR
Definition: sybdb.h:162
#define SYBBIGDATETIME
Definition: sybdb.h:218
int RETCODE
Definition: sybdb.h:121
void dbsetidle(DBPROCESS *dbprocess, DB_DBIDLE_FUNC idlefunc)
void(* DB_DBIDLE_FUNC)(DBWAITFUNC dfunc, void *dbproc)
Definition: sybdb.h:133
#define SYBTEXT
Definition: sybdb.h:182
#define SYBNVARCHAR
Definition: sybdb.h:212
#define SYBDATE
Definition: sybdb.h:214
unsigned char BYTE
Definition: sybdb.h:334
int(* DBWAITFUNC)(void)
Definition: sybdb.h:131
#define SYBINT8
Definition: sybdb.h:172
#define SYBMONEYN
Definition: sybdb.h:208
RETCODE dbbind_ps(DBPROCESS *dbprocess, int column, int vartype, DBINT varlen, BYTE *varaddr, DBTYPEINFO *typeinfo)
int(* DB_DBCHKINTR_FUNC)(void *dbproc)
Definition: sybdb.h:134
unsigned short USHORT
Definition: sybdb.h:129
#define SYBMSDATETIME2
Definition: sybdb.h:226
double DBFLT8
Definition: sybdb.h:259
#define SYBNTEXT
Definition: sybdb.h:184
#define SYBIMAGE
Definition: sybdb.h:186
#define SYBINTN
Definition: sybdb.h:164
Int2 DBSMALLINT
Definition: sybdb.h:254
char * dbgetcharset(DBPROCESS *dbprocess)
#define SYBMSDATETIMEOFFSET
Definition: sybdb.h:228
RETCODE dbtxtsput(DBPROCESS *dbprocess, DBBINARY newtxts, int colnum)
#define SYBINT1
Definition: sybdb.h:166
#define SYBDATETIME4
Definition: sybdb.h:192
#define SYBDECIMAL
Definition: sybdb.h:204
char * dbgetnatlanf(DBPROCESS *dbprocess)
char DBCHAR
Definition: sybdb.h:251
#define SYBCHAR
Definition: sybdb.h:160
DBINT dbtextsize(DBPROCESS *dbprocess)
RETCODE dbmnysub(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2, DBMONEY *diff)
#define SYBREAL
Definition: sybdb.h:194
Uint8 DBUBIGINT
Definition: sybdb.h:262
#define SYBDATETIMN
Definition: sybdb.h:210
CI_TYPE
Definition: sybdb.h:354
@ CI_REGULAR
Definition: sybdb.h:354
@ CI_CURSOR
Definition: sybdb.h:354
@ CI_ALTERNATE
Definition: sybdb.h:354
short SHORT
Definition: sybdb.h:128
#define SYBBITN
Definition: sybdb.h:180
unsigned char DBBINARY
Definition: sybdb.h:257
void(* DBPIVOT_FUNC)(struct col_t *output, const struct col_t *input)
Definition: sybdb.h:841
#define SYBBINARY
Definition: sybdb.h:196
int(* EHANDLEFUNC)(DBPROCESS *dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr)
Definition: sybdb.h:532
DBBOOL DRBUF(DBPROCESS *dbprocess)
Int8 DBBIGINT
Definition: sybdb.h:256
#define SYBTIME
Definition: sybdb.h:216
unsigned char DBTINYINT
Definition: sybdb.h:253
void DBSORTORDER
Definition: sybdb.h:125
float DBREAL
Definition: sybdb.h:258
#define SYBMSTIME
Definition: sybdb.h:224
#define SYBDATETIME
Definition: sybdb.h:176
#define SYBVARBINARY
Definition: sybdb.h:200
RETCODE dbresults_r(DBPROCESS *dbproc, int recursive)
#define SYBMONEY
Definition: sybdb.h:190
#define SYBMONEY4
Definition: sybdb.h:188
int(* INTFUNCPTR)(void *,...)
Definition: sybdb.h:130
int(* DB_DBHNDLINTR_FUNC)(void *dbproc)
Definition: sybdb.h:135
int(* MHANDLEFUNC)(DBPROCESS *dbproc, DBINT msgno, int msgstate, int severity, char *msgtext, char *srvname, char *proc, int line)
Definition: sybdb.h:534
#define SYBFLT8
Definition: sybdb.h:174
RETCODE * dbsechandle(DBINT type, INTFUNCPTR handler)
void * DBVOIDPTR
Definition: sybdb.h:127
int dbgetlusername(LOGINREC *login, BYTE *name_buffer, int buffer_len)
#define SYBFLTN
Definition: sybdb.h:206
Int4 DBINT
Definition: sybdb.h:255
DBNUMERIC DBDECIMAL
Definition: sybdb.h:283
RETCODE dbsetdefcharset(char *charset)
@ MAXCOLNAMELEN
Definition: sybdb.h:353
#define SYBINT2
Definition: sybdb.h:168
void dbsetbusy(DBPROCESS *dbprocess, DB_DBBUSY_FUNC busyfunc)
#define SYBBIT
Definition: sybdb.h:178
#define option
static TDSLOGIN * login
Definition: dataread.c:31
#define tds_sysdep_real32_type
#define tds_sysdep_int16_type
#define tds_sysdep_uint16_type
#define tds_sysdep_int64_type
#define tds_sysdep_uint32_type
#define tds_sysdep_int32_type
#define tds_sysdep_uint64_type
#define tds_sysdep_real64_type
#define dbrows
#define dbsetlname
#define dbpivot_min
#define dbiowdesc
#define dbdead
#define dbpivot_lookup_name
#define bcp_getbatchsize
#define dbiordesc
#define dbisavail
#define dbcurrow
#define dbsetllong
#define dbpivot
#define dbrowtype
#define dbpivot_max
#define dbsetinterrupt
#define dbrows_pivoted
#define dbpivot_count
#define dbpivot_sum
#define dbcolinfo
#define dbtds
#define tdsdbopen
#define dblastrow
#define dbsetavail
#define dbcurcmd
#define dbsetlbool
#define dbnextrow
#define dbcmdrow
#define dbnextrow_pivoted
char data[12]
Definition: iconv.c:80
RETCODE bcp_colfmt(DBPROCESS *dbproc, int host_colnum, int host_type, int host_prefixlen, DBINT host_collen, const BYTE *host_term, int host_termlen, int table_colnum)
Specify the format of a datafile prior to writing to a table.
Definition: bcp.c:372
DBBOOL bcp_getl(LOGINREC *login)
See if BCP_SETL() was used to set the LOGINREC for BCP work.
Definition: bcp.c:697
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition: bcp.c:539
RETCODE bcp_columns(DBPROCESS *dbproc, int host_colcount)
Indicate how many columns are to be found in the datafile.
Definition: bcp.c:296
RETCODE bcp_colptr(DBPROCESS *dbproc, BYTE *colptr, int table_column)
Override bcp_bind() by pointing to a different host variable.
Definition: bcp.c:661
RETCODE bcp_bind(DBPROCESS *dbproc, BYTE *varaddr, int prefixlen, DBINT varlen, BYTE *terminator, int termlen, int db_vartype, int table_column)
Bind a program host variable to a database column.
Definition: bcp.c:2032
RETCODE bcp_exec(DBPROCESS *dbproc, DBINT *rows_copied)
Write a datafile to a table.
Definition: bcp.c:1570
DBINT bcp_done(DBPROCESS *dbproc)
Conclude the transfer of data from program variables.
Definition: bcp.c:1990
RETCODE bcp_readfmt(DBPROCESS *dbproc, const char filename[])
Read a format definition file.
Definition: bcp.c:1631
DBINT bcp_batch(DBPROCESS *dbproc)
Commit a set of rows to the table.
Definition: bcp.c:1963
RETCODE bcp_init(DBPROCESS *dbproc, const char *tblname, const char *hfile, const char *errfile, int direction)
Prepare for bulk copy operation on a table.
Definition: bcp.c:164
RETCODE bcp_collen(DBPROCESS *dbproc, DBINT varlen, int table_column)
Set the length of a host variable to be written to a table.
Definition: bcp.c:261
RETCODE bcp_sendrow(DBPROCESS *dbproc)
Write data in host variables to the table.
Definition: bcp.c:1339
RETCODE bcp_colfmt_ps(DBPROCESS *dbproc, int host_colnum, int host_type, int host_prefixlen, DBINT host_collen, BYTE *host_term, int host_termlen, int table_colnum, DBTYPEINFO *typeinfo)
Specify the format of a host file for bulk copy purposes, with precision and scale support for numeri...
Definition: bcp.c:504
RETCODE bcp_options(DBPROCESS *dbproc, int option, BYTE *value, int valuelen)
Set "hints" for uploading a file.
Definition: bcp.c:613
void dbclrbuf(DBPROCESS *dbproc, DBINT n)
Clear n rows from the row buffer.
Definition: dblib.c:2855
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition: dblib.c:719
DBTYPEINFO * dbcoltypeinfo(DBPROCESS *dbproc, int column)
Get precision and scale information for a regular result column.
Definition: dblib.c:2956
void dbfreebuf(DBPROCESS *dbproc)
Erase the command buffer, in case DBNOAUTOFREE was set with dbsetopt().
Definition: dblib.c:5973
BYTE * dbdata(DBPROCESS *dbproc, int column)
Get address of data in a regular result column.
Definition: dblib.c:3237
int dbstrlen(DBPROCESS *dbproc)
Get size of the command buffer, in bytes.
Definition: dblib.c:6206
BYTE * dbadata(DBPROCESS *dbproc, int computeid, int column)
Get address of compute column data.
Definition: dblib.c:4325
int dbspid(DBPROCESS *dbproc)
Get server process ID for a DBPROCESS.
Definition: dblib.c:5829
DBBINARY * dbtxtimestamp(DBPROCESS *dbproc, int column)
Get text timestamp for a column in the current row.
Definition: dblib.c:6442
BYTE * dbbylist(DBPROCESS *dbproc, int computeid, int *size)
Get bylist for a compute row.
Definition: dblib.c:4908
char * dbservcharset(DBPROCESS *dbproc)
Get syscharset name of the server character set.
Definition: dblib.c:6945
DBINT dbspr1rowlen(DBPROCESS *dbproc)
Determine size buffer required to hold the results returned by dbsprhead(), dbsprline(),...
Definition: dblib.c:3304
DBINT dbconvert(DBPROCESS *dbproc, int srctype, const BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen)
cf.
Definition: dblib.c:2604
DBINT dbadlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in a compute column.
Definition: dblib.c:4209
RETCODE dbsetnull(DBPROCESS *dbproc, int bindtype, int bindlen, BYTE *bindval)
Define substitution values to be used when binding null values.
Definition: dblib.c:1964
char * dbcolname(DBPROCESS *dbproc, int column)
Return name of a regular result column.
Definition: dblib.c:1884
RETCODE dbfcmd(DBPROCESS *dbproc, const char *fmt,...)
printf-like way to form SQL to send to the server.
Definition: dblib.c:1338
RETCODE dbdatecrack(DBPROCESS *dbproc, DBDATEREC *di, DBDATETIME *datetime)
Break a DBDATETIME value into useful pieces.
Definition: dblib.c:5756
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition: dblib.c:1706
RETCODE dbwritetext(DBPROCESS *dbproc, char *objname, DBBINARY *textptr, DBTINYINT textptrlen, DBBINARY *timestamp, DBBOOL log, DBINT size, BYTE *text)
Send text or image data to the server.
Definition: dblib.c:6509
RETCODE dbcanquery(DBPROCESS *dbproc)
Cancel the query currently being retrieved, discarding all pending rows.
Definition: dblib.c:5941
RETCODE dbinit(void)
Initialize db-lib.
Definition: dblib.c:674
DBINT dbvarylen(DBPROCESS *dbproc, int column)
Determine whether a column can vary in size.
Definition: dblib.c:3158
RETCODE dbcancel(DBPROCESS *dbproc)
Cancel the current command batch.
Definition: dblib.c:3279
RETCODE dbsetlogintime(int seconds)
Set maximum seconds db-lib waits for a server response to a login attempt.
Definition: dblib.c:4137
RETCODE dbgetrow(DBPROCESS *dbproc, DBINT row)
Read a row from the row buffer.
Definition: dblib.c:1932
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition: dblib.c:2902
void dbsetifile(char *filename)
set name and location of the interfaces file FreeTDS should use to look up a servername.
Definition: dblib.c:2722
const char * dbversion()
See which version of db-lib is in use.
Definition: dblib.c:6762
RETCODE dbuse(DBPROCESS *dbproc, const char *name)
Change current database.
Definition: dblib.c:1449
int dbnumalts(DBPROCESS *dbproc, int computeid)
Get count of columns in a compute row.
Definition: dblib.c:4849
BOOL dbiscount(DBPROCESS *dbproc)
Indicates whether or not the count returned by dbcount is real (Microsoft-compatibility feature).
Definition: dblib.c:2815
int dbgettime(void)
Get maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4121
RETCODE dbmoretext(DBPROCESS *dbproc, DBINT size, const BYTE text[])
Send chunk of a text/image value to the server.
Definition: dblib.c:6654
const char * dbprtype(int token)
Print a token value's name to a buffer.
Definition: dblib.c:6363
char * dbcolsource(DBPROCESS *dbproc, int column)
Get base database column name for a result set column.
Definition: dblib.c:3084
char * dbchange(DBPROCESS *dbproc)
See if a command caused the current database to change.
Definition: dblib.c:6909
RETCODE dbnullbind(DBPROCESS *dbproc, int column, DBINT *indicator)
Tie a null-indicator to a regular result column.
Definition: dblib.c:2751
RETCODE dbbind(DBPROCESS *dbproc, int column, int vartype, DBINT varlen, BYTE *varaddr)
Tie a host variable to a resultset column.
Definition: dblib.c:2645
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
Definition: dblib.c:1377
DBINT dbcollen(DBPROCESS *dbproc, int column)
Get size of a regular result column.
Definition: dblib.c:3109
DBINT dbconvert_ps(DBPROCESS *dbproc, int db_srctype, const BYTE *src, DBINT srclen, int db_desttype, BYTE *dest, DBINT destlen, DBTYPEINFO *typeinfo)
Convert one datatype to another.
Definition: dblib.c:2303
char * dbgetchar(DBPROCESS *dbproc, int pos)
Get address of a position in the command buffer.
Definition: dblib.c:6225
RETCODE dbanullbind(DBPROCESS *dbproc, int computeid, int column, DBINT *indicator)
Tie a null-indicator to a compute result column.
Definition: dblib.c:2787
RETCODE dbclropt(DBPROCESS *dbproc, int option, const char param[])
Reset an option.
Definition: dblib.c:6008
DBINT dbcount(DBPROCESS *dbproc)
Get count of rows processed.
Definition: dblib.c:2835
int dbaltop(DBPROCESS *dbproc, int computeid, int column)
Get aggregation operator for a compute column.
Definition: dblib.c:4355
RETCODE dbtablecolinfo(DBPROCESS *dbproc, DBINT column, DBCOL *pdbcol)
describe table column attributes with a single call (Freetds-only API function modelled on dbcolinfo)
Definition: dblib.c:6380
DBINT dbaltlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in compute column.
Definition: dblib.c:7060
RETCODE dbsetopt(DBPROCESS *dbproc, int option, const char *char_param, int int_param)
Set db-lib or server option.
Definition: dblib.c:4383
void dbprhead(DBPROCESS *dbproc)
Print result set headings to stdout.
Definition: dblib.c:3854
RETCODE dbsetlversion(LOGINREC *login, BYTE version)
Set TDS version for future connections.
Definition: dblib.c:945
RETCODE dbprrow(DBPROCESS *dbproc)
Print a result set to stdout.
Definition: dblib.c:3425
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Definition: dblib.c:6929
int dbalttype(DBPROCESS *dbproc, int computeid, int column)
Get datatype for a compute column.
Definition: dblib.c:4240
RETCODE dbsprhead(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print result set headings to a buffer.
Definition: dblib.c:3789
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition: dblib.c:1423
DBBOOL dbwillconvert(int srctype, int desttype)
Test whether or not a datatype can be converted to another datatype.
Definition: dblib.c:2885
int dbcolutype(DBPROCESS *dbproc, int column)
Get user-defined datatype of a regular result column.
Definition: dblib.c:2933
RETCODE dbstrbuild(DBPROCESS *dbproc, char *charbuf, int bufsize, char *text, char *formats,...)
Build a printable string from text containing placeholders for variables.
Definition: dblib.c:7223
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition: dblib.c:5030
RETCODE dbsetversion(DBINT version)
Specify a db-lib version level.
Definition: dblib.c:5885
int dbgetpacket(DBPROCESS *dbproc)
Get TDS packet size for the connection.
Definition: dblib.c:3970
void dbrecftos(const char filename[])
Record to a file all SQL commands sent to the server.
Definition: dblib.c:6689
BYTE * dbgetuserdata(DBPROCESS *dbproc)
Get address of user-allocated data from a DBPROCESS.
Definition: dblib.c:5867
void dbsetuserdata(DBPROCESS *dbproc, BYTE *ptr)
Associate client-allocated (and defined) data with a DBPROCESS.
Definition: dblib.c:5849
DBINT dbprcollen(DBPROCESS *dbproc, int column)
Get size of a result column needed to print column.
Definition: dblib.c:3132
void dbloginfree(LOGINREC *login)
free the LOGINREC
Definition: dblib.c:751
RETCODE dbmorecmds(DBPROCESS *dbproc)
See if more commands are to be processed.
Definition: dblib.c:6150
DBBOOL dbisopt(DBPROCESS *dbproc, int option, const char param[])
Get value of an option.
Definition: dblib.c:6076
int dbnumcompute(DBPROCESS *dbproc)
Get count of COMPUTE clauses for a result set.
Definition: dblib.c:4882
RETCODE dbsqlsend(DBPROCESS *dbproc)
Transmit the command buffer to the server.
Definition: dblib.c:6965
RETCODE dbsprline(DBPROCESS *dbproc, char *buffer, DBINT buf_len, DBCHAR line_char)
Get formatted string for underlining dbsprhead() column names.
Definition: dblib.c:3731
void dbexit()
Close server connections and free all related structures.
Definition: dblib.c:1559
RETCODE dbsafestr(DBPROCESS *dbproc, const char *src, DBINT srclen, char *dest, DBINT destlen, int quotetype)
safely quotes character values in SQL text.
Definition: dblib.c:6302
int dbaltcolid(DBPROCESS *dbproc, int computeid, int column)
Get column ID of a compute column.
Definition: dblib.c:4182
RETCODE dbanydatecrack(DBPROCESS *dbproc, DBDATEREC2 *di, int type, const void *data)
Break any kind of date or time value into useful pieces.
Definition: dblib.c:5777
RETCODE dbsettime(int seconds)
Set maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4090
int dbnumcols(DBPROCESS *dbproc)
Return number of regular columns in a result set.
Definition: dblib.c:1860
int dbgetmaxprocs(void)
get maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:4069
DBBINARY * dbtxptr(DBPROCESS *dbproc, int column)
Get text pointer for a column in the current row.
Definition: dblib.c:6472
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition: dblib.c:5049
STATUS dbreadtext(DBPROCESS *dbproc, void *buf, DBINT bufsize)
Fetch part of a text or image value from the server.
Definition: dblib.c:6585
RETCODE dbsqlok(DBPROCESS *dbproc)
Wait for results of a query from the server.
Definition: dblib.c:4722
DBINT dbdatlen(DBPROCESS *dbproc, int column)
Get size of current row's data in a regular result column.
Definition: dblib.c:3209
STATUS dbsetrow(DBPROCESS *dbproc, DBINT row)
Make a buffered row "current" without fetching it into bound variables.
Definition: dblib.c:2047
void dbclose(DBPROCESS *dbproc)
Close a connection to the server and free associated resources.
Definition: dblib.c:1492
RETCODE dbstrcpy(DBPROCESS *dbproc, int start, int numbytes, char *dest)
Get a copy of a chunk of the command buffer.
Definition: dblib.c:6258
DBINT dbaltutype(DBPROCESS *dbproc, int computeid, int column)
Get user-defined datatype of a compute column.
Definition: dblib.c:7036
RETCODE dbsetmaxprocs(int maxprocs)
Set maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3994
DBINT dbfirstrow(DBPROCESS *dbproc)
See if a server response has arrived.
Definition: dblib.c:7115
RETCODE dbspr1row(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print a regular result row to a buffer.
Definition: dblib.c:3342
RETCODE dbaltbind(DBPROCESS *dbproc, int computeid, int column, int vartype, DBINT varlen, BYTE *varaddr)
Bind a compute column to a program variable.
Definition: dblib.c:4278
int dbdatecmp(DBPROCESS *dbproc, DBDATETIME *d1, DBDATETIME *d2)
Compare DBDATETIME values, similar to strcmp(3).
Definition: dblib.c:5674
const char * dbmonthname(DBPROCESS *dbproc, char *language, int monthnum, DBBOOL shortform)
Get name of a month, in some human language.
Definition: dblib.c:6880
RETCODE dbmny4zero(DBPROCESS *dbproc, DBMONEY4 *dest)
Zero a DBMONEY4 value.
Definition: dblib.c:5479
RETCODE dbmny4add(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *sum)
Add two DBMONEY4 values.
Definition: dblib.c:5502
int dbmny4cmp(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2)
Compare two DBMONEY4 values.
Definition: dblib.c:5621
RETCODE dbmnymaxpos(DBPROCESS *dbproc, DBMONEY *amount)
Get maximum positive DBMONEY value supported.
Definition: dblib.c:5254
RETCODE dbmny4minus(DBPROCESS *dbproc, DBMONEY4 *src, DBMONEY4 *dest)
Negate a DBMONEY4 value.
Definition: dblib.c:5455
RETCODE dbmnyminus(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Negate a DBMONEY value.
Definition: dblib.c:5428
RETCODE dbmny4sub(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *diff)
Subtract two DBMONEY4 values.
Definition: dblib.c:5533
RETCODE dbmnyzero(DBPROCESS *dbproc, DBMONEY *dest)
Set a DBMONEY value to zero.
Definition: dblib.c:5233
RETCODE dbmnycopy(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Copy a DBMONEY value.
Definition: dblib.c:5920
RETCODE dbmny4copy(DBPROCESS *dbproc, DBMONEY4 *src, DBMONEY4 *dest)
Copy a DBMONEY4 value.
Definition: dblib.c:5649
RETCODE dbmnymaxneg(DBPROCESS *dbproc, DBMONEY *amount)
Get maximum negative DBMONEY value supported.
Definition: dblib.c:5275
RETCODE dbmnydec(DBPROCESS *dbproc, DBMONEY *amount)
Subtract $0.0001 from a DBMONEY value.
Definition: dblib.c:5400
RETCODE dbmnyinc(DBPROCESS *dbproc, DBMONEY *amount)
Add $0.0001 to a DBMONEY value.
Definition: dblib.c:5372
int dbmnycmp(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2)
Compare two DBMONEY values.
Definition: dblib.c:5175
DBINT dbretstatus(DBPROCESS *dbproc)
Fetch status value returned by query or remote procedure call.
Definition: dblib.c:4582
RETCODE dbrpcinit(DBPROCESS *dbproc, const char rpcname[], DBSMALLINT options)
Initialize a remote procedure call.
Definition: rpc.c:72
BYTE * dbretdata(DBPROCESS *dbproc, int retnum)
Get value of an output parameter filled by a stored procedure.
Definition: dblib.c:4661
char * dbretname(DBPROCESS *dbproc, int retnum)
Get name of an output parameter filled by a stored procedure.
Definition: dblib.c:4632
DBBOOL dbhasretstat(DBPROCESS *dbproc)
Determine if query generated a return status number.
Definition: dblib.c:4558
int dbrettype(DBPROCESS *dbproc, int retnum)
Get datatype of a stored procedure's return parameter.
Definition: dblib.c:6181
int dbretlen(DBPROCESS *dbproc, int retnum)
Get size of an output parameter filled by a stored procedure.
Definition: dblib.c:4687
RETCODE dbrpcparam(DBPROCESS *dbproc, const char paramname[], BYTE status, int db_type, DBINT maxlen, DBINT datalen, BYTE *value)
Add a parameter to a remote procedure call.
Definition: rpc.c:155
RETCODE dbrpcsend(DBPROCESS *dbproc)
Execute the procedure and free associated memory.
Definition: rpc.c:281
int dbnumrets(DBPROCESS *dbproc)
Get count of output parameters filled by a stored procedure.
Definition: dblib.c:4600
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
char * buf
static int input()
yy_size_t n
static void text(MDB_val *v)
Definition: mdb_dump.c:62
static int version
Definition: mdb_load.c:29
constexpr auto sort(_Init &&init)
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
T negative(T x_)
static char terminator
Definition: njn_ioutil.cpp:56
static int bufsize
Definition: pcregrep.c:162
static pcre_uint8 * buffer
Definition: pcretest.c:1051
#define row(bind, expected)
Definition: string_bind.c:73
Definition: sybdb.h:376
BYTE CaseSensitive
Definition: sybdb.h:388
BYTE Precision
Definition: sybdb.h:384
SHORT Type
Definition: sybdb.h:381
BOOL Identity
Definition: sybdb.h:390
BOOL VarLength
Definition: sybdb.h:386
SHORT ServerType
Definition: sybdb.h:391
BYTE Null
Definition: sybdb.h:387
DBINT UserType
Definition: sybdb.h:382
BYTE Scale
Definition: sybdb.h:385
BYTE Updatable
Definition: sybdb.h:389
DBINT ServerMaxLength
Definition: sybdb.h:392
DBINT SizeOfStruct
Definition: sybdb.h:377
DBINT MaxLength
Definition: sybdb.h:383
Definition: sybdb.h:357
BYTE Scale
Definition: sybdb.h:366
DBINT UserType
Definition: sybdb.h:363
BYTE Null
Definition: sybdb.h:368
BYTE Precision
Definition: sybdb.h:365
BYTE CaseSensitive
Definition: sybdb.h:369
BOOL Identity
Definition: sybdb.h:371
DBINT MaxLength
Definition: sybdb.h:364
BYTE Updatable
Definition: sybdb.h:370
SHORT Type
Definition: sybdb.h:362
BOOL VarLength
Definition: sybdb.h:367
DBINT SizeOfStruct
Definition: sybdb.h:358
DBUSMALLINT days
Definition: sybdb.h:304
DBUSMALLINT minutes
Definition: sybdb.h:305
DBSMALLINT offset
time offset
Definition: sybdb.h:312
DBUSMALLINT _res
Definition: sybdb.h:316
DBUBIGINT time
time, 7 digit precision
Definition: sybdb.h:310
DBUSMALLINT has_date
Definition: sybdb.h:318
DBUSMALLINT has_time
Definition: sybdb.h:317
DBUSMALLINT time_prec
Definition: sybdb.h:313
DBUSMALLINT has_offset
Definition: sybdb.h:319
DBINT date
date, 0 = 1900-01-01
Definition: sybdb.h:311
DBINT dtdays
Definition: sybdb.h:298
DBINT dttime
Definition: sybdb.h:299
DBINT mny4
Definition: sybdb.h:293
Definition: sybdb.h:286
DBUINT mnylow
Definition: sybdb.h:288
DBINT mnyhigh
Definition: sybdb.h:287
unsigned char scale
Definition: sybdb.h:279
unsigned char precision
Definition: sybdb.h:278
DBSMALLINT len
Definition: sybdb.h:272
DBSMALLINT len
Definition: sybdb.h:266
Definition: dbpivot.c:76
DBINT strtotlen
Definition: sybdb.h:346
BYTE * strtext
Definition: sybdb.h:345
struct dbstring * strnext
Definition: sybdb.h:347
DBINT precision
Definition: sybdb.h:339
DBINT scale
Definition: sybdb.h:340
STATUS status
Definition: dbpivot.c:778
Definition: type.c:6
else result
Definition: token2.c:20
Modified on Tue May 28 05:49:23 2024 by modify_doxy.py rev. 669887