zeoslib  UNKNOWN
 All Files
ZPlainDbLibConstants.pas
Go to the documentation of this file.
1 {*********************************************************}
2 { }
3 { Zeos Database Objects }
4 { Delphi plain driver interface to DBLibrary }
5 { }
6 { Originally written by Janos Fegyverneki }
7 { FreeTDS supportd by Bogdan Dragulin }
8 { }
9 {*********************************************************}
10 
11 {@********************************************************}
12 { Copyright (c) 1999-2012 Zeos Development Group }
13 { }
14 { License Agreement: }
15 { }
16 { This library is distributed in the hope that it will be }
17 { useful, but WITHOUT ANY WARRANTY; without even the }
18 { implied warranty of MERCHANTABILITY or FITNESS FOR }
19 { A PARTICULAR PURPOSE. See the GNU Lesser General }
20 { Public License for more details. }
21 { }
22 { The source code of the ZEOS Libraries and packages are }
23 { distributed under the Library GNU General Public }
24 { License (see the file COPYING / COPYING.ZEOS) }
25 { with the following modification: }
26 { As a special exception, the copyright holders of this }
27 { library give you permission to link this library with }
28 { independent modules to produce an executable, }
29 { regardless of the license terms of these independent }
30 { modules, and to copy and distribute the resulting }
31 { executable under terms of your choice, provided that }
32 { you also meet, for each linked independent module, }
33 { the terms and conditions of the license of that module. }
34 { An independent module is a module which is not derived }
35 { from or based on this library. If you modify this }
36 { library, you may extend this exception to your version }
37 { of the library, but you are not obligated to do so. }
38 { If you do not wish to do so, delete this exception }
39 { statement from your version. }
40 { }
41 { }
42 { The project web site is located on: }
43 { http://zeos.firmos.at (FORUM) }
44 { http://sourceforge.net/p/zeoslib/tickets/ (BUGTRACKER)}
45 { svn://svn.code.sf.net/p/zeoslib/code-0/trunk (SVN) }
46 { }
47 { http://www.sourceforge.net/projects/zeoslib. }
48 { }
49 { }
50 { Zeos Development Group. }
51 {********************************************************@}
52 
53 unit ZPlainDbLibConstants;
54 
55 interface
56 
57 {$I ZPlain.inc}
58 
59 uses // M.A.
60  ZCompatibility; // M.A.
61 
62 {***************** Plain API Constants definition ****************}
63 const
64 { General #define }
65  TIMEOUT_IGNORE = Cardinal(-1);
66  TIMEOUT_INFINITE = 0;
67  TIMEOUT_MAXIMUM = 1200; { 20 minutes maximum timeout value }
68 
69 { Used for ServerType in dbgetprocinfo }
70  SERVTYPE_UNKNOWN = 0;
71  SERVTYPE_MICROSOFT = 1;
72 
73 { Used by dbcolinfo }
74 {enum CI_TYPES }
75  CI_REGULAR = 1;
76  CI_ALTERNATE = 2;
77  CI_CURSOR = 3;
78 
79 { Bulk Copy Definitions (bcp) }
80  DB_IN = 1; { Transfer from client to server }
81  DB_OUT = 2; { Transfer from server to client }
82 
83  BCPMAXERRS = 1; { bcp_control parameter }
84  BCPFIRST = 2; { bcp_control parameter }
85  BCPLAST = 3; { bcp_control parameter }
86  BCPBATCH = 4; { bcp_control parameter }
87  BCPKEEPNULLS = 5; { bcp_control parameter }
88  BCPABORT = 6; { bcp_control parameter }
89  BCPKEEPIDENTITY = 8; { bcp_control parameter }
90 
91  BCPLABELED = 5; { bcp_control parameter }
92  BCPHINTS = 6; { bcp_control parameter }
93 
94  DBCMDNONE = 0; { bcp_control parameter }
95  DBCMDPEND = 1; { bcp_control parameter }
96  DBCMDSENT = 2; { bcp_control parameter }
97 
98  TINYBIND = 1;
99  SMALLBIND = 2;
100  INTBIND = 3;
101  CHARBIND = 4;
102  BINARYBIND = 5;
103  BITBIND = 6;
104  DATETIMEBIND = 7;
105  MONEYBIND = 8;
106  FLT8BIND = 9;
107  STRINGBIND = 10;
108  NTBSTRINGBIND = 11;
109  VARYCHARBIND = 12;
110  VARYBINBIND = 13;
111  FLT4BIND = 14;
112  SMALLMONEYBIND = 15;
113  SMALLDATETIBIND = 16;
114  DECIMALBIND = 17;
115  NUMERICBIND = 18;
116  SRCDECIMALBIND = 19;
117  SRCNUMERICBIND = 20;
118  MAXBIND = SRCNUMERICBIND;
119 
120  DBSAVE = 1;
121  DBNOSAVE = 0;
122 
123  DBNOERR = -1;
124  DBFAIL = 0;
125  DBSUCCEED = 1;
126 
127  DBFINDONE = $04; { Definately done }
128  DBMORE = $10; { Maybe more commands waiting }
129  DBMORE_ROWS = $20; { This command returned rows }
130 
131  MAXNAME = 31;
132  DBTXTSLEN = 8; { Timestamp length }
133  DBTXPLEN = 16; { Text pointer length }
134 
135 { Error code returns }
136  INT_EXIT = 0;
137  INT_CONTINUE = 1;
138  INT_CANCEL = 2;
139 
140  //from FreeTDS sybdb.h:
141 { DBVERSION_xxx are used with dbsetlversion() }
142  DBVERSION_100= 2; // Sybase TDS 5.0
143  DBVERSION_42 = 3; // This can be used for old Microsoft and Sybase servers
144  DBVERSION_70 = 4;
145  DBVERSION_71 = 5;
146  DBVERSION_72 = 6;
147  DBVERSION_73 = 7;
148 
149 {Zeos dbsetversion placeholders}
150  ZVersion_UNKNOWN = 0;
151  ZVersion_2_0 = 1; { pre 4.0 SQL Server }
152  ZVersion_3_4 = 2; { Microsoft SQL Server (3.0) }
153  ZVersion_4_0 = 3; { 4.0 SQL Server }
154  ZVersion_4_2 = 4; { 4.2 SQL Server }
155  ZVersion_4_6 = 5; { 2.0 OpenServer and 4.6 SQL Server. }
156  ZVersion_4_9_5 = 6; { 4.9.5 (NCR) SQL Server }
157  ZVersion_5_0 = 7; { 5.0 SQL Server }
158  ZVersion_7_0 = 8; { Microsoft SQL Server 7.0 }
159  ZVersion_8_0 = 9; { Microsoft SQL Server 2000 }
160  ZVersion_9_0 = 10; { Microsoft SQL Server 2005 }
161  ZVersion_7_1 = 9; { Microsoft SQL Server 2000 }
162  ZVersion_7_2 = 10; { Microsoft SQL Server 2005 }
163  ZVersion_7_3 = 11; { Microsoft SQL Server 2008 }
164 
165  ZVersionMax = 13; { known count of available versions }
166  ZVersionEmpty = -1; { placeholder for unsuported version }
167 
168 { DB-Library datatypes }
169 const
170 {Zeos DBOption placeholders}
171 { a large list of options, DBTEXTSIZE is needed by sybtcl }
172  Z_PARSEONLY = 0;
173  Z_ESTIMATE = 1;
174  Z_SHOWPLAN = 2;
175  Z_NOEXEC = 3;
176  Z_ARITHIGNORE = 4;
177  Z_NOCOUNT = 5;
178  Z_ARITHABORT = 6;
179  Z_TEXTLIMIT = 7;
180  Z_BROWSE = 8;
181  Z_OFFSET = 9;
182  Z_STAT = 10;
183  Z_ERRLVL = 11;
184  Z_CONFIRM = 12;
185  Z_STORPROCID = 13;
186  Z_BUFFER = 14;
187  Z_NOAUTOFREE = 15;
188  Z_ROWCOUNT = 16;
189  Z_TEXTSIZE = 17;
190  Z_NATLANG = 18;
191  Z_DATEFORMAT = 19;
192  Z_PRPAD = 20;
193  Z_PRCOLSEP = 21;
194  Z_PRLINELEN = 22;
195  Z_PRLINESEP = 23;
196  Z_LFCONVERT = 24;
197  Z_DATEFIRST = 25;
198  Z_CHAINXACTS = 26;
199  Z_FIPSFLAG = 27;
200  Z_ISOLATION = 28;
201  Z_AUTH = 29;
202  Z_IDENTITY = 30;
203  Z_NOIDCOL = 31;
204  Z_DATESHORT = 32;
205  Z_CLIENTCURSORS = 33;
206  Z_SETTIME = 34;
207  Z_QUOTEDIDENT = 35;
208  Z_NUMOPTIONS = 36;
209  Z_PADOFF = 37;
210  Z_PADON = 38;
211  Z_OFF = 39;
212  Z_ON = 40;
213  Z_NOSUCHOPTION = 41;
214  Z_MAXOPTTEXT = 42;
215  Z_ANSITOOEM = 43;
216  Z_OEMTOANSI = 44;
217 
218 { loginrec manipulation Placeholders}
219  Z_SETHOST = 0;
220  Z_SETUSER = 1;
221  Z_SETPWD = 2;
222  Z_SETHID = 3;
223  Z_SETAPP = 4;
224  Z_SETBCP = 5;
225  Z_SETSECURE = 6;
226  Z_SETLANG = 7;
227  Z_SETNOSHORT = 8;
228  Z_SETHIER = 9;
229  Z_SETCHARSET = 10;
230  Z_SETPACKET = 11;
231  Z_SETENCRYPT = 12;
232  Z_SETLABELED = 13;
233  Z_SETDBNAME = 14;
234  Z_SETLOGINTIME = 15;
235  Z_SETFALLBACK = 16;
236 
237 { datatype plazeholders }
238  Z_SQLVOID = 0;
239  Z_SQLTEXT = 1;
240  Z_SQLVARBINARY = 2;
241  Z_SQLINTN = 3;
242  Z_SQLVARCHAR = 4;
243  Z_SQLBINARY = 5;
244  Z_SQLIMAGE = 6;
245  Z_SQLCHAR = 7;
246  Z_SQLINT1 = 8;
247  Z_SQLBIT = 9;
248  Z_SQLINT2 = 10;
249  Z_SQLINT4 = 11;
250  Z_SQLMONEY = 12;
251  Z_SQLDATETIME = 13;
252  Z_SQLFLT8 = 14;
253  Z_SQLFLTN = 15;
254  Z_SQLMONEYN = 16;
255  Z_SQLDATETIMN = 17;
256  Z_SQLFLT4 = 18;
257  Z_SQLMONEY4 = 19;
258  Z_SQLDATETIM4 = 20;
259  Z_SQLDECIMAL = 21;
260  Z_SQLNUMERIC = 22;
261 
262 { DBLib options }
263 const
264  DBLIBDBBUFFER = 0;
265  DBLIBDBOFFSET = 1;
266  DBLIBDBROWCOUNT = 2;
267  DBLIBDBSTAT = 3;
268  DBLIBDBTEXTLIMIT = 4;
269  DBLIBDBTEXTSIZE = 5;
270  DBLIBDBARITHABORT = 6;
271  DBLIBDBARITHIGNORE = 7;
272  DBLIBDBNOAUTOFREE = 8;
273  DBLIBDBNOCOUNT = 9;
274  DBLIBDBNOEXEC = 10;
275  DBLIBDBPARSEONLY = 11;
276  DBLIBDBSHOWPLAN = 12;
277  DBLIBDBSTORPROCID = 13;
278  DBLIBDBANSITOOEM = 14;
279  DBLIBDBOEMTOANSI = 15;
280  DBLIBDBCLIENTCURSORS = 16;
281  DBLIBDBSET_TIME = 17;
282  DBLIBDBQUOTEDIDENT = 18;
283 
284 { FreeTDS options, a large list of options, DBTEXTSIZE is needed by sybtcl }
285  TDSPARSEONLY = 0;
286  TDSESTIMATE = 1;
287  TDSSHOWPLAN = 2;
288  TDSNOEXEC = 3;
289  TDSARITHIGNORE = 4;
290  TDSNOCOUNT = 5;
291  TDSARITHABORT = 6;
292  TDSTEXTLIMIT = 7;
293  TDSBROWSE = 8;
294  TDSOFFSET = 9;
295  TDSSTAT = 10;
296  TDSERRLVL = 11;
297  TDSCONFIRM = 12;
298  TDSSTORPROCID = 13;
299  TDSBUFFER = 14;
300  TDSNOAUTOFREE = 15;
301  TDSROWCOUNT = 16;
302  TDSTEXTSIZE = 17;
303  TDSNATLANG = 18;
304  TDSDATEFORMAT = 19;
305  TDSPRPAD = 20;
306  TDSPRCOLSEP = 21;
307  TDSPRLINELEN = 22;
308  TDSPRLINESEP = 23;
309  TDSLFCONVERT = 24;
310  TDSDATEFIRST = 25;
311  TDSCHAINXACTS = 26;
312  TDSFIPSFLAG = 27;
313  TDSISOLATION = 28;
314  TDSAUTH = 29;
315  TDSIDENTITY = 30;
316  TDSNOIDCOL = 31;
317  TDSDATESHORT = 32;
318  TDSCLIENTCURSORS = 33;
319  TDSSETTIME = 34;
320  TDSQUOTEDIDENT = 35;
321  TDSNUMOPTIONS = 36;
322  TDSPADOFF = 0;
323  TDSPADON = 1;
324  TDSOFF = 0;
325  TDSON = 1;
326 
327  NOSUCHOPTION = 2;
328 
329  MAXOPTTEXT = 32;
330 
331 { common Login manipulations }
332  DBSETHOST = 1;
333  DBSETUSER = 2;
334  DBSETPWD = 3;
335 { Sybase Login manipulations }
336 const
337  SYBDBSETHOST = DBSETHOST;
338  SYBDBSETUSER = DBSETUSER;
339  SYBDBSETPWD = DBSETPWD;
340  SYBDBSETHID = 4;
341  SYBDBSETAPP = 5;
342  SYBDBSETBCP = 6;
343  SYBDBSETLANG = 7;
344  SYBDBSETNOSHORT = 8;
345  SYBDBSETHIER = 9;
346  SYBDBSETCHARSET = 10;
347  SYBDBSETPACKET = 11;
348  SYBDBSETENCRYPT = 12;
349  SYBDBSETLABELED = 13;
350 
351 { MsSQL Login manipulations }
352 const
353  MSDBSETHOST = DBSETHOST;
354  MSDBSETUSER = DBSETUSER;
355  MSDBSETPWD = DBSETPWD;
356  MSDBSETAPP = 4;
357  MSDBSETID = 5;
358  MSDBSETLANG = 6;
359 
360  MSDBSETSECURE = 7;
361  MSDBSET_LOGIN_TIME = 10;
362  MSDBSETFALLBACK = 12;
363 
364 {TDS Loginrec manipulations}
365  TDSDBSETHOST = DBSETHOST;
366  TDSDBSETUSER = DBSETUSER;
367  TDSDBSETPWD = DBSETPWD;
368  TDSDBSETHID = 4;
369  TDSDBSETAPP = 5;
370  TDSDBSETBCP = 6;
371  TDSDBSETSECURE = 6;
372  TDSDBSETLANG = 7;
373  TDSDBSETNOSHORT = 8;
374  TDSDBSETHIER = 9;
375  TDSDBSETCHARSET = 10;
376  TDSDBSETPACKET = 11;
377  TDSDBSETENCRYPT = 12;
378  TDSDBSETLABELED = 13;
379  TDSDBSETDBNAME = 14;
380 
381 { TDS_DBVERSION_xxx are used with dbsetversion() }
382  TDSDBVERSION_UNKNOWN = 0;
383  TDSDBVERSION_46 = 1;
384  TDSDBVERSION_100 = 2; // Sybase TDS 5.0
385  TDSDBVERSION_42 = 3; // This can be used for old Microsoft and Sybase servers
386  TDSDBVERSION_70 = 4;
387  TDSDBVERSION_71 = 5;
388  TDSDBVERSION_80 = TDSDBVERSION_71;
389  TDSDBVERSION_72 = 6;
390  TDSDBVERSION_73 = 7;
391 
392 { these two are defined by Microsoft for dbsetlversion() }
393  DBVER42 = 8;
394  DBVER60 = 9;
395 
396 (**
397  * DBTDS_xxx are returned by DBTDS()
398  * The integer values of the constants are poorly chosen.
399  *)
400  DBTDS_UNKNOWN = 0;
401  DBTDS_2_0 = 1; { pre 4.0 SQL Server }
402  DBTDS_3_4 = 2; { Microsoft SQL Server (3.0) }
403  DBTDS_4_0 = 3; { 4.0 SQL Server }
404  DBTDS_4_2 = 4; { 4.2 SQL Server }
405  DBTDS_4_6 = 5; { 2.0 OpenServer and 4.6 SQL Server. }
406  DBTDS_4_9_5 = 6; { 4.9.5 (NCR) SQL Server }
407  DBTDS_5_0 = 7; { 5.0 SQL Server }
408  DBTDS_7_0 = 8; { Microsoft SQL Server 7.0 }
409  DBTDS_8_0 = 9; { Microsoft SQL Server 2000 }
410  DBTDS_9_0 = 10; { Microsoft SQL Server 2005 }
411  DBTDS_7_1 = 9; { Microsoft SQL Server 2000 }
412  DBTDS_7_2 = 10; { Microsoft SQL Server 2005 }
413  DBTDS_7_3 = 11; { Microsoft SQL Server 2008 }
414 
415 
416 { Data Type Tokens }
417  DBLIBSQLVOID = $1f;
418  DBLIBSQLTEXT = $23;
419  DBLIBSQLVARBINARY = $25;
420  DBLIBSQLINTN = $26; { all nullable integers }
421  DBLIBSQLVARCHAR = $27;
422  DBLIBSQLBINARY = $2d;
423  DBLIBSQLIMAGE = $22;
424  DBLIBSQLCHAR = $2f;
425  DBLIBSQLINT1 = $30;
426  DBLIBSQLBIT = $32;
427  DBLIBSQLINT2 = $34;
428  DBLIBSQLINT4 = $38;
429  DBLIBSQLMONEY = $3c;
430  DBLIBSQLDATETIME = $3d;
431  DBLIBSQLFLT8 = $3e;
432  DBLIBSQLFLTN = $6d;
433  DBLIBSQLMONEYN = $6e;
434  DBLIBSQLDATETIMN = $6f;
435  DBLIBSQLFLT4 = $3b;
436  DBLIBSQLMONEY4 = $7a;
437  DBLIBSQLDATETIM4 = $3a;
438  DBLIBSQLDECIMAL = $6a;
439  DBLIBSQLNUMERIC = $6c;
440 
441 { Data stream tokens }
442  SQLCOLFMT = $a1;
443  OLD_SQLCOLFMT = $2a;
444  SQLPROCID = $7c;
445  SQLCOLNAME = $a0;
446  SQLTABNAME = $a4;
447  SQLCOLINFO = $a5;
448  SQLALTNAME = $a7;
449  SQLALTFMT = $a8;
450  SQLERROR = $aa;
451  SQLINFO = $ab;
452  SQLRETURNVALUE = $ac;
453  SQLRETURNSTATUS = $79;
454  SQLRETURN = $db;
455  SQLCONTROL = $ae;
456  SQLALTCONTROL = $af;
457  SQLROW = $d1;
458  SQLALTROW = $d3;
459  SQLDONE = $fd;
460  SQLDONEPROC = $fe;
461  SQLDONEINPROC = $ff;
462  SQLOFFSET = $78;
463  SQLORDER = $a9;
464  SQLLOGINACK = $ad; { NOTICE: change to real value }
465 
466 { Ag op tokens }
467  SQLAOPCNT = $4b;
468  SQLAOPSUM = $4d;
469  SQLAOPAVG = $4f;
470  SQLAOPMIN = $51;
471  SQLAOPMAX = $52;
472  SQLAOPANY = $53;
473  SQLAOPNOOP = $56;
474 
475 { Error numbers (dberrs) DB-Library error codes }
476  SQLEMEM = 10000;
477  SQLENULL = 10001;
478  SQLENLOG = 10002;
479  SQLEPWD = 10003;
480  SQLECONN = 10004;
481  SQLEDDNE = 10005;
482  SQLENULLO = 10006;
483  SQLESMSG = 10007;
484  SQLEBTOK = 10008;
485  SQLENSPE = 10009;
486  SQLEREAD = 10010;
487  SQLECNOR = 10011;
488  SQLETSIT = 10012;
489  SQLEPARM = 10013;
490  SQLEAUTN = 10014;
491  SQLECOFL = 10015;
492  SQLERDCN = 10016;
493  SQLEICN = 10017;
494  SQLECLOS = 10018;
495  SQLENTXT = 10019;
496  SQLEDNTI = 10020;
497  SQLETMTD = 10021;
498  SQLEASEC = 10022;
499  SQLENTLL = 10023;
500  SQLETIME = 10024;
501  SQLEWRIT = 10025;
502  SQLEMODE = 10026;
503  SQLEOOB = 10027;
504  SQLEITIM = 10028;
505  SQLEDBPS = 10029;
506  SQLEIOPT = 10030;
507  SQLEASNL = 10031;
508  SQLEASUL = 10032;
509  SQLENPRM = 10033;
510  SQLEDBOP = 10034;
511  SQLENSIP = 10035;
512  SQLECNULL = 10036;
513  SQLESEOF = 10037;
514  SQLERPND = 10038;
515  SQLECSYN = 10039;
516  SQLENONET = 10040;
517  SQLEBTYP = 10041;
518  SQLEABNC = 10042;
519  SQLEABMT = 10043;
520  SQLEABNP = 10044;
521  SQLEBNCR = 10045;
522  SQLEAAMT = 10046;
523  SQLENXID = 10047;
524  SQLEIFNB = 10048;
525  SQLEKBCO = 10049;
526  SQLEBBCI = 10050;
527  SQLEKBCI = 10051;
528  SQLEBCWE = 10052;
529  SQLEBCNN = 10053;
530  SQLEBCOR = 10054;
531  SQLEBCPI = 10055;
532  SQLEBCPN = 10056;
533  SQLEBCPB = 10057;
534  SQLEVDPT = 10058;
535  SQLEBIVI = 10059;
536  SQLEBCBC = 10060;
537  SQLEBCFO = 10061;
538  SQLEBCVH = 10062;
539  SQLEBCUO = 10063;
540  SQLEBUOE = 10064;
541  SQLEBWEF = 10065;
542  SQLEBTMT = 10066;
543  SQLEBEOF = 10067;
544  SQLEBCSI = 10068;
545  SQLEPNUL = 10069;
546  SQLEBSKERR = 10070;
547  SQLEBDIO = 10071;
548  SQLEBCNT = 10072;
549  SQLEMDBP = 10073;
550  SQLINIT = 10074;
551  SQLCRSINV = 10075;
552  SQLCRSCMD = 10076;
553  SQLCRSNOIND = 10077;
554  SQLCRSDIS = 10078;
555  SQLCRSAGR = 10079;
556  SQLCRSORD = 10080;
557  SQLCRSMEM = 10081;
558  SQLCRSBSKEY = 10082;
559  SQLCRSNORES = 10083;
560  SQLCRSVIEW = 10084;
561  SQLCRSBUFR = 10085;
562  SQLCRSFROWN = 10086;
563  SQLCRSBROL = 10087;
564  SQLCRSFRAND = 10088;
565  SQLCRSFLAST = 10089;
566  SQLCRSRO = 10090;
567  SQLCRSTAB = 10091;
568  SQLCRSUPDTAB = 10092;
569  SQLCRSUPDNB = 10093;
570  SQLCRSVIIND = 10094;
571  SQLCRSNOUPD = 10095;
572  SQLCRSOS2 = 10096;
573  SQLEBCSA = 10097;
574  SQLEBCRO = 10098;
575  SQLEBCNE = 10099;
576  SQLEBCSK = 10100;
577  SQLEUVBF = 10101;
578  SQLEBIHC = 10102;
579  SQLEBWFF = 10103;
580  SQLNUMVAL = 10104;
581  SQLEOLDVR = 10105;
582  SQLEBCPS = 10106;
583  SQLEDTC = 10107;
584  SQLENOTIMPL = 10108;
585  SQLENONFLOAT = 10109;
586  SQLECONNFB = 10110;
587 
588 { The severity levels are defined here }
589  EXINFO = 1; { Informational, non-error }
590  EXUSER = 2; { User error }
591  EXNONFATAL = 3; { Non-fatal error }
592  EXCONVERSION = 4; { Error in DB-LIBRARY data conversion }
593  EXSERVER = 5; { The Server has returned an error flag }
594  EXTIME = 6; { We have exceeded our timeout period while }
595  { waiting for a response from the Server - the }
596  { DBPROCESS is still alive }
597  EXPROGRAM = 7; { Coding error in user program }
598  EXRESOURCE = 8; { Running out of resources - the DBPROCESS may be dead }
599  EXCOMM = 9; { Failure in communication with Server - the DBPROCESS is dead }
600  EXFATAL = 10; { Fatal error - the DBPROCESS is dead }
601  EXCONSISTENCY = 11; { Internal software error - notify MS Technical Supprt }
602 
603 { Offset identifiers }
604  OFF_SELECT = $16d;
605  OFF_FROM = $14f;
606  OFF_ORDER = $165;
607  OFF_COMPUTE = $139;
608  OFF_TABLE = $173;
609  OFF_PROCEDURE = $16a;
610  OFF_STATEMENT = $1cb;
611  OFF_PARAM = $1c4;
612  OFF_EXEC = $12c;
613 
614 { Decimal constants }
615  MAXNUMERICLEN = 16;
616  MAXNUMERICDIG = 38;
617 
618  DEFAULTPRECISION = 18;
619  DEFAULTSCALE = 0;
620 
621 { DB-Table constants}
622 { Pack the following structures on a word boundary }
623  TDSMAXTABLENAME = 512;
624  TDSMAXCOLNAMELEN = 512;
625 
626 { DB-Table constants}
627 { Pack the following structures on a word boundary }
628  MAXTABLENAME = 30;
629  MAXCOLNAMELEN= 30;
630 
631 { DB-Library datatype definitions }
632  DBMAXCHAR=256; // Max length of DBVARBINARY and DBVARCHAR, etc.
633 
634 { Print lengths for certain fixed length data types }
635  PRINT4 = 11;
636  PRINT2 = 6;
637  PRINT1 = 3;
638  PRFLT8 = 20;
639  PRMONEY = 26;
640  PRBIT = 3;
641  PRDATETIME = 27;
642  PRDECIMAL = (MAXNUMERICDIG + 2);
643  PRNUMERIC = (MAXNUMERICDIG + 2);
644 
645  SUCCEED = 1;
646  FAIL = 0;
647  SUCCEED_ABORT = 2;
648 
649  DBUNKNOWN = 2; { FALSE = 0, TRUE = 1 }
650 
651  MORE_ROWS = -1;
652  NO_MORE_ROWS = -2;
653  REG_ROW = MORE_ROWS;
654  BUF_FULL = -3; { only if buffering is turned on }
655 
656 { Status code for dbresults(). Possible return values are }
657 { SUCCEED, FAIL, and NO_MORE_RESULTS. }
658  NO_MORE_RESULTS = 2;
659  NO_MORE_RPC_RESULTS = 3;
660 
661 { Standard exit and error values }
662  STDEXIT = 0;
663  ERREXIT = -1;
664 
665 { dbrpcinit flags }
666  DBRPCRECOMPILE = $0001;
667  DBRPCRESET = $0004;
668  DBRPCCURSOR = $0008;
669 
670 { dbrpcparam flags }
671  DBRPCRETURN = $1;
672  DBRPCDEFAULT = $2;
673 
674 { Cursor related constants }
675 
676 { Following flags are used in the concuropt parameter in the dbcursoropen function }
677  CUR_READONLY = 1; { Read only cursor, no data modifications }
678  CUR_LOCKCC = 2; { Intent to update, all fetched data locked when }
679  { dbcursorfetch is called inside a transaction block }
680  CUR_OPTCC = 3; { Optimistic concurrency control, data modifications }
681  { succeed only if the row hasn't been updated since }
682  { the last fetch. }
683  CUR_OPTCCVAL = 4; { Optimistic concurrency control based on selected column values }
684 
685 { Following flags are used in the scrollopt parameter in dbcursoropen }
686  CUR_FORWARD = 0; { Forward only scrolling }
687  CUR_KEYSET = -1; { Keyset driven scrolling }
688  CUR_DYNAMIC = 1; { Fully dynamic }
689  CUR_INSENSITIVE = -2; { Server-side cursors only }
690 
691 { Following flags define the fetchtype in the dbcursorfetch function }
692  FETCH_FIRST = 1; { Fetch first n rows }
693  FETCH_NEXT = 2; { Fetch next n rows }
694  FETCH_PREV = 3; { Fetch previous n rows }
695  FETCH_RANDOM = 4; { Fetch n rows beginning with given row # }
696  FETCH_RELATIVE = 5; { Fetch relative to previous fetch row # }
697  FETCH_LAST = 6; { Fetch the last n rows }
698 
699 { Following flags define the per row status as filled by dbcursorfetch and/or dbcursorfetchex }
700  FTC_EMPTY = $00; { No row available }
701  FTC_SUCCEED = $01; { Fetch succeeded, (failed if not set) }
702  FTC_MISSING = $02; { The row is missing }
703  FTC_ENDOFKEYSET = $04; { End of the keyset reached }
704  FTC_ENDOFRESULTS = $08; { End of results set reached }
705 
706 { Following flags define the operator types for the dbcursor function }
707  CRS_UPDATE = 1; { Update operation }
708  CRS_DELETE = 2; { Delete operation }
709  CRS_INSERT = 3; { Insert operation }
710  CRS_REFRESH = 4; { Refetch given row }
711  CRS_LOCKCC = 5; { Lock given row }
712 
713 { Following value can be passed to the dbcursorbind function for NOBIND type }
714  NOBIND = -2; { Return length and pointer to data }
715 
716 { Following are values used by DBCURSORINFO's Type parameter }
717  CU_CLIENT = $00000001;
718  CU_SERVER = $00000002;
719  CU_KEYSET = $00000004;
720  CU_MIXED = $00000008;
721  CU_DYNAMIC = $00000010;
722  CU_FORWARD = $00000020;
723  CU_INSENSITIVE = $00000040;
724  CU_READONLY = $00000080;
725  CU_LOCKCC = $00000100;
726  CU_OPTCC = $00000200;
727  CU_OPTCCVAL = $00000400;
728 
729 { Following are values used by DBCURSORINFO's Status parameter }
730  CU_FILLING = $00000001;
731  CU_FILLED = $00000002;
732 
733 { Following are values used by dbupdatetext's type parameter }
734  UT_TEXTPTR = $0001;
735  UT_TEXT = $0002;
736  UT_MORETEXT = $0004;
737  UT_DELETEONLY = $0008;
738  UT_LOG = $0010;
739 
740 { The following values are passed to dbserverenum for searching criteria. }
741  NET_SEARCH = $0001;
742  LOC_SEARCH = $0002;
743 
744 { These constants are the possible return values from dbserverenum. }
745  ENUM_SUCCESS = $0000;
746  MORE_DATA = $0001;
747  NET_NOT_AVAIL = $0002;
748  OUT_OF_MEMORY = $0004;
749  NOT_SUPPORTED = $0008;
750  ENUM_INVALID_PARAM = $0010;
751 
752 { Netlib Error problem codes. ConnectionError() should return one of }
753 { these as the dblib-mapped problem code, so the corresponding string }
754 { is sent to the dblib app's error handler as dberrstr. Return NE_E_NOMAP }
755 { for a generic DB-Library error string (as in prior versions of dblib). }
756 
757  NE_E_NOMAP = 0; { No string; uses dblib default. }
758  NE_E_NOMEMORY = 1; { Insufficient memory. }
759  NE_E_NOACCESS = 2; { Access denied. }
760  NE_E_CONNBUSY = 3; { Connection is busy. }
761  NE_E_CONNBROKEN = 4; { Connection broken. }
762  NE_E_TOOMANYCONN = 5; { Connection limit exceeded. }
763  NE_E_SERVERNOTFOUND = 6; { Specified SQL server not found. }
764  NE_E_NETNOTSTARTED = 7; { The network has not been started. }
765  NE_E_NORESOURCE = 8; { Insufficient network resources. }
766  NE_E_NETBUSY = 9; { Network is busy. }
767  NE_E_NONETACCESS = 10; { Network access denied. }
768  NE_E_GENERAL = 11; { General network error. Check your documentation. }
769  NE_E_CONNMODE = 12; { Incorrect connection mode. }
770  NE_E_NAMENOTFOUND = 13; { Name not found in directory service. }
771  NE_E_INVALIDCONN = 14; { Invalid connection. }
772  NE_E_NETDATAERR = 15; { Error reading or writing network data. }
773  NE_E_TOOMANYFILES = 16; { Too many open file handles. }
774  NE_E_CANTCONNECT = 17; { SQL Server does not exist or access denied. }
775 
776  NE_MAX_NETERROR = 17;
777 
778 
779 const
780  MAXSERVERNAME = 30;
781  MAXNETLIBNAME = 255;
782  MAXNETLIBCONNSTR = 255;
783 
784 const
785  INVALID_UROWNUM = Cardinal(-1);
786 
787 
788 { copied from tds.h }
789 //enum
790  SYBCHAR = 47; (* 0x2F *)
791  SYBVARCHAR = 39; (* 0x27 *)
792  SYBINTN = 38; (* 0x26 *)
793  SYBINT1 = 48; (* 0x30 *)
794  SYBINT2 = 52; (* 0x34 *)
795  SYBINT4 = 56; (* 0x38 *)
796  SYBINT8 = 127; (* 0x7F *)
797  SYBFLT8 = 62; (* 0x3E *)
798  SYBDATETIME = 61; (* 0x3D *)
799  SYBBIT = 50; (* 0x32 *)
800  SYBBITN = 104; (* 0x68 *)
801  SYBTEXT = 35; (* 0x23 *)
802  SYBNTEXT = 99; (* 0x63 *)
803  SYBIMAGE = 34; (* 0x22 *)
804  SYBMONEY4 = 122; (* 0x7A *)
805  SYBMONEY = 60; (* 0x3C *)
806  SYBDATETIME4 = 58; (* 0x3A *)
807  SYBREAL = 59; (* 0x3B *)
808  SYBBINARY = 45; (* 0x2D *)
809  SYBVOID = 31; (* 0x1F *)
810  SYBVARBINARY = 37; (* 0x25 *)
811  SYBNUMERIC = 108; (* 0x6C *)
812  SYBDECIMAL = 106; (* 0x6A *)
813  SYBFLTN = 109; (* 0x6D *)
814  SYBMONEYN = 110; (* 0x6E *)
815  SYBDATETIMN = 111; (* 0x6F *)
816  SYBNVARCHAR = 103; (* 0x67 *)
817  XSYBCHAR = 175; (* 0xAF *)
818  XSYBVARCHAR = 167; (* 0xA7 *)
819  XSYBNVARCHAR = 231; (* 0xE7 *)
820  XSYBNCHAR = 239; (* 0xEF *)
821  XSYBVARBINARY = 165; (* 0xA5 *)
822  XSYBBINARY = 173; (* 0xAD *)
823  SYBUNIQUE = 36; (* 0x24 *)
824  SYBVARIANT = 98; (* 0x62 *)
825  SYBMSUDT = 240; (* 0xF0 *)
826  SYBMSXML = 241; (* 0xF1 *)
827 
828 { FreeTDS Data Type Tokens }
829  TDSSQLVOID = SYBVOID;
830  TDSSQLTEXT = SYBTEXT;
831  TDSSQLVARBINARY = SYBVARBINARY;
832  TDSSQLINTN = SYBINTN;
833  TDSSQLVARCHAR = SYBVARCHAR;
834  TDSSQLBINARY = SYBBINARY;
835  TDSSQLIMAGE = SYBIMAGE;
836  TDSSQLCHAR = SYBCHAR;
837  TDSSQLINT1 = SYBINT1;
838  TDSSQLBIT = SYBBIT;
839  TDSSQLINT2 = SYBINT2;
840  TDSSQLINT4 = SYBINT4;
841  TDSSQLMONEY = SYBMONEY;
842  TDSSQLDATETIME = SYBDATETIME;
843  TDSSQLFLT8 = SYBFLT8;
844  TDSSQLFLTN = SYBFLTN;
845  TDSSQLMONEYN = SYBMONEYN;
846  TDSSQLDATETIMN = SYBDATETIMN;
847  TDSSQLFLT4 = SYBREAL;
848  TDSSQLMONEY4 = SYBMONEY4;
849  TDSSQLDATETIM4 = SYBDATETIME4;
850  TDSSQLDECIMAL = SYBDECIMAL;
851  TDSSQLNUMERIC = SYBNUMERIC;
852 
853  SYBAOPCNT = $4b;
854  SYBAOPCNTU = $4c;
855  SYBAOPSUM = $4d;
856  SYBAOPSUMU = $4e;
857  SYBAOPAVG = $4f;
858  SYBAOPAVGU = $50;
859  SYBAOPMIN = $51;
860  SYBAOPMAX = $52;
861 
862 { mssql2k compute operator }
863  SYBAOPCNT_BIG = $09;
864  SYBAOPSTDEV = $30;
865  SYBAOPSTDEVP = $31;
866  SYBAOPVAR = $32;
867  SYBAOPVARP = $33;
868  SYBAOPCHECKSUM_AGG = $72;
869  {****************** Plain API Types definition *****************}
870 type
871 { DBPROCESS, LOGINREC and DBCURSOR }
872  PDBPROCESS = Pointer;
873  PLOGINREC = Pointer;
874  PDBCURSOR = Pointer;
875  PDBHANDLE = Pointer;
876  DBXLATE = Pointer;
877  DBSORTORDER = Pointer;
878  DBLOGINFO = Pointer;
879  DBVOIDPTR = PPointer;
880 type
881 { DB-Library datatypes }
882  DBBOOL = Byte;
883  DBCHAR = AnsiChar;
884  DBBIT = Byte;
885  DBTINYINT = Byte;
886  DBSMALLINT = SmallInt; { int16_type }
887  DBINT = LongInt; { int32_type }
888  DBBIGINT = Int64; { int64_type }
889  DBBINARY = Byte;
890  DBFLT4 = Single; { real32_type }
891  DBFLT8 = Double; { real64_type }
892 
893  DBSHORT = SmallInt;
894  DBUSMALLINT = Word;
895  DBMONEY4 = LongInt;
896  PDBMONEY4 = ^DBMONEY4;
897 
898  RETCODE = Integer;
899  PRETCODE = ^RETCODE;
900  STATUS = Integer;
901 
902 //typedef int (*INTFUNCPTR) (void *, ...);
903 //typedef int (*DBWAITFUNC) (void);
904 //typedef DBWAITFUNC(*DB_DBBUSY_FUNC) (void *dbproc);
905 //typedef void (*DB_DBIDLE_FUNC) (DBWAITFUNC dfunc, void *dbproc);
906 //typedef int (*DB_DBCHKINTR_FUNC) (void *dbproc);
907 //typedef int (*DB_DBHNDLINTR_FUNC) (void *dbproc); *)
908 
909  DBREAL = DBFLT4;
910  DBUBOOL = Cardinal;
911 
912  DBDATETIM4 = packed record
913  numdays: Word; { No of days since Jan-1-1900 }
914  nummins: Word; { No. of minutes since midnight }
915  end;
916  PDBDATETIM4 = ^DBDATETIM4;
917 
918  {$IFDEF FPC}
919  {$PACKRECORDS C}
920  {$ENDIF}
921 type
922  DBNUMERIC = packed record
923  Precision: Byte;
924  Scale: Byte;
925  Sign: Byte; { 1 = Positive, 0 = Negative }
926  Val: array[0..MAXNUMERICLEN-1] of Byte;
927  end;
928  DBDECIMAL = DBNUMERIC;
929 
930  TDSDBNUMERIC = packed record
931  Precision: Byte;
932  Scale: Byte;
933  Sign: Byte; { 1 = Positive, 0 = Negative }
934  Val: array[0..MAXNUMERICLEN] of Byte;
935  end;
936  TDSDBDECIMAL = TDSDBNUMERIC;
937 
938  DBVARYCHAR = packed record
939  Len: DBSMALLINT;
940  Str: array[0..DBMAXCHAR-1] of DBCHAR;
941  end;
942 
943  DBVARYBIN = packed record
944  Len: DBSMALLINT;
945  Bytes: array[0..DBMAXCHAR-1] of Byte;
946  end;
947 
948  DBMONEY = packed record
949  mnyhigh: DBINT;
950  mnylow: LongWord;
951  end;
952  PDBMONEY = ^DBMONEY;
953 
954  PDBDATETIME = ^DBDATETIME;
955  DBDATETIME = packed record
956  dtdays: DBINT; // Days since Jan 1, 1900
957  dttime: LongWord; // 300ths of a second since midnight, 25920000 unit is 1 day
958  end;
959 
960  PTDSDBDATETIME = ^TTDSDBDATETIME;
961  TTDSDBDATETIME = packed record
962  dtdays: DBINT; // Days since Jan 1, 1900
963  dttime: DBINT; // 300ths of a second since midnight, 25920000 unit is 1 day
964  end;
965 
966 (*
967  * Sybase & Microsoft use different names for the dbdaterec members.
968  * Keep these two structures physically identical in memory.
969  * dbdatecrack() casts one to the other for ease of implementation.
970  *
971  * Giving credit where credit is due, we can acknowledge that
972  * Microsoft chose the better names here, hands down. ("datedmonth"?!)
973  *)
974  { FreeTDS sybdb.h }
975  PTDS_DBDATEREC = ^Ttds_dbdaterec;
976  Ttds_dbdaterec = packed record
977  { fields } {microsoft} {sybase}
978  year: DBINT; { 1753 - 9999 } { 1900 and counting }
979  quarter: DBINT; { 1 - 4 } { 0 - 3 (Microsoft only) }
980  month: DBINT; { 1 - 12 } { 0 - 11 }
981  dayofmonth: DBINT; { 1 - 31 } { 1 - 31 }
982  dayofyear: DBINT; { 1 - 366 } { 1 - 366 (in Sybase.sybdb.h dayofyear and day are changed around!) }
983  week: DBINT; { 1 - 54 (for leap years) } { 1 - 54 (Microsoft only) }
984  weekday: DBINT; { 1 - 7 (Mon - Sun) } { 0 - 6 (Mon - Sun) }
985  hour: DBINT; { 0 - 23 } { 0 - 23 }
986  minute: DBINT; { 0 - 59 } { 0 - 59 }
987  second: DBINT; { 0 - 59 } { 0 - 59 }
988  millisecond: DBINT; { 0 - 999 } { 0 - 997 }
989  tzone: DBINT; { 0 - 127 (Sybase only!) } { 0 - 127 }
990  end;
991 
992 { DBDATEREC structure used by dbdatecrack }
993  DBDATEREC = packed record
994  year: DBINT; { 1753 - 9999 }
995  quarter: DBINT; { 1 - 4 }
996  month: DBINT; { 1 - 12 }
997  dayofyear: DBINT; { 1 - 366 }
998  day: DBINT; { 1 - 31 }
999  week: DBINT; { 1 - 54 (for leap years) }
1000  weekday: DBINT; { 1 - 7 (Mon - Sun) }
1001  hour: DBINT; { 0 - 23 }
1002  minute: DBINT; { 0 - 59 }
1003  second: DBINT; { 0 - 59 }
1004  millisecond: DBINT; { 0 - 999 }
1005  end;
1006  PDBDATEREC = ^DBDATEREC;
1007 
1008 type
1009 { TODO -ofjanos -cAPI :
1010 Strange but I had to insert X1 and X2 into the structure to make it work.
1011 I have not find any reason for this yet. }
1012  {$IFDEF FPC}
1013  {$PACKRECORDS 2}
1014  {$ENDIF}
1015  DBCOL = record
1016  SizeOfStruct: DBINT;
1017  Name: array[0..MAXCOLNAMELEN] of char;
1018  ActualName: array[0..MAXCOLNAMELEN] of char;
1019  TableName: array[0..MAXTABLENAME] of char;
1020  {$IFNDEF FPC}
1021  X1: Byte; //Record-Size diffs with C-Records
1022  {$ENDIF}
1023  Typ: DBSHORT;
1024  UserType: DBINT;
1025  MaxLength: DBINT;
1026  Precision: BYTE;
1027  Scale: BYTE;
1028  VarLength: LongBool; { TRUE, FALSE }
1029  Null: BYTE; { TRUE, FALSE or DBUNKNOWN }
1030  CaseSensitive: BYTE; { TRUE, FALSE or DBUNKNOWN }
1031  Updatable: BYTE; { TRUE, FALSE or DBUNKNOWN }
1032  Identity: LongBool; { TRUE, FALSE or DBUNKNOWN }
1033  {$IFNDEF FPC}
1034  X2: Byte; //Record-Size diffs with C-Records
1035  {$ENDIF}
1036  end;
1037  {$IFDEF FPC}
1038  {$PACKRECORDS DEFAULT}
1039  {$ENDIF}
1040  PDBCOL = ^DBCOL;
1041 
1042  PTDSDBCOL = ^TTDSDBCOL;
1043  TTDSDBCOL = packed record
1044  SizeOfStruct: DBINT;
1045  Name: array[0..TDSMAXCOLNAMELEN+2] of AnsiChar;
1046  ActualName: array[0..TDSMAXCOLNAMELEN+2] of AnsiChar;
1047  TableName: array[0..TDSMAXTABLENAME+2] of AnsiChar;
1048  Typ: SmallInt;
1049  UserType: DBINT;
1050  MaxLength: DBINT;
1051  Precision: Byte;
1052  Scale: Byte;
1053  VarLength: LongBool;{ TRUE, FALSE }
1054  Null: Byte; { TRUE, FALSE or DBUNKNOWN }
1055  CaseSensitive: Byte; { TRUE, FALSE or DBUNKNOWN }
1056  Updatable: Byte; { TRUE, FALSE or DBUNKNOWN }
1057  Identity: LongBool;{ TRUE, FALSE }
1058  end;
1059 
1060 type
1061  DBTYPEINFO = packed record
1062  Precision: DBINT;
1063  Scale: DBINT;
1064  end;
1065  PDBTYPEINFO = ^DBTYPEINFO;
1066 
1067  DBPROC_INFO = packed record
1068  SizeOfStruct: DBINT;
1069  ServerType: Byte;
1070  ServerMajor: Word;
1071  ServerMinor: Word;
1072  ServerRevision: Word;
1073  ServerName: array[0..MAXSERVERNAME] of AnsiChar;
1074  NetLibName: array[0..MAXNETLIBNAME] of AnsiChar;
1075  NetLibConnStr: array[0..MAXNETLIBCONNSTR] of AnsiChar;
1076  end;
1077  PDBPROCINFO = ^DBPROC_INFO;
1078 
1079  DBCURSOR_INFO = packed record
1080  SizeOfStruct: DBINT; { Use sizeof(DBCURSORINFO) }
1081  TotCols: Cardinal; { Total Columns in cursor }
1082  TotRows: Cardinal; { Total Rows in cursor }
1083  CurRow: Cardinal; { Current actual row in server }
1084  TotRowsFetched: Cardinal; { Total rows actually fetched }
1085  CurType: Cardinal; { See CU_... }
1086  Status: Cardinal; { See CU_... }
1087  end;
1088  PDBCURSORINFO = ^DBCURSOR_INFO;
1089 
1090 type
1091 { Pointer Datatypes }
1092  PDBINT = ^DBINT;
1093  PDBBINARY = ^DBBINARY;
1094 
1095 type
1096  PDBLibError = ^TDBLibError;
1097  TDBLibError = record
1098  dbProc: PDBPROCESS;
1099  Severity: DBINT;
1100  DbErr: DBINT;
1101  OsErr: DBINT;
1102  DbErrStr: AnsiString;
1103  OsErrStr: AnsiString;
1104  end;
1105 
1106  PDBLibMessage = ^TDBLibMessage;
1107  TDBLibMessage = record
1108  dbProc: PDBPROCESS;
1109  MsgNo: DBINT;
1110  MsgState: DBINT;
1111  Severity: DBINT;
1112  MsgText: AnsiString;
1113  SrvName: AnsiString;
1114  ProcName: AnsiString;
1115  Line: DBUSMALLINT;
1116  end;
1117 
1118 type
1119  TDBVariables = record
1120  dboptions: array[0..44] of ShortInt;
1121  dbSetLoginRec: array[0..16] of ShortInt;
1122  datatypes: array[0..22] of Integer;
1123  End;
1124 
1125 {common FreeTDS(dblib.dll) and ntwdblib.dll definitions
1126  requirements: the sam call convention }
1127  DBERRHANDLE_PROC = function(Proc: PDBPROCESS; Severity, DbErr, OsErr: Integer;
1128  DbErrStr, OsErrStr: PAnsiChar): Integer; cdecl;
1129  DBMSGHANDLE_PROC = function(Proc: PDBPROCESS; MsgNo: DBINT; MsgState,
1130  Severity: Integer; MsgText, SrvName, ProcName: PAnsiChar; Line: DBUSMALLINT):
1131  Integer; cdecl;
1132  Tdberrhandle = function(Handler: DBERRHANDLE_PROC): DBERRHANDLE_PROC; cdecl;
1133  Tdbmsghandle = function(Handler: DBMSGHANDLE_PROC): DBMSGHANDLE_PROC; cdecl;
1134 
1135  Tdbprocerrhandle = function(DbHandle: PDBHANDLE; Handler: DBERRHANDLE_PROC):
1136  DBERRHANDLE_PROC; cdecl;
1137  Tdbprocmsghandle = function(DbHandle: PDBHANDLE; Handler: DBMSGHANDLE_PROC):
1138  DBMSGHANDLE_PROC; cdecl;
1139 
1140  Tdbadata = function(Proc: PDBPROCESS; ComputeId, Column: Integer): PByte; cdecl;
1141  Tdbadlen = function(Proc: PDBPROCESS; ComputeId, Column: Integer): DBINT; cdecl;
1142  Tdbaltbind = function(Proc: PDBPROCESS; ComputeId, Column, VarType: Integer;
1143  VarLen: DBINT; VarAddr: PByte): RETCODE; cdecl;
1144  Tdbaltcolid = function(Proc: PDBPROCESS; ComputeId, Column: Integer): Integer; cdecl;
1145  Tdbaltlen = function(Proc: PDBPROCESS; ComputeId, Column: Integer): DBINT; cdecl;
1146  Tdbaltop = function(Proc: PDBPROCESS; ComputeId, Column: Integer): Integer; cdecl;
1147  Tdbalttype = function(Proc: PDBPROCESS; ComputeId, Column: Integer): Integer; cdecl;
1148  Tdbaltutype = function(Proc: PDBPROCESS; ComputeId, Column: Integer): DBINT; cdecl;
1149  Tdbanullbind = function(Proc: PDBPROCESS; ComputeId, Column: Integer;
1150  Indicator: PDBINT): RETCODE; cdecl;
1151  Tdbbind = function(Proc: PDBPROCESS; Column, VarType, VarLen: Integer;
1152  VarAddr: PByte): RETCODE; cdecl;
1153  Tdbbylist = function(Proc: PDBPROCESS; ComputeId: Integer; Size: PInteger):
1154  PByte; cdecl;
1155  Tdbcancel = function(Proc: PDBPROCESS): RETCODE; cdecl;
1156  Tdbcanquery = function(Proc: PDBPROCESS): RETCODE; cdecl;
1157  Tdbchange = function(Proc: PDBPROCESS): PAnsiChar; cdecl;
1158  Tdbclrbuf = procedure(Proc: PDBPROCESS; N: DBINT); cdecl;
1159  Tdbclropt = function(Proc: PDBPROCESS; Option: Integer; Param: PAnsiChar): RETCODE; cdecl;
1160  Tdbcmd = function(Proc: PDBPROCESS; Cmd: PAnsiChar): RETCODE; cdecl;
1161  Tdbcmdrow = function(Proc: PDBPROCESS): RETCODE; cdecl;
1162  Tdbcollen = function(Proc: PDBPROCESS; Column: Integer): DBINT; cdecl;
1163  Tdbcolname = function(Proc: PDBPROCESS; Column: Integer): PAnsiChar; cdecl;
1164  Tdbcolsource = function(Proc: PDBPROCESS; Column: Integer): PAnsiChar; cdecl;
1165  Tdbcoltype = function(Proc: PDBPROCESS; Column: Integer): Integer; cdecl;
1166  Tdbcolutype = function(Proc: PDBPROCESS; Column: Integer): DBINT; cdecl;
1167  Tdbconvert = function(Proc: PDBPROCESS; SrcType: Integer; Src: PByte;
1168  SrcLen: DBINT; DestType: Integer; Dest: PByte; DestLen: DBINT): Integer; cdecl;
1169  Tdbiscount = function(Proc: PDBPROCESS): LongBool; cdecl;
1170  Tdbcurcmd = function(Proc: PDBPROCESS): Integer; cdecl;
1171  Tdbcurrow = function(Proc: PDBPROCESS): DBINT; cdecl;
1172  Tdbdata = function(Proc: PDBPROCESS; Column: Integer): PByte; cdecl;
1173  Tdbcursor = function(hCursor: PDBCURSOR; OpType, Row: DBINT; Table, Values: PAnsiChar): RETCODE; cdecl;
1174  Tdbexit = procedure; cdecl;
1175  Tdbfcmd = function(Proc: PDBPROCESS; CmdString: PAnsiChar; var Params): RETCODE; cdecl;
1176  Tdbfirstrow = function(Proc: PDBPROCESS): DBINT; cdecl;
1177  Tdbfreebuf = procedure(Proc: PDBPROCESS); cdecl;
1178  Tdbfreequal = procedure(Ptr: PAnsiChar); cdecl;
1179  Tdbgetchar = function(Proc: PDBPROCESS; N: Integer): PAnsiChar; cdecl;
1180  Tdbgetoff = function(Proc: PDBPROCESS; OffType: DBUSMALLINT; StartFrom: Integer): Integer; cdecl;
1181  Tdbgetrow = function(Proc: PDBPROCESS; Row: DBINT): STATUS; cdecl;
1182  Tdbgettime = function: Integer; cdecl;
1183  Tdblastrow = function(Proc: PDBPROCESS): DBINT; cdecl;
1184  Tdblogin = function: PLOGINREC; cdecl;
1185  Tdbmorecmds = function(Proc: PDBPROCESS): RETCODE; cdecl;
1186  Tdbmoretext = function(Proc: PDBPROCESS; Size: DBINT; Text: PByte): RETCODE; cdecl;
1187  Tdbname = function(Proc: PDBPROCESS): PAnsiChar; cdecl;
1188  Tdbnextrow = function(Proc: PDBPROCESS): STATUS; cdecl;
1189  Tdbnullbind = function(Proc: PDBPROCESS; Column: Integer; Indicator: PDBINT):
1190  RETCODE; cdecl;
1191  Tdbnumalts = function(Proc: PDBPROCESS; ComputeId: Integer): Integer; cdecl;
1192  Tdbnumcols = function(Proc: PDBPROCESS): Integer; cdecl;
1193  Tdbnumcompute = function(Proc: PDBPROCESS): Integer; cdecl;
1194  Tdbnumorders = function(Proc: PDBPROCESS): Integer; cdecl;
1195  Tdbnumrets = function(Proc: PDBPROCESS): Integer; cdecl;
1196  Tdbopen = function(Login: PLOGINREC; Host: PAnsiChar): PDBPROCESS; cdecl;
1197  Tdbprhead = procedure(Proc: PDBPROCESS); cdecl;
1198  Tdbprrow = function(Proc: PDBPROCESS): RETCODE; cdecl;
1199  Tdbprtype = function(Token: Integer): PAnsiChar; cdecl;
1200  Tdbqual = function(Proc: PDBPROCESS; TabNum: Integer; TabName: PAnsiChar): PAnsiChar; cdecl;
1201  Tdbordercol = function(Proc: PDBPROCESS; Order: Integer): Integer; cdecl;
1202  Tdbreadtext = function(dbproc: PDBPROCESS; Buf: Pointer; BufSize: DBINT): DBINT; cdecl;
1203  Tdbresults = function(dbproc: PDBPROCESS): RETCODE; cdecl;
1204  Tdbretdata = function(dbproc: PDBPROCESS; RetNum: Integer): PByte; cdecl;
1205  Tdbretlen = function(dbproc: PDBPROCESS; RetNum: Integer): DBINT; cdecl;
1206  Tdbretname = function(Proc: PDBPROCESS; RetNum: Integer): PAnsiChar; cdecl;
1207  Tdbretstatus = function(Proc: PDBPROCESS): DBINT; cdecl;
1208  Tdbrettype = function(Proc: PDBPROCESS; RetNum: Integer): Integer; cdecl;
1209  Tdbrows = function(Proc: PDBPROCESS): RETCODE; cdecl; //!!!
1210  Tdbrowtype = function(Proc: PDBPROCESS): STATUS; cdecl;
1211  Tdbrpcinit = function(Proc: PDBPROCESS; ProcName: PAnsiChar; Options: DBSMALLINT):
1212  RETCODE; cdecl; //!!!
1213  Tdbrpcparam = function(Proc: PDBPROCESS; ParamName: PAnsiChar; Status: Byte;
1214  Typ: Integer; MaxLen, DataLen: DBINT; Value: PByte): RETCODE; cdecl;
1215  Tdbrpcsend = function(Proc: PDBPROCESS): RETCODE; cdecl;
1216  Tdbrpwclr = procedure(Login: PLOGINREC); cdecl;
1217  Tdbsetavail = procedure(Proc: PDBPROCESS); cdecl;
1218  Tdbsetlogintime = function(Seconds: Integer): RETCODE; cdecl;
1219  Tdbsetnull = function(Proc: PDBPROCESS; BindType, BindLen: Integer;
1220  BindVal: PByte): RETCODE; cdecl;
1221  Tdbsettime = function(Seconds: Integer): RETCODE; cdecl;
1222  Tdbsetuserdata = procedure(Proc: PDBPROCESS; Ptr: Pointer); cdecl;
1223  Tdbsqlexec = function(Proc: PDBPROCESS): RETCODE; cdecl;
1224  Tdbsqlok = function(Proc: PDBPROCESS): RETCODE; cdecl;
1225  Tdbsqlsend = function(Proc: PDBPROCESS): RETCODE; cdecl;
1226  Tdbstrcpy = function(Proc: PDBPROCESS; Start, NumBytes: Integer; Dest: PAnsiChar):
1227  RETCODE; cdecl;
1228  Tdbstrlen = function(Proc: PDBPROCESS): Integer; cdecl;
1229  Tdbtabcount = function(Proc: PDBPROCESS): Integer; cdecl;
1230  Tdbtabname = function(Proc: PDBPROCESS; Table: Integer): PAnsiChar; cdecl;
1231  Tdbtabsource = function(Proc: PDBPROCESS; Column: Integer; TabNum: PInteger):
1232  PAnsiChar; cdecl;
1233  Tdbtsnewlen = function(Proc: PDBPROCESS): Integer; cdecl;
1234  Tdbtsnewval = function(Proc: PDBPROCESS): PDBBINARY; cdecl;
1235  Tdbtsput = function(Proc: PDBPROCESS; NewTs: PDBBINARY; NewTsLen,
1236  TabNum: Integer; TableName: PAnsiChar): RETCODE; cdecl;
1237  Tdbtxptr = function(Proc: PDBPROCESS; Column: Integer): PDBBINARY; cdecl;
1238  Tdbtxtimestamp = function(Proc: PDBPROCESS; Column: Integer): PDBBINARY; cdecl;
1239  Tdbtxtsnewval = function(Proc: PDBPROCESS): PDBBINARY; cdecl;
1240  Tdbtxtsput = function(Proc: PDBPROCESS; NewTxts: PDBBINARY; Column: Integer):
1241  RETCODE; cdecl;
1242  Tdbuse = function(Proc: PDBPROCESS; DbName: PAnsiChar): RETCODE; cdecl;
1243  Tdbwritetext = function(Proc: PDBPROCESS; ObjName: PAnsiChar; TextPtr: PDBBINARY;
1244  TextPtrLen: DBTINYINT; Timestamp: PDBBINARY; Log: LongBool; Size: DBINT;
1245  Text: PByte): RETCODE; cdecl;
1246  (* LOGINREC manipulation *)
1247  Tdbsetlname = function(Login: PLOGINREC; Value: PAnsiChar; Item: Integer): RETCODE; cdecl;
1248 { BCP functions }
1249  Tbcp_batch = function(Proc: PDBPROCESS): DBINT; cdecl;
1250  Tbcp_bind = function(Proc: PDBPROCESS; VarAddr: PByte; PrefixLen: Integer;
1251  VarLen: DBINT; Terminator: PByte; TermLen, Typ, TableColumn: Integer):
1252  RETCODE; cdecl;
1253  Tbcp_colfmt = function(Proc: PDBPROCESS; FileColumn: Integer; FileType: Byte;
1254  FilePrefixLen: Integer; FileColLen: DBINT; FileTerm: PByte; FileTermLen,
1255  TableColumn: Integer): RETCODE; cdecl;
1256  Tbcp_collen = function(Proc: PDBPROCESS; VarLen: DBINT; TableColumn: Integer):
1257  RETCODE; cdecl;
1258  Tbcp_colptr = function(Proc: PDBPROCESS; ColPtr: PByte; TableColumn: Integer):
1259  RETCODE; cdecl;
1260  Tbcp_columns = function(Proc: PDBPROCESS; FileColCount: Integer): RETCODE; cdecl;
1261  Tbcp_control = function(Proc: PDBPROCESS; Field: Integer; Value: DBINT):
1262  RETCODE; cdecl;
1263  Tbcp_done = function(Proc: PDBPROCESS): DBINT; cdecl;
1264  Tbcp_exec = function(Proc: PDBPROCESS; RowsCopied: PDBINT): RETCODE; cdecl;
1265  Tbcp_init = function(Proc: PDBPROCESS; TableName, hFile, ErrFile: PAnsiChar;
1266  Direction: Integer): RETCODE; cdecl;
1267  Tbcp_moretext = function(Proc: PDBPROCESS; Size: DBINT; Text: PByte):
1268  RETCODE; cdecl;
1269  Tbcp_readfmt = function(Proc: PDBPROCESS; FileName: PAnsiChar): RETCODE; cdecl;
1270  Tbcp_sendrow = function(Proc: PDBPROCESS): RETCODE; cdecl;
1271  Tbcp_setl = function(Login: PLOGINREC; Enable: LongBool): RETCODE; cdecl;
1272  Tbcp_writefmt = function(Proc: PDBPROCESS; FileName: PAnsiChar): RETCODE; cdecl;
1273  { Two-phase commit functions }
1274  Tabort_xact = function(Proc: PDBPROCESS; CommId: DBINT): RETCODE; cdecl;
1275  Tbuild_xact_string = procedure(XActName, Service: PAnsiChar; CommId: DBINT;
1276  Result: PAnsiChar); cdecl;
1277  Tclose_commit = procedure(Proc: PDBPROCESS); cdecl;
1278  Tcommit_xact = function(Proc: PDBPROCESS; CommId: DBINT): RETCODE; cdecl;
1279  Topen_commit = function(Login: PLOGINREC; ServerName: PAnsiChar): PDBPROCESS; cdecl;
1280  Tremove_xact = function(Proc: PDBPROCESS; CommId: DBINT; SiteCount: Integer):
1281  RETCODE; cdecl;
1282  Tscan_xact = function(Proc: PDBPROCESS; CommId: DBINT): RETCODE; cdecl;
1283  Tstart_xact = function(Proc: PDBPROCESS; AppName, XActName: PAnsiChar;
1284  SiteCount: Integer): DBINT; cdecl;
1285  Tstat_xact = function(Proc: PDBPROCESS; CommId: DBINT): Integer; cdecl;
1286 
1287 
1288 
1289 {FreeTDS spezial API definitions}
1290  TFreeTDSdb12hour = function(Proc: PDBPROCESS; Language: PAnsiChar): DBBOOL; cdecl;
1291  TFreeTDSdbcolbrowse = function(Proc: PDBPROCESS; Column: Integer): DBBOOL; cdecl;
1292  TFreeTDSdbcursorbind = function(hCursor: PDBCURSOR; Col, VarType: Integer; VarLen, POutLen: DBINT;
1293  VarAddr: PByte; DBTYPEINFO: PDBTYPEINFO): RETCODE; cdecl;
1294  TFreeTDSdbcursorclose = procedure(DbHandle: PDBHANDLE); cdecl;
1295  TFreeTDSdbcursorcolinfo = function(hCursor: PDBCURSOR; Column: DBINT; ColName: PAnsiChar;
1296  ColType, ColLen, UserType: PDBINT): RETCODE; cdecl;
1297  TFreeTDSdbcursorfetch = function(hCursor: PDBCURSOR; FetchType, RowNum: DBINT): RETCODE; cdecl;
1298  TFreeTDSdbcursorinfo = function(hCursor: PDBCURSOR; nCols, nRows: PDBINT): RETCODE; cdecl;
1299  TFreeTDSdbcursoropen = function(Proc: PDBPROCESS; Sql: PAnsiChar; ScrollOpt,
1300  ConCurOpt: DBSHORT; nRows: DBUSMALLINT; PStatus: PDBINT): PDBCURSOR; cdecl;
1301 
1302  TFreeTDSdbaltbind_ps = function(dbproc: PDBPROCESS; ComputeId, Column: Integer; VarType: Integer; VarLen: DBINT; VarAddr: PByte; typinfo: PDBTYPEINFO): RETCODE;
1303  TFreeTDSdbbind_ps = function(dbproc: PDBPROCESS; Column, VarType, VarLen: Integer; VarAddr: PByte; typinfo: PDBTYPEINFO): RETCODE; cdecl;
1304  TFreeTDSdbbufsize = function(dbproc: PDBPROCESS): Integer; cdecl;
1305  TFreeTDSdbclose = procedure(dbproc: PDBPROCESS); cdecl;
1306  TFreeTDSdbtablecolinfo = function(dbproc: PDBPROCESS; Column: DBINT; DbColumn: PTDSDBCOL): RETCODE;
1307  TFreeTDSdbcolinfo = function(Handle: PDBHANDLE; Typ, Column, ComputeId: Integer; DbColumn: PTDSDBCOL): RETCODE; cdecl;
1308  TFreeTDSdbconvert_ps = function(dbproc: PDBPROCESS; SrcType: Integer; Src: PByte; SrcLen: DBINT; DestType: Integer; Dest: PByte; DestLen: DBINT; typinfo: PDBTYPEINFO): Integer; cdecl;
1309  TFreeTDSdbcount = function(dbproc: PDBPROCESS): DBINT; cdecl;
1310  TFreeTDSdbdatecmp = function(dbproc: PDBPROCESS; d1, d2: PTDS_DBDATEREC): Integer;
1311  TFreeTDSdbdatecrack = function(dbproc: PDBPROCESS; DateInfo: PTDS_DBDATEREC; DateType: PTDSDBDATETIME): RETCODE; cdecl;
1312  TFreeTDSdbdatlen = function(dbproc: PDBPROCESS; Column: Integer): DBINT; cdecl;
1313  TFreeTDSdbdead = function(dbproc: PDBPROCESS): DBBOOL; cdecl;
1314  TFreeTDSdbgetcharset = function(dbproc: PDBPROCESS): PAnsiChar;
1315  TFreeTDSdbgetlusername = function(login: PLOGINREC; name_buffer: PByte; buffer_len: Integer): Integer; cdecl;
1316  TFreeTDSdbgetmaxprocs = function: Integer; cdecl;
1317  TFreeTDSdbgetnatlanf = function(dbproc: PDBPROCESS): PAnsiChar; cdecl;
1318  TFreeTDSdbgetpacket = function(dbproc: PDBPROCESS): Integer; cdecl;
1319  TFreeTDSdbgetuserdata = function(dbproc: PDBPROCESS): PByte; cdecl;
1320  TFreeTDSdbhasretstat = function(dbproc: PDBPROCESS): DBBOOL; cdecl;
1321  TFreeTDSdbinit = function:RETCODE; cdecl;
1322  TFreeTDSdbiordesc = function(dbproc: PDBPROCESS): Integer; cdecl;
1323  TFreeTDSdbiowdesc = function(dbproc: PDBPROCESS): Integer; cdecl;
1324  TFreeTDSdbisavail = function(Proc: PDBPROCESS): DBBOOL; cdecl;
1325  TFreeTDSdbisopt = function(Proc: PDBPROCESS; Option: Integer; const Param: PAnsiChar): DBBOOL; cdecl;
1326  TFreeTDSdbloginfree = procedure(Login: PLOGINREC); cdecl;
1327  TFreeTDSdbmny4cmp = function(dbproc: PDBPROCESS; m1, m: PDBMONEY4): Integer; cdecl;
1328  TFreeTDSdbmnycmp = function(dbproc: PDBPROCESS; m1, m2: PDBMONEY): Integer; cdecl;
1329  TFreeTDSdbmny4add = function(dbproc: PDBPROCESS; m1, m2, sum: PDBMONEY4): RETCODE; cdecl;
1330  TFreeTDSdbmnydec = function(dbproc: PDBPROCESS; mnyptr: PDBMONEY): RETCODE; cdecl;
1331  TFreeTDSdbmnyinc = function(dbproc: PDBPROCESS; mnyptr: PDBMONEY): RETCODE; cdecl;
1332  TFreeTDSdbmnymaxpos = function(dbproc: PDBPROCESS; dest: PDBMONEY): RETCODE; cdecl;
1333  TFreeTDSdbmnymaxneg = function(dbproc: PDBPROCESS; dest: PDBMONEY): RETCODE; cdecl;
1334  TFreeTDSdbmny4minus = function(dbproc: PDBPROCESS; src, dest: PDBMONEY): RETCODE; cdecl;
1335  TFreeTDSdbmnyminus = function(dbproc: PDBPROCESS; src, dest: PDBMONEY): RETCODE; cdecl;
1336  TFreeTDSdbmny4sub = function(dbproc: PDBPROCESS; m1, m2, diff: PDBMONEY4): RETCODE; cdecl;
1337  TFreeTDSdbmnysub = function(dbproc: PDBPROCESS; m1, m2, diff: PDBMONEY): RETCODE; cdecl;
1338  TFreeTDSdbmny4copy = function(dbproc: PDBPROCESS; m1, m2: PDBMONEY4): RETCODE; cdecl;
1339  TFreeTDSdbmnycopy = function(dbproc: PDBPROCESS; src, dest: PDBMONEY): RETCODE; cdecl;
1340  TFreeTDSdbmny4zero = function(dbproc: PDBPROCESS; dest: PDBMONEY4): RETCODE; cdecl;
1341  TFreeTDSdbmnyzero = function(dbproc: PDBPROCESS; dest: PDBMONEY4): RETCODE; cdecl;
1342  TFreeTDSdbmonthname = function(dbproc: PDBPROCESS; language: PAnsiChar; monthnum: Integer; shortform: DBBOOL): PAnsiChar; cdecl;
1343  TFreeTDSdbopen = function(Login: PLOGINREC; const Server: PAnsiChar; msdblib: Integer): PDBPROCESS; cdecl;
1344  TFreeTDSdbrecftos = procedure(const FileName: PAnsiChar);
1345  TDRBUF = function(dbproc: PDBPROCESS): DBBOOL; cdecl;
1346  TFreeTDSdbresults_r = function(dbproc: PDBPROCESS; Recursive: Integer): RETCODE; cdecl;
1347  TFreeTDSdbsafestr = function(dbproc: PDBPROCESS; const Src: PAnsiChar; SrcLen: DBINT; Dest: PAnsiChar; DestLen: DBINT; QuoteType: integer): RETCODE; cdecl;
1348  TFreeTDSdbservcharset = function(dbproc: PDBPROCESS): PAnsiChar; cdecl;
1349  TFreeTDSdbsetdefcharset = function(Charset: PAnsiChar): RETCODE; cdecl;
1350  TFreeTDSdbsetifile = procedure(FileName: PAnsiChar); cdecl;
1351  TFreeTDSdbsetmaxprocs = function(MaxProcs: Integer): RETCODE; cdecl;
1352  TFreeTDSdbsetopt = function(dbproc: PDBPROCESS; Option: DBINT; Param: PAnsiChar; int_param: DBINT): RETCODE; cdecl;
1353  TFreeTDSdbsetrow = function(dbproc: PDBPROCESS; Row: DBINT): STATUS; cdecl;
1354  TFreeTDSdbsetversion = function(Version: DBINT): RETCODE; cdecl;
1355  TFreeTDSdbspid = function(dbproc: PDBPROCESS): Integer; cdecl;
1356  TFreeTDSdbspr1row = function(dbproc: PDBPROCESS; Buffer: PAnsiChar; buf_len: DBINT): RETCODE; cdecl;
1357  TFreeTDSdbspr1rowlen = function(dbproc: PDBPROCESS): DBINT; cdecl;
1358  TFreeTDSdbsprhead = function(dbproc: PDBPROCESS; Buffer: PAnsiChar; buf_len: DBINT): RETCODE; cdecl;
1359  TFreeTDSdbsprline = function(dbproc: PDBPROCESS; Buffer: PAnsiChar; buf_len: DBINT; line_char: DBCHAR): RETCODE; cdecl;
1360  TFreeTDSdbvarylen = function(dbproc: PDBPROCESS; Column: Integer): DBINT; cdecl;
1361  TFreeTDSdbtds = function(dbproc: PDBPROCESS): DBINT; cdecl;
1362  TFreeTDSdbtextsize = function(dbproc: PDBPROCESS): DBINT; cdecl;
1363  TFreeTDSdbwillconvert = function(SrcType, DestType: Integer): DBBOOL; cdecl;
1364  TFreeTDSdbtabbrowse = function(Proc: PDBPROCESS; TabNum: Integer): LongBool; cdecl;
1365  (* LOGINREC manipulation *)
1366  TFreeTDSdbsetlbool = function(Login: PLOGINREC; Value, Item: Integer): RETCODE; cdecl;
1367  TFreeTDSdbsetllong = function(Login: PLOGINREC; Value, Item: Integer): RETCODE; cdecl;
1368  TFreeTDSdbsetlversion = function(Login: PLOGINREC; Version: Byte): RETCODE; cdecl;
1369  Ttdsdump_on = procedure ; cdecl;
1370  Ttdsdump_off = procedure ; cdecl;
1371  Ttdsdump_open = function (FileName : PAnsiChar): Integer; cdecl;
1372  Ttdsdump_close = procedure ; cdecl;
1373  T_tds_socket_init = procedure ; cdecl;
1374  T_tds_socket_done = procedure ; cdecl;
1375 
1376 
1377 { pivot functions
1378 void dbpivot_count (struct col_t *output, const struct col_t *input);
1379 void dbpivot_sum (struct col_t *output, const struct col_t *input);
1380 void dbpivot_min (struct col_t *output, const struct col_t *input);
1381 void dbpivot_max (struct col_t *output, const struct col_t *input);
1382 
1383 struct pivot_t;
1384 typedef void (*DBPIVOT_FUNC)(struct col_t *output, const struct col_t *input);
1385 struct pivot_t * dbrows_pivoted(DBPROCESS *dbproc);
1386 STATUS dbnextrow_pivoted(DBPROCESS *dbproc, struct pivot_t *pp);
1387 RETCODE dbpivot(DBPROCESS *dbproc, int nkeys, int *keys, int ncols, int *cols, DBPIVOT_FUNC func, int val);
1388 
1389 DBPIVOT_FUNC dbpivot_lookup_name( const char name[] );
1390 }
1391  //TFreeTDSdbsechandle = function(_Type: DBINT ; Handler: INTFUNCPTR): PRETCODE; cdecl;
1392  //TFreeTDSdbsetbusy = procedure(dbproc: PDBPROCESS; BusyFunc: DB_DBBUSY_FUNC); cdecl;
1393  //TFreeTDSdbsetinterrupt = procedure(dbproc: PDBPROCESS; chkintr: DB_DBCHKINTR_FUNC; hndlintr: DB_DBHNDLINTR_FUNC);
1394 
1395 
1396 
1397 {MsSQL-spezial API definitions}
1398 
1399 { Standard DB-Library functions }
1400  TMsSQLdbclose = function(Proc: PDBPROCESS): RETCODE; cdecl;
1401  TMsSQLdbcolbrowse = function(Proc: PDBPROCESS; Column: Integer): LongBool; cdecl;
1402  TMsSQLdbcolinfo = function(Handle: PDBHANDLE; Typ, Column, ComputeId: Integer;
1403  DbColumn: PDBCOL): RETCODE; cdecl;
1404  TMsSQLdbcount = function(Proc: PDBPROCESS): Integer; cdecl;
1405 
1406  TMsSQLdbcursorbind = function(hCursor: PDBCURSOR; Col, VarType: Integer; VarLen: DBINT;
1407  POutLen: PDBINT; VarAddr: PByte): RETCODE; cdecl;
1408  TMsSQLdbcursorclose = function(DbHandle: PDBHANDLE): RETCODE; cdecl;
1409  TMsSQLdbcursorcolinfo = function(hCursor: PDBCURSOR; Column: Integer; ColName: PAnsiChar;
1410  ColType: PInteger; ColLen: PDBINT; UserType: PInteger): RETCODE; cdecl;
1411  TMsSQLdbcursorfetch = function(hCursor: PDBCURSOR; FetchType, RowNum: Integer): RETCODE; cdecl;
1412  TMsSQLdbcursorfetchex = function(hCursor: PDBCURSOR; FetchType: Integer; RowNum,
1413  nFetchRows, Reserved: DBINT): RETCODE; cdecl;
1414  TMsSQLdbcursorinfo = function(hCursor: PDBCURSOR; nCols: PInteger; nRows: PDBINT):
1415  RETCODE; cdecl;
1416  TMsSQLdbcursorinfoex = function(hCursor: PDBCURSOR; DbCursorInfo: PDBCURSORINFO):
1417  RETCODE; cdecl;
1418  TMsSQLdbcursoropen = function(Proc: PDBPROCESS; Sql: PAnsiChar; ScrollOpt,
1419  ConCurOpt: Integer; nRows: Cardinal; PStatus: PDBINT): PDBCURSOR; cdecl;
1420  TMsSQLdbdataready = function(Proc: PDBPROCESS): LongBool; cdecl;
1421  TMsSQLdbdatecrack = function(Proc: PDBPROCESS; DateInfo: PDBDATEREC;
1422  DateType: PDBDATETIME): RETCODE; cdecl;
1423  TMsSQLdbdatlen = function(Proc: PDBPROCESS; Column: Integer): Integer; cdecl;
1424  TMsSQLdbdead = function(Proc: PDBPROCESS): LongBool; cdecl;
1425  TMsSQLdbWinexit = procedure; cdecl;
1426  TMsSQLdbenlisttrans = function(Proc: PDBPROCESS; Transaction: Pointer): RETCODE; cdecl;
1427  TMsSQLdbenlistxatrans = function(Proc: PDBPROCESS; EnlistTran: LongBool): RETCODE; cdecl;
1428  TMsSQLdbgetmaxprocs = function: SmallInt; cdecl;
1429  TMsSQLdbgetpacket = function(Proc: PDBPROCESS): Cardinal; cdecl;
1430  TMsSQLdbgetuserdata = function(Proc: PDBPROCESS): Pointer; cdecl;
1431  TMsSQLdbhasretstat = function(Proc: PDBPROCESS): LongBool; cdecl;
1432  TMsSQLdbinit = function: PAnsiChar; cdecl;
1433  TMsSQLdbisavail = function(Proc: PDBPROCESS): LongBool; cdecl;
1434  TMsSQLdbisopt = function(Proc: PDBPROCESS; Option: Integer; Param: PAnsiChar): LongBool; cdecl;
1435  TMsSQLdbfreelogin = procedure(Login: PLOGINREC); cdecl;
1436  TMsSQLdbprocinfo = function(Proc: PDBPROCESS; DbProcInfo: PDBPROCINFO): RETCODE; cdecl;
1437  TMsSQLdbrpcexec = function(Proc: PDBPROCESS): RETCODE; cdecl;
1438  TMsSQLdbserverenum = function(SearchMode: Word; ServNameBuf: PAnsiChar;
1439  ServNameBufSize: Word; NumEntries: PWord): Integer; cdecl;
1440  TMsSQLdbsetmaxprocs = function(MaxProcs: SmallInt): RETCODE; cdecl;
1441  TMsSQLdbsetlpacket = function(Login: PLOGINREC; PacketSize: Word): RETCODE; cdecl; //TDS: dbsetllong
1442  TMsSQLdbsetopt = function(Proc: PDBPROCESS; Option: Integer; Param: PAnsiChar):
1443  RETCODE; cdecl;
1444  TMsSQLdbtabbrowse = function(Proc: PDBPROCESS; TabNum: Integer): LongBool; cdecl;
1445 
1446  TMsSQLdbvarylen = function(Proc: PDBPROCESS; Column: Integer): LongBool; cdecl;
1447  TMsSQLdbwillconvert = function(SrcType, DestType: Integer): LongBool; cdecl;
1448  TMsSQLdbupdatetext = function(Proc: PDBPROCESS; DestObject: PAnsiChar; DestTextPtr,
1449  DestTimestamp: PDBBINARY; UpdateType: Integer; InsertOffset,
1450  DeleteLength: DBINT; SrcObject: PAnsiChar; SrcSize: DBINT; SrcText: PDBBINARY):
1451  RETCODE; cdecl;
1452 
1453 {************* Plain API Function variables definition ************}
1454 
1455 {Sybase API definitions}
1456 type
1457  SYBDBERRHANDLE_PROC = function(Proc: PDBPROCESS; Severity, DbErr, OsErr: Integer;
1458  DbErrStr, OsErrStr: PAnsiChar): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1459  SYBDBMSGHANDLE_PROC = function(Proc: PDBPROCESS; MsgNo: DBINT; MsgState,
1460  Severity: Integer; MsgText, SrvName, ProcName: PAnsiChar; Line: DBUSMALLINT):
1461  Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1462 
1463  TSybdb12hour = function(Proc: PDBPROCESS; Language: PAnsiChar): DBBOOL; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1464 
1465  TSybdberrhandle = function(Handler: SYBDBERRHANDLE_PROC): SYBDBERRHANDLE_PROC; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1466  TSybdbmsghandle = function(Handler: SYBDBMSGHANDLE_PROC): SYBDBMSGHANDLE_PROC; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1467 
1468  { Two-phase commit functions }
1469  TSybabort_xact = function(Proc: PDBPROCESS; CommId: DBINT): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1470  TSybbuild_xact_string = procedure(XActName, Service: PAnsiChar; CommId: DBINT;
1471  Result: PAnsiChar); {$IFNDEF UNIX}stdcall{$ELSE}cdecl{$ENDIF};
1472  TSybclose_commit = procedure(Proc: PDBPROCESS); {$IFNDEF UNIX}stdcall{$ELSE}cdecl{$ENDIF};
1473  TSybcommit_xact = function(Proc: PDBPROCESS; CommId: DBINT): RETCODE; {$IFNDEF UNIX}stdcall{$ELSE}cdecl{$ENDIF};
1474  TSybopen_commit = function(Login: PLOGINREC; ServerName: PAnsiChar): PDBPROCESS; {$IFNDEF UNIX}stdcall{$ELSE}cdecl{$ENDIF};
1475  TSybremove_xact = function(Proc: PDBPROCESS; CommId: DBINT; SiteCount: Integer): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1476  TSybscan_xact = function(Proc: PDBPROCESS; CommId: DBINT): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1477  TSybstart_xact = function(Proc: PDBPROCESS; AppName, XActName: PAnsiChar;
1478  SiteCount: Integer): DBINT; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1479  TSybstat_xact = function(Proc: PDBPROCESS; CommId: DBINT): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1480 
1481 { BCP functions }
1482  TSybbcp_batch = function(Proc: PDBPROCESS): DBINT; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1483  TSybbcp_bind = function(Proc: PDBPROCESS; VarAddr: PByte; PrefixLen: Integer;
1484  VarLen: DBINT; Terminator: PByte; TermLen, Typ, TableColumn: Integer):
1485  RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1486  TSybbcp_colfmt = function(Proc: PDBPROCESS; FileColumn: Integer; FileType: Byte;
1487  FilePrefixLen: Integer; FileColLen: DBINT; FileTerm: PByte; FileTermLen,
1488  TableColumn: Integer): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1489  TSybbcp_collen = function(Proc: PDBPROCESS; VarLen: DBINT; TableColumn: Integer):
1490  RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1491  TSybbcp_colptr = function(Proc: PDBPROCESS; ColPtr: PByte; TableColumn: Integer):
1492  RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1493  TSybbcp_columns = function(Proc: PDBPROCESS; FileColCount: Integer): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1494  TSybbcp_control = function(Proc: PDBPROCESS; Field: Integer; Value: DBINT):
1495  RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1496  TSybbcp_done = function(Proc: PDBPROCESS): DBINT; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1497  TSybbcp_exec = function(Proc: PDBPROCESS; RowsCopied: PDBINT): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1498  TSybbcp_init = function(Proc: PDBPROCESS; TableName, hFile, ErrFile: PAnsiChar;
1499  Direction: Integer): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1500  TSybbcp_moretext = function(Proc: PDBPROCESS; Size: DBINT; Text: PByte):
1501  RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1502  TSybbcp_readfmt = function(Proc: PDBPROCESS; FileName: PAnsiChar): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1503  TSybbcp_sendrow = function(Proc: PDBPROCESS): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1504  TSybbcp_writefmt = function(Proc: PDBPROCESS; FileName: PAnsiChar): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1505 
1506 { Standard DB-Library functions }
1507  TSybdbadata = function(Proc: PDBPROCESS; ComputeId, Column: Integer): PByte; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1508  TSybdbadlen = function(Proc: PDBPROCESS; ComputeId, Column: Integer): DBINT; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1509  TSybdbaltbind = function(Proc: PDBPROCESS; ComputeId, Column: Integer;
1510  VarType: Integer; VarLen: DBINT; VarAddr: PByte): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1511  TSybdbaltcolid = function(Proc: PDBPROCESS; ComputeId, Column: Integer): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1512  TSybdbaltlen = function(Proc: PDBPROCESS; ComputeId, Column: Integer): DBINT; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1513  TSybdbaltop = function(Proc: PDBPROCESS; ComputeId, Column: Integer): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1514  TSybdbalttype = function(Proc: PDBPROCESS; ComputeId, Column: Integer): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1515  TSybdbaltutype = function(Proc: PDBPROCESS; ComputeId, Column: Integer): DBINT; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1516  TSybdbanullbind = function(Proc: PDBPROCESS; ComputeId, Column: Integer;
1517  Indicator: PDBINT): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1518  TSybdbbind = function(Proc: PDBPROCESS; Column, VarType, VarLen: Integer;
1519  VarAddr: PByte): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1520  TSybdbbylist = function(Proc: PDBPROCESS; ComputeId: Integer; Size: PInteger):
1521  PByte; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1522  TSybdbcancel = function(Proc: PDBPROCESS): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1523  TSybdbcanquery = function(Proc: PDBPROCESS): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1524  TSybdbchange = function(Proc: PDBPROCESS): PAnsiChar; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1525  TSybdbclose = function(Proc: PDBPROCESS): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1526  TSybdbclrbuf = procedure(Proc: PDBPROCESS; N: DBINT); {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1527  TSybdbclropt = function(Proc: PDBPROCESS; Option: Integer; Param: PAnsiChar): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1528  TSybdbcmd = function(Proc: PDBPROCESS; Cmd: PAnsiChar): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1529  TSybdbcmdrow = function(Proc: PDBPROCESS): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1530  TSybdbcolbrowse = function(Proc: PDBPROCESS; Column: Integer): LongBool; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1531  TSybdbcollen = function(Proc: PDBPROCESS; Column: Integer): DBINT; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1532  TSybdbcolname = function(Proc: PDBPROCESS; Column: Integer): PAnsiChar; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1533  TSybdbcolsource = function(Proc: PDBPROCESS; Column: Integer): PAnsiChar; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1534 // TSybdbcoltypeinfo = function(Proc: PDBPROCESS; Column: Integer): PDBTYPEINFO; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1535  TSybdbcoltype = function(Proc: PDBPROCESS; Column: Integer): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1536  TSybdbcolutype = function(Proc: PDBPROCESS; Column: Integer): DBINT; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1537  TSybdbconvert = function(Proc: PDBPROCESS; SrcType: Integer; Src: PByte;
1538  SrcLen: DBINT; DestType: Integer; Dest: PByte; DestLen: DBINT): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1539  TSybdbcount = function(Proc: PDBPROCESS): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1540  TSybdbcurcmd = function(Proc: PDBPROCESS): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1541  TSybdbcurrow = function(Proc: PDBPROCESS): DBINT; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1542 
1543  TSybdbcursor = function(hCursor: PDBCURSOR; OpType, Row: Integer; Table,
1544  Values: PAnsiChar): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1545  TSybdbcursorbind = function(hCursor: PDBCURSOR; Col, VarType: Integer; VarLen: DBINT;
1546  POutLen: PDBINT; VarAddr: PByte): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1547  TSybdbcursorclose = function(DbHandle: PDBHANDLE): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1548  TSybdbcursorcolinfo = function(hCursor: PDBCURSOR; Column: Integer; ColName: PAnsiChar;
1549  ColType: PInteger; ColLen: PDBINT; UserType: PInteger): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1550  TSybdbcursorfetch = function(hCursor: PDBCURSOR; FetchType, RowNum: Integer):
1551  RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1552  TSybdbcursorinfo = function(hCursor: PDBCURSOR; nCols: PInteger; nRows: PDBINT):
1553  RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1554  TSybdbcursoropen = function(Proc: PDBPROCESS; Sql: PAnsiChar; ScrollOpt,
1555  ConCurOpt: Integer; nRows: Cardinal; PStatus: PDBINT): PDBCURSOR; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1556  TSybdbdata = function(Proc: PDBPROCESS; Column: Integer): PByte; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1557  TSybdbdatecrack = function(Proc: PDBPROCESS; DateInfo: PDBDATEREC;
1558  DateType: PDBDATETIME): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1559  TSybdbdatlen = function(Proc: PDBPROCESS; Column: Integer): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1560  TSybdbdead = function(Proc: PDBPROCESS): LongBool; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1561  TSybdbexit = procedure; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1562  TSybdbfcmd = function(Proc: PDBPROCESS; CmdString: PAnsiChar; var Params): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1563  TSybdbfirstrow = function(Proc: PDBPROCESS): DBINT; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1564  TSybdbfreebuf = procedure(Proc: PDBPROCESS); {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1565  TSybdbloginfree = procedure(Login: PLOGINREC); {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1566  TSybdbfreequal = procedure(Ptr: PAnsiChar); {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1567  TSybdbgetchar = function(Proc: PDBPROCESS; N: Integer): PAnsiChar; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1568  TSybdbgetmaxprocs = function: SmallInt; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1569  TSybdbgetoff = function(Proc: PDBPROCESS; OffType: DBUSMALLINT;
1570  StartFrom: Integer): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1571  TSybdbgetpacket = function(Proc: PDBPROCESS): Cardinal; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1572  TSybdbgetrow = function(Proc: PDBPROCESS; Row: DBINT): STATUS; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1573  TSybdbgetuserdata = function(Proc: PDBPROCESS): Pointer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1574  TSybdbhasretstat = function(Proc: PDBPROCESS): LongBool; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1575  TSybdbinit = function: RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1576  TSybdbisavail = function(Proc: PDBPROCESS): LongBool; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1577  TSybdbisopt = function(Proc: PDBPROCESS; Option: Integer; Param: PAnsiChar): LongBool; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1578  TSybdblastrow = function(Proc: PDBPROCESS): DBINT; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1579  TSybdblogin = function: PLOGINREC; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1580  TSybdbmorecmds = function(Proc: PDBPROCESS): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1581  TSybdbmoretext = function(Proc: PDBPROCESS; Size: DBINT; Text: PByte): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1582  TSybdbname = function(Proc: PDBPROCESS): PAnsiChar; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1583  TSybdbnextrow = function(Proc: PDBPROCESS): STATUS; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1584  TSybdbnullbind = function(Proc: PDBPROCESS; Column: Integer; Indicator: PDBINT):
1585  RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1586  TSybdbnumalts = function(Proc: PDBPROCESS; ComputeId: Integer): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1587  TSybdbnumcols = function(Proc: PDBPROCESS): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1588  TSybdbnumcompute = function(Proc: PDBPROCESS): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1589  TSybdbnumorders = function(Proc: PDBPROCESS): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1590  TSybdbnumrets = function(Proc: PDBPROCESS): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1591  TSybdbopen = function(Login: PLOGINREC; Host: PAnsiChar): PDBPROCESS; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1592  TSybdbordercol = function(Proc: PDBPROCESS; Order: Integer): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1593  TSybdbprhead = procedure(Proc: PDBPROCESS); {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1594  TSybdbprrow = function(Proc: PDBPROCESS): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1595  TSybdbprtype = function(Token: Integer): PAnsiChar; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1596  TSybdbqual = function(Proc: PDBPROCESS; TabNum: Integer; TabName: PAnsiChar): PAnsiChar; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1597  TSybdbreadtext = function(Proc: PDBPROCESS; Buf: Pointer; BufSize: DBINT): DBINT; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1598  TSybdbresults = function(Proc: PDBPROCESS): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1599  TSybdbretdata = function(Proc: PDBPROCESS; RetNum: Integer): PByte; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1600  TSybdbretlen = function(Proc: PDBPROCESS; RetNum: Integer): DBINT; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1601  TSybdbretname = function(Proc: PDBPROCESS; RetNum: Integer): PAnsiChar; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1602  TSybdbretstatus = function(Proc: PDBPROCESS): DBINT; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1603  TSybdbrettype = function(Proc: PDBPROCESS; RetNum: Integer): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1604  TSybdbrows = function(Proc: PDBPROCESS): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF}; //!!!
1605  TSybdbrowtype = function(Proc: PDBPROCESS): STATUS; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1606  TSybdbrpcinit = function(Proc: PDBPROCESS; ProcName: PAnsiChar; Options: DBSMALLINT): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF}; //!!!
1607  TSybdbrpcparam = function(Proc: PDBPROCESS; ParamName: PAnsiChar; Status: Byte;
1608  Typ: Integer; MaxLen, DataLen: DBINT; Value: PByte): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1609  TSybdbrpcsend = function(Proc: PDBPROCESS): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1610 
1611  TSybdbrpwclr = procedure(Login: PLOGINREC); {$IFNDEF UNIX}stdcall{$ELSE}cdecl{$ENDIF};
1612  TSybdbsetavail = procedure(Proc: PDBPROCESS); {$IFNDEF UNIX}stdcall{$ELSE}cdecl{$ENDIF};
1613  TSybdbsetmaxprocs = function(MaxProcs: SmallInt): RETCODE; {$IFNDEF UNIX}stdcall{$ELSE}cdecl{$ENDIF};
1614  TSybdbsetlname = function(Login: PLOGINREC; Value: PAnsiChar; Item: Integer): RETCODE; {$IFNDEF UNIX}stdcall{$ELSE}cdecl{$ENDIF};
1615  TSybdbsetlogintime = function(Seconds: Integer): RETCODE; {$IFNDEF UNIX}stdcall{$ELSE}cdecl{$ENDIF};
1616 
1617  TSybdbsetnull = function(Proc: PDBPROCESS; BindType, BindLen: Integer;
1618  BindVal: PByte): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1619  TSybdbsetopt = function(Proc: PDBPROCESS; Option: Integer; CharParam: PAnsiChar; IntParam: Integer):
1620  RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1621  TSybdbsettime = function(Seconds: Integer): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1622  TSybdbsetuserdata = procedure(Proc: PDBPROCESS; Ptr: Pointer); {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1623  TSybdbsqlexec = function(Proc: PDBPROCESS): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1624  TSybdbsqlok = function(Proc: PDBPROCESS): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1625  TSybdbsqlsend = function(Proc: PDBPROCESS): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1626  TSybdbstrcpy = function(Proc: PDBPROCESS; Start, NumBytes: Integer; Dest: PAnsiChar):
1627  RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1628  TSybdbstrlen = function(Proc: PDBPROCESS): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1629  TSybdbtabbrowse = function(Proc: PDBPROCESS; TabNum: Integer): LongBool; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1630  TSybdbtabcount = function(Proc: PDBPROCESS): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1631  TSybdbtabname = function(Proc: PDBPROCESS; Table: Integer): PAnsiChar; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1632  TSybdbtabsource = function(Proc: PDBPROCESS; Column: Integer; TabNum: PInteger):
1633  PAnsiChar; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1634  TSybdbtsnewlen = function(Proc: PDBPROCESS): Integer; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1635  TSybdbtsnewval = function(Proc: PDBPROCESS): PDBBINARY; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1636  TSybdbtsput = function(Proc: PDBPROCESS; NewTs: PDBBINARY; NewTsName,
1637  TabNum: Integer; TableName: PAnsiChar): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1638  TSybdbtxptr = function(Proc: PDBPROCESS; Column: Integer): PDBBINARY; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1639  TSybdbtxtimestamp = function(Proc: PDBPROCESS; Column: Integer): PDBBINARY; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1640  TSybdbtxtsnewval = function(Proc: PDBPROCESS): PDBBINARY; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1641  TSybdbtxtsput = function(Proc: PDBPROCESS; NewTxts: PDBBINARY; Column: Integer):
1642  RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1643  TSybdbuse = function(Proc: PDBPROCESS; DbName: PAnsiChar): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1644  TSybdbvarylen = function(Proc: PDBPROCESS; Column: Integer): LongBool; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1645  TSybdbwillconvert = function(SrcType, DestType: Integer): LongBool; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1646  TSybdbwritetext = function(Proc: PDBPROCESS; ObjName: PAnsiChar; TextPtr: PDBBINARY;
1647  TextPtrLen: DBTINYINT; Timestamp: PDBBINARY; Log: LongBool; Size: DBINT;
1648  Text: PByte): RETCODE; {$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
1649 
1650  TDBLibAPI = Record
1651  dberrhandle : Tdberrhandle;
1652  dbmsghandle : Tdbmsghandle;
1653 
1654  dbprocerrhandle : Tdbprocerrhandle;
1655  dbprocmsghandle : Tdbprocmsghandle;
1656 
1657  { Two-phase commit functions }
1658  abort_xact : Tabort_xact;
1659  build_xact_string : Tbuild_xact_string;
1660  close_commit : Tclose_commit;
1661  commit_xact : Tcommit_xact;
1662  open_commit : Topen_commit;
1663  remove_xact : Tremove_xact;
1664  scan_xact : Tscan_xact;
1665  start_xact : Tstart_xact;
1666  stat_xact : Tstat_xact;
1667 
1668  { BCP functions }
1669  bcp_batch : Tbcp_batch;
1670  bcp_bind : Tbcp_bind;
1671  bcp_colfmt : Tbcp_colfmt;
1672  bcp_collen : Tbcp_collen;
1673  bcp_colptr : Tbcp_colptr;
1674  bcp_columns : Tbcp_columns;
1675  bcp_control : Tbcp_control;
1676  bcp_done : Tbcp_done;
1677  bcp_exec : Tbcp_exec;
1678  bcp_init : Tbcp_init;
1679  bcp_moretext : Tbcp_moretext;
1680  bcp_readfmt : Tbcp_readfmt;
1681  bcp_sendrow : Tbcp_sendrow;
1682  bcp_setl : Tbcp_setl;
1683  bcp_writefmt : Tbcp_writefmt;
1684  dbadata : Tdbadata;
1685  dbadlen : Tdbadlen;
1686  dbaltbind : Tdbaltbind;
1687  dbaltcolid : Tdbaltcolid;
1688  dbaltlen : Tdbaltlen;
1689  dbaltop : Tdbaltop;
1690  dbalttype : Tdbalttype;
1691  dbaltutype : Tdbaltutype;
1692  dbanullbind : Tdbanullbind;
1693  dbbind : Tdbbind;
1694  dbbylist : Tdbbylist;
1695  dbcancel : Tdbcancel;
1696  dbcanquery : Tdbcanquery;
1697  dbchange : Tdbchange;
1698  dbclrbuf : Tdbclrbuf;
1699  dbclropt : Tdbclropt;
1700  dbcmd : Tdbcmd;
1701  dbcmdrow : Tdbcmdrow;
1702  dbcollen : Tdbcollen;
1703  dbcolname : Tdbcolname;
1704  dbcolsource : Tdbcolsource;
1705  dbcoltype : Tdbcoltype;
1706  dbcolutype : Tdbcolutype;
1707  dbconvert : Tdbconvert;
1708  dbcurcmd : Tdbcurcmd;
1709  dbcurrow : Tdbcurrow;
1710  dbcursor : Tdbcursor;
1711  dbdata : Tdbdata;
1712  dbexit : Tdbexit;
1713  dbfcmd : Tdbfcmd;
1714  dbfirstrow : Tdbfirstrow;
1715  dbfreebuf : Tdbfreebuf;
1716  dbfreequal : Tdbfreequal;
1717  dbgetchar : Tdbgetchar;
1718  dbgetoff : Tdbgetoff;
1719  dbgetrow : Tdbgetrow;
1720  dbgettime : Tdbgettime;
1721  dbiscount : Tdbiscount;
1722  dblastrow : Tdblastrow;
1723  dblogin : Tdblogin;
1724  dbmorecmds : Tdbmorecmds;
1725  dbmoretext : Tdbmoretext;
1726  dbname : Tdbname;
1727  dbnextrow : Tdbnextrow;
1728  dbnullbind : Tdbnullbind;
1729  dbnumalts : Tdbnumalts;
1730  dbnumcols : Tdbnumcols;
1731  dbnumcompute : Tdbnumcompute;
1732  dbnumorders : Tdbnumorders;
1733  dbnumrets : Tdbnumrets;
1734  dbopen : Tdbopen;
1735  dbordercol : Tdbordercol;
1736  dbprhead : Tdbprhead;
1737  dbprrow : Tdbprrow;
1738  dbprtype : Tdbprtype;
1739  dbqual : Tdbqual;
1740  dbreadtext : Tdbreadtext;
1741  dbresults : Tdbresults;
1742  dbretdata : Tdbretdata;
1743  dbretlen : Tdbretlen;
1744  dbretname : Tdbretname;
1745  dbretstatus : Tdbretstatus;
1746  dbrettype : Tdbrettype;
1747  dbrows : Tdbrows;
1748  dbrowtype : Tdbrowtype;
1749  dbrpcinit : Tdbrpcinit;
1750  dbrpcparam : Tdbrpcparam;
1751  dbrpcsend : Tdbrpcsend;
1752  dbrpwclr : Tdbrpwclr;
1753  dbsetavail : Tdbsetavail;
1754  dbsetlname : Tdbsetlname;
1755  dbsetlogintime : Tdbsetlogintime;
1756  dbsetnull : Tdbsetnull;
1757  dbsettime : Tdbsettime;
1758  dbsetuserdata : Tdbsetuserdata;
1759  dbsqlexec : Tdbsqlexec;
1760  dbsqlok : Tdbsqlok;
1761  dbsqlsend : Tdbsqlsend;
1762  dbstrcpy : Tdbstrcpy;
1763  dbstrlen : Tdbstrlen;
1764  dbtabcount : Tdbtabcount;
1765  dbtabname : Tdbtabname;
1766  dbtabsource : Tdbtabsource;
1767  dbtsnewlen : Tdbtsnewlen;
1768  dbtsnewval : Tdbtsnewval;
1769  dbtsput : Tdbtsput;
1770  dbtxptr : Tdbtxptr;
1771  dbtxtimestamp : Tdbtxtimestamp;
1772  dbtxtsnewval : Tdbtxtsnewval;
1773  dbtxtsput : Tdbtxtsput;
1774  dbuse : Tdbuse;
1775  dbwritetext : Tdbwritetext;
1776  End;
1777 
1778  TFreeTDSAPI = Record
1779  {available but not implemented}
1780  db12hour: TFreeTDSdb12hour; {no MS}
1781  dbcolbrowse: TFreeTDSdbcolbrowse;
1782  dbcursorbind: TFreeTDSdbcursorbind;
1783  dbcursorclose: TFreeTDSdbcursorclose;
1784  dbcursorcolinfo:TFreeTDSdbcursorcolinfo;
1785  dbcursorfetch: TFreeTDSdbcursorfetch;
1786  dbcursorinfo: TFreeTDSdbcursorinfo;
1787 
1788 
1789  dbaltbind_ps: TFreeTDSdbaltbind_ps;
1790  dbbind_ps: TFreeTDSdbbind_ps;
1791  dbbufsize: TFreeTDSdbbufsize;
1792  dbclose: TFreeTDSdbclose;
1793  dbtablecolinfo: TFreeTDSdbtablecolinfo;
1794  dbcolinfo: TFreeTDSdbcolinfo;
1795  dbconvert_ps: TFreeTDSdbconvert_ps;
1796  dbcount: TFreeTDSdbcount;
1797  dbdatecmp: TFreeTDSdbdatecmp;
1798  dbdatecrack: TFreeTDSdbdatecrack;
1799  dbdatlen: TFreeTDSdbdatlen;
1800  dbdead: TFreeTDSdbdead;
1801 
1802  dbgetcharset: TFreeTDSdbgetcharset;
1803  dbgetlusername: TFreeTDSdbgetlusername;
1804  dbgetmaxprocs: TMsSQLdbgetmaxprocs;
1805  dbgetnatlanf: TFreeTDSdbgetnatlanf;
1806  dbgetpacket: TFreeTDSdbgetpacket;
1807  dbgetuserdata: TFreeTDSdbgetuserdata;
1808  dbhasretstat: TFreeTDSdbhasretstat;
1809  dbinit: TFreeTDSdbinit;
1810  dbiordesc: TFreeTDSdbiordesc;
1811  dbiowdesc: TFreeTDSdbiowdesc;
1812  dbisavail: TFreeTDSdbisavail;
1813  dbisopt: TFreeTDSdbisopt;
1814  dbloginfree: TFreeTDSdbloginfree;
1815  dbmny4cmp: TFreeTDSdbmny4cmp;
1816  dbmnycmp: TFreeTDSdbmnycmp;
1817  dbmny4add: TFreeTDSdbmny4add;
1818  dbmnydec: TFreeTDSdbmnydec;
1819  dbmnyinc: TFreeTDSdbmnyinc;
1820  dbmnymaxpos: TFreeTDSdbmnymaxpos;
1821  dbmnymaxneg: TFreeTDSdbmnymaxneg;
1822  dbmny4minus: TFreeTDSdbmny4minus;
1823  dbmnyminus: TFreeTDSdbmnyminus;
1824  dbmny4sub: TFreeTDSdbmny4sub;
1825  dbmnysub: TFreeTDSdbmnysub;
1826  dbmny4copy: TFreeTDSdbmny4copy;
1827  dbmnycopy: TFreeTDSdbmnycopy;
1828  dbmny4zero: TFreeTDSdbmny4zero;
1829  dbmnyzero: TFreeTDSdbmnyzero;
1830  dbmonthname: TFreeTDSdbmonthname;
1831  tdsdbopen: TFreeTDSdbopen;
1832 
1833  { pivot functions */
1834  void dbpivot_count (struct col_t *output, const struct col_t *input);
1835  void dbpivot_sum (struct col_t *output, const struct col_t *input);
1836  void dbpivot_min (struct col_t *output, const struct col_t *input);
1837  void dbpivot_max (struct col_t *output, const struct col_t *input);
1838 
1839  struct pivot_t;
1840  typedef void (*DBPIVOT_FUNC)(struct col_t *output, const struct col_t *input);
1841  struct pivot_t * dbrows_pivoted(DBPROCESS *dbproc);
1842  STATUS dbnextrow_pivoted(DBPROCESS *dbproc, struct pivot_t *pp);
1843  RETCODE dbpivot(DBPROCESS *dbproc, int nkeys, int *keys, int ncols, int *cols, DBPIVOT_FUNC func, int val);
1844 
1845  DBPIVOT_FUNC dbpivot_lookup_name( const char name[] );
1846  }
1847  DRBUF: TDRBUF;
1848  dbrecftos: TFreeTDSdbrecftos;
1849  dbresults_r: TFreeTDSdbresults_r;
1850  dbsafestr: TFreeTDSdbsafestr;
1851  //dbsechandle: TFreeTDSdbsechandle;
1852  dbservcharset: TFreeTDSdbservcharset;
1853  //dbsetbusy: TFreeTDSdbsetbusy;
1854  dbsetdefcharset:TFreeTDSdbsetdefcharset;
1855  dbsetifile: TFreeTDSdbsetifile;
1856  //dbsetinterrupt: TFreeTDSdbsetinterrupt;
1857  dbsetmaxprocs: TMsSQLdbsetmaxprocs;
1858  dbsetopt: TFreeTDSdbsetopt;
1859  dbsetrow: TFreeTDSdbsetrow;
1860  dbsetversion: TFreeTDSdbsetversion;
1861  dbspid: TFreeTDSdbspid;
1862  dbspr1row: TFreeTDSdbspr1row;
1863  dbspr1rowlen: TFreeTDSdbspr1rowlen;
1864  dbsprhead: TFreeTDSdbsprhead;
1865  dbsprline: TFreeTDSdbsprline;
1866  dbvarylen: TFreeTDSdbvarylen;
1867 
1868  dbtds: TFreeTDSdbtds;
1869  dbtextsize: TFreeTDSdbtextsize;
1870  dbwillconvert: TFreeTDSdbwillconvert;
1871  dbsetlbool: TFreeTDSdbsetlbool;
1872  dbsetllong: TFreeTDSdbsetllong;
1873  dbsetlversion: TFreeTDSdbsetlversion;
1874 
1875  tdsdump_on : Ttdsdump_on;
1876  tdsdump_off : Ttdsdump_off;
1877  tdsdump_open : Ttdsdump_open;
1878  tdsdump_close : Ttdsdump_close;
1879  _tds_socket_init : T_tds_socket_init;
1880  _tds_socket_done : T_tds_socket_done;
1881  End;
1882 
1883  TMsSQLAPI = record
1884 
1885  { Standard DB-Library functions }
1886  dbclose : TMsSQLdbclose;
1887  dbcolbrowse : TMsSQLdbcolbrowse;
1888  dbcolinfo : TMsSQLdbcolinfo;
1889  dbcount : TMsSQLdbcount;
1890 
1891  dbcursorbind : TMsSQLdbcursorbind;
1892  dbcursorclose : TMsSQLdbcursorclose;
1893  dbcursorcolinfo : TMsSQLdbcursorcolinfo;
1894  dbcursorfetch : TMsSQLdbcursorfetch;
1895  dbcursorfetchex : TMsSQLdbcursorfetchex;
1896  dbcursorinfo : TMsSQLdbcursorinfo;
1897  dbcursorinfoex : TMsSQLdbcursorinfoex;
1898  dbcursoropen : TMsSQLdbcursoropen;
1899  dbdataready : TMsSQLdbdataready;
1900  dbdatecrack : TMsSQLdbdatecrack;
1901  dbdatlen : TMsSQLdbdatlen;
1902  dbdead : TMsSQLdbdead;
1903  dbWinexit : TMsSQLdbWinexit;
1904  dbenlisttrans : TMsSQLdbenlisttrans;
1905  dbenlistxatrans : TMsSQLdbenlistxatrans;
1906  dbfreelogin : TMsSQLdbfreelogin;
1907  dbgetmaxprocs : TMsSQLdbgetmaxprocs;
1908  dbgetpacket : TMsSQLdbgetpacket;
1909  dbgetuserdata : TMsSQLdbgetuserdata;
1910  dbhasretstat : TMsSQLdbhasretstat;
1911  dbinit : TMsSQLdbinit;
1912  dbisavail : TMsSQLdbisavail;
1913  dbisopt : TMsSQLdbisopt;
1914  dbprocinfo : TMsSQLdbprocinfo;
1915  dbrpcexec : TMsSQLdbrpcexec;
1916  dbserverenum : TMsSQLdbserverenum;
1917  dbsetmaxprocs : TMsSQLdbsetmaxprocs;
1918  dbsetlpacket : TMsSQLdbsetlpacket;
1919  dbsetopt : TMsSQLdbsetopt;
1920  dbtabbrowse : TMsSQLdbtabbrowse;
1921  dbvarylen : TMsSQLdbvarylen;
1922  dbwillconvert : TMsSQLdbwillconvert;
1923  dbupdatetext : TMsSQLdbupdatetext;
1924  end;
1925 
1926  TSybaseAPI = record
1927  db12hour : TSybdb12hour;
1928 
1929  dberrhandle : TSybdberrhandle;
1930  dbmsghandle : TSybdbmsghandle;
1931 
1932  { Two-phase commit functions }
1933  abort_xact : TSybabort_xact;
1934  build_xact_string : TSybbuild_xact_string;
1935  close_commit : TSybclose_commit;
1936  commit_xact : TSybcommit_xact;
1937  open_commit : TSybopen_commit;
1938  remove_xact : TSybremove_xact;
1939  scan_xact : TSybscan_xact;
1940  start_xact : TSybstart_xact;
1941  stat_xact : TSybstat_xact;
1942 
1943  { BCP functions }
1944  bcp_batch : TSybbcp_batch;
1945  bcp_bind : TSybbcp_bind;
1946  bcp_colfmt : TSybbcp_colfmt;
1947  bcp_collen : TSybbcp_collen;
1948  bcp_colptr : TSybbcp_colptr;
1949  bcp_columns : TSybbcp_columns;
1950  bcp_control : TSybbcp_control;
1951  bcp_done : TSybbcp_done;
1952  bcp_exec : TSybbcp_exec;
1953  bcp_init : TSybbcp_init;
1954  bcp_moretext : TSybbcp_moretext;
1955  bcp_readfmt : TSybbcp_readfmt;
1956  bcp_sendrow : TSybbcp_sendrow;
1957  bcp_writefmt : TSybbcp_writefmt;
1958 
1959  { Standard DB-Library functions }
1960  dbadata : TSybdbadata;
1961  dbadlen : TSybdbadlen;
1962  dbaltbind : TSybdbaltbind;
1963  dbaltcolid : TSybdbaltcolid;
1964  dbaltlen : TSybdbaltlen;
1965  dbaltop : TSybdbaltop;
1966  dbalttype : TSybdbalttype;
1967  dbaltutype : TSybdbaltutype;
1968  dbanullbind : TSybdbanullbind;
1969  dbbind : TSybdbbind;
1970  dbbylist : TSybdbbylist;
1971  dbcancel : TSybdbcancel;
1972  dbcanquery : TSybdbcanquery;
1973  dbchange : TSybdbchange;
1974  dbclose : TSybdbclose;
1975  dbclrbuf : TSybdbclrbuf;
1976  dbclropt : TSybdbclropt;
1977  dbcmd : TSybdbcmd;
1978  dbcmdrow : TSybdbcmdrow;
1979  dbcolbrowse : TSybdbcolbrowse;
1980  dbcollen : TSybdbcollen;
1981  dbcolname : TSybdbcolname;
1982  dbcolsource : TSybdbcolsource;
1983  // dbcoltypeinfo : TSybdbcoltypeinfo;
1984  dbcoltype : TSybdbcoltype;
1985  dbcolutype : TSybdbcolutype;
1986  dbconvert : TSybdbconvert;
1987  dbcount : TSybdbcount;
1988  dbcurcmd : TSybdbcurcmd;
1989  dbcurrow : TSybdbcurrow;
1990 
1991  dbcursor : TSybdbcursor;
1992  dbcursorbind : TSybdbcursorbind;
1993  dbcursorclose : TSybdbcursorclose;
1994  dbcursorcolinfo : TSybdbcursorcolinfo;
1995  dbcursorfetch : TSybdbcursorfetch;
1996  dbcursorinfo : TSybdbcursorinfo;
1997  dbcursoropen : TSybdbcursoropen;
1998  dbdata : TSybdbdata;
1999  dbdatecrack : TSybdbdatecrack;
2000  dbdatlen : TSybdbdatlen;
2001  dbdead : TSybdbdead;
2002  dbexit : TSybdbexit;
2003  dbfcmd : TSybdbfcmd;
2004  dbfirstrow : TSybdbfirstrow;
2005  dbfreebuf : TSybdbfreebuf;
2006  dbloginfree : TSybdbloginfree;
2007  dbfreequal : TSybdbfreequal;
2008  dbgetchar : TSybdbgetchar;
2009  dbgetmaxprocs : TSybdbgetmaxprocs;
2010  dbgetoff : TSybdbgetoff;
2011  dbgetpacket : TSybdbgetpacket;
2012  dbgetrow : TSybdbgetrow;
2013  dbgetuserdata : TSybdbgetuserdata;
2014  dbhasretstat : TSybdbhasretstat;
2015  dbinit : TSybdbinit;
2016  dbisavail : TSybdbisavail;
2017  dbisopt : TSybdbisopt;
2018  dblastrow : TSybdblastrow;
2019  dblogin : TSybdblogin;
2020  dbmorecmds : TSybdbmorecmds;
2021  dbmoretext : TSybdbmoretext;
2022  dbname : TSybdbname;
2023  dbnextrow : TSybdbnextrow;
2024  dbnullbind : TSybdbnullbind;
2025  dbnumalts : TSybdbnumalts;
2026  dbnumcols : TSybdbnumcols;
2027  dbnumcompute : TSybdbnumcompute;
2028  dbnumorders : TSybdbnumorders;
2029  dbnumrets : TSybdbnumrets;
2030  dbopen : TSybdbopen;
2031  dbordercol : TSybdbordercol;
2032  dbprhead : TSybdbprhead;
2033  dbprrow : TSybdbprrow;
2034  dbprtype : TSybdbprtype;
2035  dbqual : TSybdbqual;
2036  dbreadtext : TSybdbreadtext;
2037  dbresults : TSybdbresults;
2038  dbretdata : TSybdbretdata;
2039  dbretlen : TSybdbretlen;
2040  dbretname : TSybdbretname;
2041  dbretstatus : TSybdbretstatus;
2042  dbrettype : TSybdbrettype;
2043  dbrows : TSybdbrows;
2044  dbrowtype : TSybdbrowtype;
2045  dbrpcinit : TSybdbrpcinit;
2046  dbrpcparam : TSybdbrpcparam;
2047  dbrpcsend : TSybdbrpcsend;
2048 
2049  dbrpwclr : TSybdbrpwclr;
2050  dbsetavail : TSybdbsetavail;
2051  dbsetmaxprocs : TSybdbsetmaxprocs;
2052  dbsetlname : TSybdbsetlname;
2053  dbsetlogintime : TSybdbsetlogintime;
2054 
2055  dbsetnull : TSybdbsetnull;
2056  dbsetopt : TSybdbsetopt;
2057  dbsettime : TSybdbsettime;
2058  dbsetuserdata : TSybdbsetuserdata;
2059  dbsqlexec : TSybdbsqlexec;
2060  dbsqlok : TSybdbsqlok;
2061  dbsqlsend : TSybdbsqlsend;
2062  dbstrcpy : TSybdbstrcpy;
2063  dbstrlen : TSybdbstrlen;
2064  dbtabbrowse : TSybdbtabbrowse;
2065  dbtabcount : TSybdbtabcount;
2066  dbtabname : TSybdbtabname;
2067  dbtabsource : TSybdbtabsource;
2068  dbtsnewlen : TSybdbtsnewlen;
2069  dbtsnewval : TSybdbtsnewval;
2070  dbtsput : TSybdbtsput;
2071  dbtxptr : TSybdbtxptr;
2072  dbtxtimestamp : TSybdbtxtimestamp;
2073  dbtxtsnewval : TSybdbtxtsnewval;
2074  dbtxtsput : TSybdbtxtsput;
2075  dbuse : TSybdbuse;
2076  dbvarylen : TSybdbvarylen;
2077  dbwillconvert : TSybdbwillconvert;
2078  dbwritetext : TSybdbwritetext;
2079  end;
2080 
2081 implementation
2082 
2083 end.