31 #include "tds_sysdep_public.h"
33 #undef TDS_STATIC_CAST
35 #define TDS_STATIC_CAST(type, a) static_cast<type>(a)
42 #define TDS_STATIC_CAST(type, a) ((type)(a))
59 #define INT_CONTINUE 1
63 #define DBMAXNUMLEN 33
69 #define DBVERSION_UNKNOWN 0
70 #define DBVERSION_46 1
71 #define DBVERSION_100 2
72 #define DBVERSION_42 3
73 #define DBVERSION_70 4
74 #define DBVERSION_71 5
75 #define DBVERSION_72 6
76 #define DBVERSION_73 7
77 #define DBVERSION_74 8
80 #define DBVER42 DBVERSION_42
81 #define DBVER60 DBVERSION_70
87 #define DBTDS_UNKNOWN 0
109 #define BCPKEEPIDENTITY 8
120 typedef void DBCURSOR;
121 typedef void DBXLATE;
122 typedef void DBSORTORDER;
123 typedef void DBLOGINFO;
124 typedef void *DBVOIDPTR;
126 typedef unsigned short USHORT;
127 typedef int (*INTFUNCPTR) (
void *, ...);
128 typedef int (*DBWAITFUNC) (void);
129 typedef DBWAITFUNC(*DB_DBBUSY_FUNC) (
void *dbproc);
130 typedef void (*DB_DBIDLE_FUNC) (DBWAITFUNC dfunc,
void *dbproc);
131 typedef int (*DB_DBCHKINTR_FUNC) (
void *dbproc);
132 typedef int (*DB_DBHNDLINTR_FUNC) (
void *dbproc);
134 #ifndef __INCvxWorksh
146 #if !defined(_WINDEF_) && !defined(_WINDEF_H) && !defined(DOS32X)
157 #define SYBCHAR SYBCHAR
159 #define SYBVARCHAR SYBVARCHAR
161 #define SYBINTN SYBINTN
163 #define SYBINT1 SYBINT1
165 #define SYBINT2 SYBINT2
167 #define SYBINT4 SYBINT4
169 #define SYBINT8 SYBINT8
171 #define SYBFLT8 SYBFLT8
173 #define SYBDATETIME SYBDATETIME
175 #define SYBBIT SYBBIT
177 #define SYBBITN SYBBITN
179 #define SYBTEXT SYBTEXT
181 #define SYBNTEXT SYBNTEXT
183 #define SYBIMAGE SYBIMAGE
185 #define SYBMONEY4 SYBMONEY4
187 #define SYBMONEY SYBMONEY
189 #define SYBDATETIME4 SYBDATETIME4
191 #define SYBREAL SYBREAL
193 #define SYBBINARY SYBBINARY
195 #define SYBVOID SYBVOID
197 #define SYBVARBINARY SYBVARBINARY
199 #define SYBNUMERIC SYBNUMERIC
201 #define SYBDECIMAL SYBDECIMAL
203 #define SYBFLTN SYBFLTN
205 #define SYBMONEYN SYBMONEYN
207 #define SYBDATETIMN SYBDATETIMN
209 #define SYBNVARCHAR SYBNVARCHAR
212 #define SYBAOPCNT 0x4b
213 #define SYBAOPCNTU 0x4c
214 #define SYBAOPSUM 0x4d
215 #define SYBAOPSUMU 0x4e
216 #define SYBAOPAVG 0x4f
217 #define SYBAOPAVGU 0x50
218 #define SYBAOPMIN 0x51
219 #define SYBAOPMAX 0x52
222 #define SYBAOPCNT_BIG 0x09
223 #define SYBAOPSTDEV 0x30
224 #define SYBAOPSTDEVP 0x31
225 #define SYBAOPVAR 0x32
226 #define SYBAOPVARP 0x33
227 #define SYBAOPCHECKSUM_AGG 0x72
231 typedef unsigned char DBBOOL;
233 typedef unsigned char DBBIT;
234 typedef unsigned char DBTINYINT;
235 typedef tds_sysdep_int16_type DBSMALLINT;
236 typedef tds_sysdep_int32_type DBINT;
237 typedef tds_sysdep_int64_type DBBIGINT;
238 typedef unsigned char DBBINARY;
239 typedef tds_sysdep_real32_type DBREAL;
240 typedef tds_sysdep_real64_type DBFLT8;
241 typedef unsigned tds_sysdep_int16_type DBUSMALLINT;
252 unsigned char array[256];
257 unsigned char precision;
259 unsigned char array[33];
267 unsigned tds_sysdep_int32_type mnylow;
288 # define SQLCHAR SYBCHAR
299 typedef unsigned char BYTE;
318 { MAXCOLNAMELEN = 512 };
319 typedef enum { CI_REGULAR=1, CI_ALTERNATE=2, CI_CURSOR=3 } CI_TYPE;
324 DBCHAR Name[MAXCOLNAMELEN+2];
325 DBCHAR ActualName[MAXCOLNAMELEN+2];
326 DBCHAR TableName[MAXCOLNAMELEN+2];
343 DBCHAR Name[MAXCOLNAMELEN+2];
344 DBCHAR ActualName[MAXCOLNAMELEN+2];
345 DBCHAR TableName[MAXCOLNAMELEN+2];
357 DBINT ServerMaxLength;
358 DBCHAR ServerTypeDeclaration[256];
365 #define DBPARSEONLY 0
369 #define DBARITHIGNORE 4
371 #define DBARITHABORT 6
372 #define DBTEXTLIMIT 7
378 #define DBSTORPROCID 13
380 #define DBNOAUTOFREE 15
381 #define DBROWCOUNT 16
382 #define DBTEXTSIZE 17
384 #define DBDATEFORMAT 19
386 #define DBPRCOLSEP 21
387 #define DBPRLINELEN 22
388 #define DBPRLINESEP 23
389 #define DBLFCONVERT 24
390 #define DBDATEFIRST 25
391 #define DBCHAINXACTS 26
392 #define DBFIPSFLAG 27
393 #define DBISOLATION 28
395 #define DBIDENTITY 30
397 #define DBDATESHORT 32
398 #define DBCLIENTCURSORS 33
400 #define DBQUOTEDIDENT 35
402 #define DBNUMOPTIONS 36
410 #define NOSUCHOPTION 2
412 #define MAXOPTTEXT 32
462 typedef int (*EHANDLEFUNC) (
DBPROCESS * dbproc,
int severity,
int dberr,
int oserr,
char *dberrstr,
char *oserrstr);
464 typedef int (*MHANDLEFUNC) (
DBPROCESS * dbproc, DBINT msgno,
int msgstate,
int severity,
char *msgtext,
char *srvname,
465 char *proc,
int line);
469 #define DBNOTIFICATION 2
471 #define DBINTERRUPT 4
479 #define NTBSTRINGBIND 2
480 #define VARYCHARBIND 3
481 #define VARYBINBIND 4
487 #define DATETIMEBIND 11
488 #define SMALLDATETIMEBIND 12
490 #define SMALLMONEYBIND 14
491 #define BINARYBIND 15
493 #define NUMERICBIND 17
494 #define DECIMALBIND 18
495 #define SRCNUMERICBIND 19
496 #define SRCDECIMALBIND 20
497 #define BIGINTBIND 30
498 #define DATETIME2BIND 31
499 #define MAXBINDTYPES 32
501 #define DBPRCOLSEP 21
502 #define DBPRLINELEN 22
503 #define DBRPCRETURN 1
504 #define DBRPCDEFAULT 2
508 #define NO_MORE_ROWS -2
510 #define NO_MORE_RESULTS 2
516 #define DB_QUERYOUT 3
523 #define DBRPCRECOMPILE TDS_STATIC_CAST(DBSMALLINT, 0x0001)
524 #define DBRPCRESET TDS_STATIC_CAST(DBSMALLINT, 0x0002)
525 #define DBRPCCURSOR TDS_STATIC_CAST(DBSMALLINT, 0x0008)
527 #if defined(DBLIB_UNIMPLEMENTED)
528 DBBOOL db12hour(
DBPROCESS * dbprocess,
const char language[]);
530 DBBOOL dbcolbrowse(
DBPROCESS * dbprocess,
int colnum);
532 RETCODE dbcursor(DBCURSOR * hc, DBINT optype, DBINT bufno, BYTE * table, BYTE * values);
533 RETCODE dbcursorbind(DBCURSOR * hc,
int col,
int vartype, DBINT varlen, DBINT * poutlen, BYTE * pvaraddr,
DBTYPEINFO * typeinfo);
534 void dbcursorclose(DBCURSOR * hc);
535 RETCODE dbcursorcolinfo(DBCURSOR * hc, DBINT column, DBCHAR * colname, DBINT * coltype, DBINT * collen, DBINT * usertype);
536 RETCODE dbcursorfetch(DBCURSOR * hc, DBINT fetchtype, DBINT rownum);
537 RETCODE dbcursorinfo(DBCURSOR * hc, DBINT * ncols, DBINT * nrows);
538 DBCURSOR *dbcursoropen(
DBPROCESS * dbprocess, BYTE * stmt, SHORT scollopt, SHORT concuropt, USHORT nrows, DBINT * pstatus);
542 RETCODE dbdatechar(
DBPROCESS * dbprocess,
char *buf,
int datepart,
int value);
544 char *dateorder(
DBPROCESS * dbprocess,
char *language);
547 char *dbdayname(
DBPROCESS * dbprocess,
char *language,
int daynum);
549 int dbgetoff(
DBPROCESS * dbprocess, DBUSMALLINT offtype,
int startfrom);
551 char *dbqual(
DBPROCESS * dbprocess,
int tabnum,
char *tabname);
552 void dbfreequal(
char *qualptr);
554 DBSORTORDER *dbloadsort(
DBPROCESS * dbprocess);
555 RETCODE dbfreesort(
DBPROCESS * dbprocess, DBSORTORDER * sortorder);
557 RETCODE dbload_xlate(
DBPROCESS * dbprocess,
char *srv_charset,
char *clt_name, DBXLATE ** xlt_tosrv, DBXLATE ** xlt_todisp);
563 RETCODE dbmnydown(
DBPROCESS * dbproc,
DBMONEY * mnyptr,
int divisor,
int *remainder);
564 RETCODE dbmnyinit(
DBPROCESS * dbproc,
DBMONEY * mnyptr,
int trim, DBBOOL * negative);
565 RETCODE dbmnyndigit(
DBPROCESS * dbproc,
DBMONEY * mnyptr, DBCHAR * value, DBBOOL * zero);
567 RETCODE dbmnydigit(
DBPROCESS * dbprocess,
DBMONEY * m1, DBCHAR * value, DBBOOL * zero);
568 RETCODE dbmnyscale(
DBPROCESS * dbproc,
DBMONEY * dest,
int multiplier,
int addend);
571 RETCODE dbnpcreate(
DBPROCESS * dbprocess);
572 RETCODE dbnpdefine(
DBPROCESS * dbprocess, DBCHAR * procedure_name, DBSMALLINT namelen);
576 RETCODE dbpoll(
DBPROCESS * dbproc,
long milliseconds,
DBPROCESS ** ready_dbproc,
int *return_reason);
577 int dbordercol(
DBPROCESS * dbprocess,
int order);
579 RETCODE dbregdrop(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
580 RETCODE dbregexec(
DBPROCESS * dbproc, DBUSMALLINT options);
581 RETCODE dbreghandle(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, INTFUNCPTR handler);
582 RETCODE dbreginit(
DBPROCESS * dbproc, DBCHAR * procedure_name, DBSMALLINT namelen);
584 RETCODE dbregnowatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
585 RETCODE dbregparam(
DBPROCESS * dbproc,
char *param_name,
int type, DBINT datalen, BYTE * data);
586 RETCODE dbregwatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, DBUSMALLINT options);
587 RETCODE dbregwatchlist(
DBPROCESS * dbprocess);
590 RETCODE dbrpwset(
LOGINREC * login,
char *srvname,
char *password,
int pwlen);
592 DBINT dbreadpage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, BYTE * buf);
593 RETCODE dbwritepage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, DBINT size, BYTE * buf);
595 RETCODE dbsetdeflang(
char *language);
597 int dbstrcmp(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
598 int dbstrsort(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
600 DBBOOL dbtabbrowse(
DBPROCESS * dbprocess,
int tabnum);
602 char *dbtabname(
DBPROCESS * dbprocess,
int tabnum);
603 char *dbtabsource(
DBPROCESS * dbprocess,
int colnum,
int *tabnum);
605 RETCODE dbsetlshort(
LOGINREC * login,
int value,
int which);
607 RETCODE dbsendpassthru(
DBPROCESS * dbprocess, DBVOIDPTR bufp);
608 RETCODE dbrecvpassthru(
DBPROCESS * dbprocess, DBVOIDPTR * bufp);
610 RETCODE dbgetloginfo(
DBPROCESS * dbprocess, DBLOGINFO ** loginfo);
611 RETCODE dbsetloginfo(
LOGINREC * loginrec, DBLOGINFO * loginfo);
614 DBBINARY *dbtsnewval(
DBPROCESS * dbprocess);
615 RETCODE dbtsput(
DBPROCESS * dbprocess, DBBINARY * newts,
int newtslen,
int tabnum,
char *tabname);
617 RETCODE dbfree_xlate(
DBPROCESS * dbprocess, DBXLATE * xlt_tosrv, DBXLATE * clt_todisp);
618 int dbxlate(
DBPROCESS * dbprocess,
char *src,
int srclen,
char *dest,
int destlen, DBXLATE * xlt,
int *srcbytes_used,
619 DBBOOL srcend,
int status);
621 RETCODE bcp_moretext(
DBPROCESS * dbproc, DBINT size, BYTE * text);
622 RETCODE bcp_writefmt(
DBPROCESS * dbproc,
const char filename[]);
624 void build_xact_string(
char *xact_name,
char *service_name, DBINT commid,
char *result);
625 RETCODE remove_xact(
DBPROCESS * connect, DBINT commid,
int n);
626 RETCODE abort_xact(
DBPROCESS * connect, DBINT commid);
628 RETCODE commit_xact(
DBPROCESS * connect, DBINT commid);
630 RETCODE scan_xact(
DBPROCESS * connect, DBINT commid);
631 DBINT start_xact(
DBPROCESS * connect,
char *application_name,
char *xact_name,
int site_count);
632 DBINT stat_xact(
DBPROCESS * connect, DBINT commid);
638 RETCODE
dbaltbind(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
639 RETCODE dbaltbind_ps(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
647 RETCODE
dbbind(
DBPROCESS * dbproc,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
648 RETCODE dbbind_ps(
DBPROCESS * dbprocess,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
DBTYPEINFO * typeinfo);
654 DBBOOL dbcharsetconv(
DBPROCESS * dbprocess);
661 #define DBCMDROW(x) dbcmdrow((x))
670 DBINT
dbconvert(
DBPROCESS * dbproc,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen);
671 DBINT
dbconvert_ps(
DBPROCESS * dbprocess,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen,
676 #define DBCOUNT(x) dbcount((x))
679 #define DBCURCMD(x) dbcurcmd((x))
682 #define DBCURROW(x) dbcurrow((x))
689 #define DBDEAD(x) dbdead((x))
695 #define DBFIRSTROW(x) dbfirstrow((x))
698 char *dbgetcharset(
DBPROCESS * dbprocess);
699 int dbgetlusername(
LOGINREC * login, BYTE * name_buffer,
int buffer_len);
701 char *dbgetnatlanf(
DBPROCESS * dbprocess);
705 #define DBGETTIME dbgettime
711 #define DBIORDESC(x) dbiordesc((x))
714 #define DBIOWDESC(x) dbiowdesc((x))
717 #define DBISAVAIL(x) dbisavail((x))
721 #define DBLASTROW(x) dblastrow((x))
747 #define DBMORECMDS(x) dbmorecmds((x))
762 void dbpivot_count (
struct col_t *output,
const struct col_t *input);
763 void dbpivot_sum (
struct col_t *output,
const struct col_t *input);
764 void dbpivot_min (
struct col_t *output,
const struct col_t *input);
765 void dbpivot_max (
struct col_t *output,
const struct col_t *input);
768 typedef void (*DBPIVOT_FUNC)(
struct col_t *output,
const struct col_t *input);
771 RETCODE
dbpivot(
DBPROCESS *dbproc,
int nkeys,
int *keys,
int ncols,
int *cols, DBPIVOT_FUNC func,
int val);
773 DBPIVOT_FUNC dbpivot_lookup_name(
const char name[] );
776 #define dbopen(x,y) tdsdbopen((x),(y), 1)
778 #define dbopen(x,y) tdsdbopen((x),(y), 0)
782 #ifdef PHP_SYBASE_DBOPEN
783 #undef PHP_SYBASE_DBOPEN
784 #define PHP_SYBASE_DBOPEN dbopen
795 RETCODE dbresults_r(
DBPROCESS * dbproc,
int recursive);
803 #define DBROWS(x) dbrows((x))
806 #define DBROWTYPE(x) dbrowtype((x))
808 RETCODE
dbrpcparam(
DBPROCESS * dbproc,
const char paramname[], BYTE status,
int type, DBINT maxlen, DBINT datalen, BYTE * value);
810 RETCODE
dbsafestr(
DBPROCESS * dbproc,
const char *src, DBINT srclen,
char *dest, DBINT destlen,
int quotetype);
811 RETCODE *dbsechandle(DBINT type, INTFUNCPTR handler);
814 void dbsetbusy(
DBPROCESS * dbprocess, DB_DBBUSY_FUNC busyfunc);
815 RETCODE dbsetdefcharset(
char *charset);
816 void dbsetidle(
DBPROCESS * dbprocess, DB_DBIDLE_FUNC idlefunc);
822 RETCODE
dbsetopt(
DBPROCESS * dbproc,
int option,
const char *char_param,
int int_param);
836 int dbstrbuild(
DBPROCESS * dbproc,
char *charbuf,
int bufsize,
char *text,
char *formats, ...);
841 #define SYBEVERDOWN 100
842 #define SYBEICONVIU 2400
843 #define SYBEICONVAVAIL 2401
844 #define SYBEICONVO 2402
845 #define SYBEICONVI 2403
846 #define SYBEICONV2BIG 2404
849 #define SYBETDSVER 2410
850 #define SYBEPORT 2500
851 #define SYBESYNC 20001
852 #define SYBEFCON 20002
853 #define SYBETIME 20003
854 #define SYBEREAD 20004
855 #define SYBEBUFL 20005
856 #define SYBEWRIT 20006
857 #define SYBEVMS 20007
858 #define SYBESOCK 20008
859 #define SYBECONN 20009
860 #define SYBEMEM 20010
861 #define SYBEDBPS 20011
862 #define SYBEINTF 20012
863 #define SYBEUHST 20013
864 #define SYBEPWD 20014
865 #define SYBEOPIN 20015
866 #define SYBEINLN 20016
867 #define SYBESEOF 20017
868 #define SYBESMSG 20018
869 #define SYBERPND 20019
870 #define SYBEBTOK 20020
871 #define SYBEITIM 20021
872 #define SYBEOOB 20022
873 #define SYBEBTYP 20023
874 #define SYBEBNCR 20024
875 #define SYBEIICL 20025
876 #define SYBECNOR 20026
877 #define SYBENPRM 20027
878 #define SYBEUVDT 20028
879 #define SYBEUFDT 20029
880 #define SYBEWAID 20030
881 #define SYBECDNS 20031
882 #define SYBEABNC 20032
883 #define SYBEABMT 20033
884 #define SYBEABNP 20034
885 #define SYBEAAMT 20035
886 #define SYBENXID 20036
887 #define SYBERXID 20037
888 #define SYBEICN 20038
889 #define SYBENMOB 20039
890 #define SYBEAPUT 20040
891 #define SYBEASNL 20041
892 #define SYBENTLL 20042
893 #define SYBEASUL 20043
894 #define SYBERDNR 20044
895 #define SYBENSIP 20045
896 #define SYBEABNV 20046
897 #define SYBEDDNE 20047
898 #define SYBECUFL 20048
899 #define SYBECOFL 20049
900 #define SYBECSYN 20050
901 #define SYBECLPR 20051
902 #define SYBECNOV 20052
903 #define SYBERDCN 20053
904 #define SYBESFOV 20054
905 #define SYBEUNT 20055
906 #define SYBECLOS 20056
907 #define SYBEUAVE 20057
908 #define SYBEUSCT 20058
909 #define SYBEEQVA 20059
910 #define SYBEUDTY 20060
911 #define SYBETSIT 20061
912 #define SYBEAUTN 20062
913 #define SYBEBDIO 20063
914 #define SYBEBCNT 20064
915 #define SYBEIFNB 20065
916 #define SYBETTS 20066
917 #define SYBEKBCO 20067
918 #define SYBEBBCI 20068
919 #define SYBEKBCI 20069
920 #define SYBEBCRE 20070
921 #define SYBETPTN 20071
922 #define SYBEBCWE 20072
923 #define SYBEBCNN 20073
924 #define SYBEBCOR 20074
925 #define SYBEBCIS 20075
926 #define SYBEBCPI 20076
927 #define SYBEBCPN 20077
928 #define SYBEBCPB 20078
929 #define SYBEVDPT 20079
930 #define SYBEBIVI 20080
931 #define SYBEBCBC 20081
932 #define SYBEBCFO 20082
933 #define SYBEBCVH 20083
934 #define SYBEBCUO 20084
935 #define SYBEBCUC 20085
936 #define SYBEBUOE 20086
937 #define SYBEBUCE 20087
938 #define SYBEBWEF 20088
939 #define SYBEASTF 20089
940 #define SYBEUACS 20090
941 #define SYBEASEC 20091
942 #define SYBETMTD 20092
943 #define SYBENTTN 20093
944 #define SYBEDNTI 20094
945 #define SYBEBTMT 20095
946 #define SYBEORPF 20096
947 #define SYBEUVBF 20097
948 #define SYBEBUOF 20098
949 #define SYBEBUCF 20099
950 #define SYBEBRFF 20100
951 #define SYBEBWFF 20101
952 #define SYBEBUDF 20102
953 #define SYBEBIHC 20103
954 #define SYBEBEOF 20104
955 #define SYBEBCNL 20105
956 #define SYBEBCSI 20106
957 #define SYBEBCIT 20107
958 #define SYBEBCSA 20108
959 #define SYBENULL 20109
960 #define SYBEUNAM 20110
961 #define SYBEBCRO 20111
962 #define SYBEMPLL 20112
963 #define SYBERPIL 20113
964 #define SYBERPUL 20114
965 #define SYBEUNOP 20115
966 #define SYBECRNC 20116
967 #define SYBERTCC 20117
968 #define SYBERTSC 20118
969 #define SYBEUCRR 20119
970 #define SYBERPNA 20120
971 #define SYBEOPNA 20121
972 #define SYBEFGTL 20122
973 #define SYBECWLL 20123
974 #define SYBEUFDS 20124
975 #define SYBEUCPT 20125
976 #define SYBETMCF 20126
977 #define SYBEAICF 20127
978 #define SYBEADST 20128
979 #define SYBEALTT 20129
980 #define SYBEAPCT 20130
981 #define SYBEXOCI 20131
982 #define SYBEFSHD 20132
983 #define SYBEAOLF 20133
984 #define SYBEARDI 20134
985 #define SYBEURCI 20135
986 #define SYBEARDL 20136
987 #define SYBEURMI 20137
988 #define SYBEUREM 20138
989 #define SYBEURES 20139
990 #define SYBEUREI 20140
991 #define SYBEOREN 20141
992 #define SYBEISOI 20142
993 #define SYBEIDCL 20143
994 #define SYBEIMCL 20144
995 #define SYBEIFCL 20145
996 #define SYBEUTDS 20146
997 #define SYBEBUFF 20147
998 #define SYBEACNV 20148
999 #define SYBEDPOR 20149
1000 #define SYBENDC 20150
1001 #define SYBEMVOR 20151
1002 #define SYBEDVOR 20152
1003 #define SYBENBVP 20153
1004 #define SYBESPID 20154
1005 #define SYBENDTP 20155
1006 #define SYBEXTN 20156
1007 #define SYBEXTDN 20157
1008 #define SYBEXTSN 20158
1009 #define SYBENUM 20159
1010 #define SYBETYPE 20160
1011 #define SYBEGENOS 20161
1012 #define SYBEPAGE 20162
1013 #define SYBEOPTNO 20163
1014 #define SYBEETD 20164
1015 #define SYBERTYPE 20165
1016 #define SYBERFILE 20166
1017 #define SYBEFMODE 20167
1018 #define SYBESLCT 20168
1019 #define SYBEZTXT 20169
1020 #define SYBENTST 20170
1021 #define SYBEOSSL 20171
1022 #define SYBEESSL 20172
1023 #define SYBENLNL 20173
1024 #define SYBENHAN 20174
1025 #define SYBENBUF 20175
1026 #define SYBENULP 20176
1027 #define SYBENOTI 20177
1028 #define SYBEEVOP 20178
1029 #define SYBENEHA 20179
1030 #define SYBETRAN 20180
1031 #define SYBEEVST 20181
1032 #define SYBEEINI 20182
1033 #define SYBEECRT 20183
1034 #define SYBEECAN 20184
1035 #define SYBEEUNR 20185
1036 #define SYBERPCS 20186
1037 #define SYBETPAR 20187
1038 #define SYBETEXS 20188
1039 #define SYBETRAC 20189
1040 #define SYBETRAS 20190
1041 #define SYBEPRTF 20191
1042 #define SYBETRSN 20192
1043 #define SYBEBPKS 20193
1044 #define SYBEIPV 20194
1045 #define SYBEMOV 20195
1046 #define SYBEDIVZ 20196
1047 #define SYBEASTL 20197
1048 #define SYBESEFA 20198
1049 #define SYBEPOLL 20199
1050 #define SYBENOEV 20200
1051 #define SYBEBADPK 20201
1052 #define SYBESECURE 20202
1053 #define SYBECAP 20203
1054 #define SYBEFUNC 20204
1055 #define SYBERESP 20205
1056 #define SYBEIVERS 20206
1057 #define SYBEONCE 20207
1058 #define SYBERPNULL 20208
1059 #define SYBERPTXTIM 20209
1060 #define SYBENEG 20210
1061 #define SYBELBLEN 20211
1062 #define SYBEUMSG 20212
1063 #define SYBECAPTYP 20213
1064 #define SYBEBNUM 20214
1065 #define SYBEBBL 20215
1066 #define SYBEBPREC 20216
1067 #define SYBEBSCALE 20217
1068 #define SYBECDOMAIN 20218
1069 #define SYBECINTERNAL 20219
1070 #define SYBEBTYPSRV 20220
1071 #define SYBEBCSET 20221
1072 #define SYBEFENC 20222
1073 #define SYBEFRES 20223
1074 #define SYBEISRVPREC 20224
1075 #define SYBEISRVSCL 20225
1076 #define SYBEINUMCL 20226
1077 #define SYBEIDECCL 20227
1078 #define SYBEBCMTXT 20228
1079 #define SYBEBCPREC 20229
1080 #define SYBEBCBNPR 20230
1081 #define SYBEBCBNTYP 20231
1082 #define SYBEBCSNTYP 20232
1083 #define SYBEBCPCTYP 20233
1084 #define SYBEBCVLEN 20234
1085 #define SYBEBCHLEN 20235
1086 #define SYBEBCBPREF 20236
1087 #define SYBEBCPREF 20237
1088 #define SYBEBCITBNM 20238
1089 #define SYBEBCITBLEN 20239
1090 #define SYBEBCSNDROW 20240
1091 #define SYBEBPROCOL 20241
1092 #define SYBEBPRODEF 20242
1093 #define SYBEBPRONUMDEF 20243
1094 #define SYBEBPRODEFID 20244
1095 #define SYBEBPRONODEF 20245
1096 #define SYBEBPRODEFTYP 20246
1097 #define SYBEBPROEXTDEF 20247
1098 #define SYBEBPROEXTRES 20248
1099 #define SYBEBPROBADDEF 20249
1100 #define SYBEBPROBADTYP 20250
1101 #define SYBEBPROBADLEN 20251
1102 #define SYBEBPROBADPREC 20252
1103 #define SYBEBPROBADSCL 20253
1104 #define SYBEBADTYPE 20254
1105 #define SYBECRSNORES 20255
1106 #define SYBECRSNOIND 20256
1107 #define SYBECRSVIEW 20257
1108 #define SYBECRSVIIND 20258
1109 #define SYBECRSORD 20259
1110 #define SYBECRSBUFR 20260
1111 #define SYBECRSNOFREE 20261
1112 #define SYBECRSDIS 20262
1113 #define SYBECRSAGR 20263
1114 #define SYBECRSFRAND 20264
1115 #define SYBECRSFLAST 20265
1116 #define SYBECRSBROL 20266
1117 #define SYBECRSFROWN 20267
1118 #define SYBECRSBSKEY 20268
1119 #define SYBECRSRO 20269
1120 #define SYBECRSNOCOUNT 20270
1121 #define SYBECRSTAB 20271
1122 #define SYBECRSUPDNB 20272
1123 #define SYBECRSNOWHERE 20273
1124 #define SYBECRSSET 20274
1125 #define SYBECRSUPDTAB 20275
1126 #define SYBECRSNOUPD 20276
1127 #define SYBECRSINV 20277
1128 #define SYBECRSNOKEYS 20278
1129 #define SYBECRSNOBIND 20279
1130 #define SYBECRSFTYPE 20280
1131 #define SYBECRSINVALID 20281
1132 #define SYBECRSMROWS 20282
1133 #define SYBECRSNROWS 20283
1134 #define SYBECRSNOLEN 20284
1135 #define SYBECRSNOPTCC 20285
1136 #define SYBECRSNORDER 20286
1137 #define SYBECRSNOTABLE 20287
1138 #define SYBECRSNUNIQUE 20288
1139 #define SYBECRSVAR 20289
1140 #define SYBENOVALUE 20290
1141 #define SYBEVOIDRET 20291
1142 #define SYBECLOSEIN 20292
1143 #define SYBEBOOL 20293
1144 #define SYBEBCPOPT 20294
1145 #define SYBEERRLABEL 20295
1146 #define SYBEATTNACK 20296
1147 #define SYBEBBFL 20297
1148 #define SYBEDCL 20298
1149 #define SYBECS 20299
1150 #define SYBEBULKINSERT 20599
1151 #define SYBECOLSIZE 22000
1155 #define DBTDS(a) dbtds(a)
1156 DBINT dbtextsize(
DBPROCESS * dbprocess);
1159 DBBINARY *dbtxtsnewval(
DBPROCESS * dbprocess);
1160 RETCODE dbtxtsput(
DBPROCESS * dbprocess, DBBINARY newtxts,
int colnum);
1164 RETCODE
dbwritetext(
DBPROCESS * dbproc,
char *objname, DBBINARY * textptr, DBTINYINT textptrlen, DBBINARY * timestamp,
1165 DBBOOL log, DBINT size, BYTE * text);
1174 #define DBSETLHOST(x,y) dbsetlname((x), (y), DBSETHOST)
1175 #define dbsetlhost(x,y) dbsetlname((x), (y), DBSETHOST)
1177 #define DBSETLUSER(x,y) dbsetlname((x), (y), DBSETUSER)
1178 #define dbsetluser(x,y) dbsetlname((x), (y), DBSETUSER)
1180 #define DBSETLPWD(x,y) dbsetlname((x), (y), DBSETPWD)
1181 #define dbsetlpwd(x,y) dbsetlname((x), (y), DBSETPWD)
1182 #if defined(DBLIB_UNIMPLEMENTED)
1184 # define DBSETLHID(x,y) dbsetlname((x), (y), DBSETHID)
1187 #define DBSETLAPP(x,y) dbsetlname((x), (y), DBSETAPP)
1188 #define dbsetlapp(x,y) dbsetlname((x), (y), DBSETAPP)
1190 #define BCP_SETL(x,y) dbsetlbool((x), (y), DBSETBCP)
1191 #define DBSETLSECURE(x) dbsetlbool((x), (1), DBSETBCP)
1192 #define DBSETNATLANG 7
1193 #define DBSETLNATLANG(x,y) dbsetlname((x), (y), DBSETNATLANG)
1194 #define dbsetlnatlang(x,y) dbsetlname((x), (y), DBSETNATLANG)
1195 #if defined(DBLIB_UNIMPLEMENTED)
1196 # define DBSETNOSHORT 8
1197 # define DBSETLNOSHORT(x,y) dbsetlbool((x), (y), DBSETNOSHORT)
1198 # define DBSETHIER 9
1199 # define DBSETLHIER(x,y) dbsetlshort((x), (y), DBSETHIER)
1201 #define DBSETCHARSET 10
1202 #define DBSETLCHARSET(x,y) dbsetlname((x), (y), DBSETCHARSET)
1203 #define DBSETPACKET 11
1204 #define DBSETLPACKET(x,y) dbsetllong((x), (y), DBSETPACKET)
1205 #define dbsetlpacket(x,y) dbsetllong((x), (y), DBSETPACKET)
1206 #define DBSETENCRYPT 12
1207 #define DBSETLENCRYPT(x,y) dbsetlbool((x), (y), DBSETENCRYPT)
1208 #define DBSETLABELED 13
1209 #define DBSETLLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1210 #define BCP_SETLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1211 #define DBSETDBNAME 14
1212 #define DBSETLDBNAME(x,y) dbsetlname((x), (y), DBSETDBNAME)
1213 #define DBSETLVERSION(login, version) dbsetlversion((login), (version))
1215 RETCODE
bcp_init(
DBPROCESS * dbproc,
const char *tblname,
const char *hfile,
const char *errfile,
int direction);
1219 RETCODE
bcp_bind(
DBPROCESS * dbproc, BYTE * varaddr,
int prefixlen, DBINT varlen, BYTE * terminator,
int termlen,
int type,
1223 RETCODE
bcp_colfmt(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1224 const BYTE * host_term,
int host_termlen,
int colnum);
1225 RETCODE
bcp_colfmt_ps(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1226 BYTE * host_term,
int host_termlen,
int colnum,
DBTYPEINFO * typeinfo);
1229 int bcp_getbatchsize(
DBPROCESS * dbproc);
RETCODE bcp_readfmt(DBPROCESS *dbproc, const char filename[])
Read a format definition file.
Definition: bcp.c:1615
void dbsetavail(DBPROCESS *dbprocess)
Mark a DBPROCESS as "available".
Definition: dblib.c:7058
BYTE * dbbylist(DBPROCESS *dbproc, int computeid, int *size)
Get bylist for a compute row.
Definition: dblib.c:4818
DBINT dbspr1rowlen(DBPROCESS *dbproc)
Determine size buffer required to hold the results returned by dbsprhead(), dbsprline(), and dbspr1row().
Definition: dblib.c:3237
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:6247
BYTE * dbadata(DBPROCESS *dbproc, int computeid, int column)
Get address of compute column data.
Definition: dblib.c:4244
RETCODE dbgetrow(DBPROCESS *dbproc, DBINT row)
Read a row from the row buffer.
Definition: dblib.c:1893
int dbiowdesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to write data coming to the server...
Definition: dblib.c:7030
int dbaltop(DBPROCESS *dbproc, int computeid, int column)
Get aggregation operator for a compute column.
Definition: dblib.c:4274
RETCODE dbsqlok(DBPROCESS *dbproc)
Wait for results of a query from the server.
Definition: dblib.c:4632
RETCODE dbclropt(DBPROCESS *dbproc, int option, const char param[])
Reset an option.
Definition: dblib.c:5891
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Definition: dblib.c:6789
char * dbgetchar(DBPROCESS *dbprocess, int n)
Get address of a position in the command buffer.
Definition: dblib.c:6092
int dbmny4cmp(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2)
Compare two DBMONEY4 values.
Definition: dblib.c:5531
RETCODE dbmnyzero(DBPROCESS *dbproc, DBMONEY *dest)
Set a DBMONEY value to zero.
Definition: dblib.c:5143
BYTE * dbretdata(DBPROCESS *dbproc, int retnum)
Get value of an output parameter filled by a stored procedure.
Definition: dblib.c:4568
DBINT dbcolutype(DBPROCESS *dbprocess, int column)
Get user-defined datatype of a regular result column.
Definition: dblib.c:2879
RETCODE dbrpcsend(DBPROCESS *dbproc)
Execute the procedure and free associated memory.
Definition: rpc.c:277
DBINT dbprcollen(DBPROCESS *dbproc, int column)
Get size of a result column needed to print column.
Definition: dblib.c:3076
DBINT dbaltlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in compute column.
Definition: dblib.c:6920
RETCODE dbuse(DBPROCESS *dbproc, const char *name)
Change current database.
Definition: dblib.c:1426
RETCODE dbmnymaxneg(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum negative DBMONEY value supported.
Definition: dblib.c:5185
STATUS dbreadtext(DBPROCESS *dbproc, void *buf, DBINT bufsize)
Fetch part of a text or image value from the server.
Definition: dblib.c:6445
void dbsetuserdata(DBPROCESS *dbproc, BYTE *ptr)
Associate client-allocated (and defined) data with a DBPROCESS.
Definition: dblib.c:5737
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition: dblib.c:4940
RETCODE dbmny4copy(DBPROCESS *dbprocess, DBMONEY4 *m1, DBMONEY4 *m2)
Copy a DBMONEY4 value.
Definition: dblib.c:5559
int dbstrbuild(DBPROCESS *dbproc, char *charbuf, int bufsize, char *text, char *formats,...)
Build a printable string from text containing placeholders for variables.
Definition: dblib.c:7083
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition: dblib.c:716
RETCODE dbmny4sub(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *diff)
Subtract two DBMONEY4 values.
Definition: dblib.c:5443
RETCODE dbprrow(DBPROCESS *dbproc)
Print a result set to stdout.
Definition: dblib.c:3357
int dbstrlen(DBPROCESS *dbproc)
Get size of the command buffer, in bytes.
Definition: dblib.c:6073
int dbgettime(void)
Get maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4043
DBBOOL bcp_getl(LOGINREC *login)
See if BCP_SETL() was used to set the LOGINREC for BCP work.
Definition: bcp.c:694
RETCODE dbmorecmds(DBPROCESS *dbproc)
See if more commands are to be processed.
Definition: dblib.c:6017
BYTE * dbdata(DBPROCESS *dbproc, int column)
Get address of data in a regular result column.
Definition: dblib.c:3179
RETCODE dbmnymaxpos(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum positive DBMONEY value supported.
Definition: dblib.c:5164
RETCODE dbsetnull(DBPROCESS *dbprocess, int bindtype, int bindlen, BYTE *bindval)
Define substitution values to be used when binding null values.
Definition: dblib.c:1925
RETCODE dbsetlname(LOGINREC *login, const char *value, int which)
Set the value of a string in a LOGINREC structure.
Definition: dblib.c:770
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:264
RETCODE dbcmdrow(DBPROCESS *dbproc)
See if the current command can return rows.
Definition: dblib.c:4080
RETCODE dbrpcparam(DBPROCESS *dbproc, const char paramname[], BYTE status, int type, DBINT maxlen, DBINT datalen, BYTE *value)
Add a parameter to a remote procedure call.
Definition: rpc.c:155
RETCODE dbsqlsend(DBPROCESS *dbproc)
Transmit the command buffer to the server.
Definition: dblib.c:6825
RETCODE dbmoretext(DBPROCESS *dbproc, DBINT size, const BYTE text[])
Send chunk of a text/image value to the server.
Definition: dblib.c:6514
DBINT dbaltutype(DBPROCESS *dbproc, int computeid, int column)
Get user-defined datatype of a compute column.
Definition: dblib.c:6896
void dbfreebuf(DBPROCESS *dbproc)
Erase the command buffer, in case DBNOAUTOFREE was set with dbsetopt().
Definition: dblib.c:5857
int dbnumalts(DBPROCESS *dbproc, int computeid)
Get count of columns in a compute row.
Definition: dblib.c:4759
RETCODE dbbind(DBPROCESS *dbproc, int column, int vartype, DBINT varlen, BYTE *varaddr)
Tie a host variable to a resultset column.
Definition: dblib.c:2593
RETCODE dbmny4zero(DBPROCESS *dbproc, DBMONEY4 *dest)
Zero a DBMONEY4 value.
Definition: dblib.c:5389
RETCODE dbsetlbool(LOGINREC *login, int value, int which)
Set a boolean value in a LOGINREC structure.
Definition: dblib.c:902
void dbexit(void)
Close server connections and free all related structures.
Definition: dblib.c:1538
DBTYPEINFO * dbcoltypeinfo(DBPROCESS *dbproc, int column)
Get precision and scale information for a regular result column.
Definition: dblib.c:2902
int dbtds(DBPROCESS *dbprocess)
Get the TDS version in use for dbproc.
Definition: dblib.c:6583
RETCODE dbpivot(DBPROCESS *dbproc, int nkeys, int *keys, int ncols, int *cols, DBPIVOT_FUNC func, int val)
Pivot the rows, creating a new resultset.
Definition: dbpivot.c:901
RETCODE dbspr1row(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print a regular result row to a buffer.
Definition: dblib.c:3275
STATUS dbrowtype(DBPROCESS *dbprocess)
Get returned row's type.
Definition: dblib.c:5983
DBBOOL dbdead(DBPROCESS *dbproc)
Check if dbproc is an ex-parrot.
Definition: dblib.c:4877
RETCODE dbsetlogintime(int seconds)
Set maximum seconds db-lib waits for a server response to a login attempt.
Definition: dblib.c:4059
int dbmnycmp(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2)
Compare two DBMONEY values.
Definition: dblib.c:5085
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition: dblib.c:2850
RETCODE dbsetopt(DBPROCESS *dbproc, int option, const char *char_param, int int_param)
Set db-lib or server option.
Definition: dblib.c:4302
RETCODE dbaltbind(DBPROCESS *dbprocess, int computeid, int column, int vartype, DBINT varlen, BYTE *varaddr)
Bind a compute column to a program variable.
Definition: dblib.c:4198
DBBOOL dbisopt(DBPROCESS *dbproc, int option, const char param[])
Get value of an option.
Definition: dblib.c:5943
RETCODE dbcanquery(DBPROCESS *dbproc)
Cancel the query currently being retrieved, discarding all pending rows.
Definition: dblib.c:5827
int dbiordesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to read data coming from the server...
Definition: dblib.c:7014
RETCODE dbrpcinit(DBPROCESS *dbproc, const char rpcname[], DBSMALLINT options)
Initialize a remote procedure call.
Definition: rpc.c:72
DBINT dbvarylen(DBPROCESS *dbproc, int column)
Determine whether a column can vary in size.
Definition: dblib.c:3102
RETCODE dbmnyinc(DBPROCESS *dbproc, DBMONEY *mnyptr)
Add $0.0001 to a DBMONEY value.
Definition: dblib.c:5282
DBINT dbconvert_ps(DBPROCESS *dbprocess, int srctype, const BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen, DBTYPEINFO *typeinfo)
Convert one datatype to another.
Definition: dblib.c:2236
char * dbretname(DBPROCESS *dbproc, int retnum)
Get name of an output parameter filled by a stored procedure.
Definition: dblib.c:4539
void dbclose(DBPROCESS *dbproc)
Close a connection to the server and free associated resources.
Definition: dblib.c:1469
RETCODE bcp_sendrow(DBPROCESS *dbproc)
Write data in host variables to the table.
Definition: bcp.c:1327
BOOL dbiscount(DBPROCESS *dbproc)
Indicates whether or not the count returned by dbcount is real (Microsoft-compatibility feature)...
Definition: dblib.c:2763
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:6376
char * dbservcharset(DBPROCESS *dbprocess)
Get syscharset name of the server character set.
Definition: dblib.c:6805
void dbprhead(DBPROCESS *dbproc)
Print result set headings to stdout.
Definition: dblib.c:3781
char * dbchange(DBPROCESS *dbprocess)
See if a command caused the current database to change.
Definition: dblib.c:6769
RETCODE dbmny4minus(DBPROCESS *dbproc, DBMONEY4 *src, DBMONEY4 *dest)
Negate a DBMONEY4 value.
Definition: dblib.c:5365
int dbnumcompute(DBPROCESS *dbprocess)
Get count of COMPUTE clauses for a result set.
Definition: dblib.c:4792
RETCODE bcp_exec(DBPROCESS *dbproc, DBINT *rows_copied)
Write a datafile to a table.
Definition: bcp.c:1554
STATUS dbsetrow(DBPROCESS *dbprocess, DBINT row)
Make a buffered row "current" without fetching it into bound variables.
Definition: dblib.c:2004
BYTE * dbgetuserdata(DBPROCESS *dbproc)
Get address of user-allocated data from a DBPROCESS.
Definition: dblib.c:5755
DBINT dblastrow(DBPROCESS *dbproc)
Get number of the last row in the row buffer.
Definition: dblib.c:6990
RETCODE bcp_columns(DBPROCESS *dbproc, int host_colcount)
Indicate how many columns are to be found in the datafile.
Definition: bcp.c:299
RETCODE dbsetmaxprocs(int maxprocs)
Set maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3921
int dbnumcols(DBPROCESS *dbproc)
Return number of regular columns in a result set.
Definition: dblib.c:1837
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition: bcp.c:536
DBINT bcp_done(DBPROCESS *dbproc)
Conclude the transfer of data from program variables.
Definition: bcp.c:1967
RETCODE bcp_colfmt_ps(DBPROCESS *dbproc, int host_column, int host_type, int host_prefixlen, DBINT host_collen, BYTE *host_term, int host_termlen, int colnum, DBTYPEINFO *typeinfo)
Specify the format of a host file for bulk copy purposes, with precision and scale support for numeri...
Definition: bcp.c:501
int dbalttype(DBPROCESS *dbproc, int computeid, int column)
Get datatype for a compute column.
Definition: dblib.c:4162
RETCODE dbmnyminus(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Negate a DBMONEY value.
Definition: dblib.c:5338
RETCODE dbcancel(DBPROCESS *dbproc)
Cancel the current command batch.
Definition: dblib.c:3212
DBINT dbconvert(DBPROCESS *dbproc, int srctype, const BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen)
cf.
Definition: dblib.c:2554
RETCODE dbsprhead(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print result set headings to a buffer.
Definition: dblib.c:3718
DBBOOL dbhasretstat(DBPROCESS *dbproc)
Determine if query generated a return status number.
Definition: dblib.c:4465
const char * dbprtype(int token)
Print a token value's name to a buffer.
Definition: dblib.c:6230
void dbrecftos(const char filename[])
Record to a file all SQL commands sent to the server.
Definition: dblib.c:6549
int dbgetmaxprocs(void)
get maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3995
RETCODE dbrows(DBPROCESS *dbproc)
Indicate whether a query returned rows.
Definition: dblib.c:3856
DBBINARY * dbtxtimestamp(DBPROCESS *dbproc, int column)
Get text timestamp for a column in the current row.
Definition: dblib.c:6309
RETCODE dbdatecrack(DBPROCESS *dbproc, DBDATEREC *di, DBDATETIME *dt)
Break a DBDATETIME value into useful pieces.
Definition: dblib.c:5629
int dbrettype(DBPROCESS *dbproc, int retnum)
Get datatype of a stored procedure's return parameter.
Definition: dblib.c:6048
RETCODE bcp_colptr(DBPROCESS *dbproc, BYTE *colptr, int table_column)
Override bcp_bind() by pointing to a different host variable.
Definition: bcp.c:658
RETCODE dbsprline(DBPROCESS *dbproc, char *buffer, DBINT buf_len, DBCHAR line_char)
Get formatted string for underlining dbsprhead() column names.
Definition: dblib.c:3660
DBINT dbdatlen(DBPROCESS *dbproc, int column)
Get size of current row's data in a regular result column.
Definition: dblib.c:3151
RETCODE dbmny4add(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *sum)
Add two DBMONEY4 values.
Definition: dblib.c:5412
DBPROCESS * dbopen(LOGINREC *login, const char *server)
Normally not used.
Definition: dbopen.c:35
DBINT dbcount(DBPROCESS *dbproc)
Get count of rows processed.
Definition: dblib.c:2783
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:6169
RETCODE dbinit(void)
Initialize db-lib.
Definition: dblib.c:671
DBINT dbfirstrow(DBPROCESS *dbproc)
See if a server response has arrived.
Definition: dblib.c:6975
void dbclrbuf(DBPROCESS *dbproc, DBINT n)
Clear n rows from the row buffer.
Definition: dblib.c:2803
RETCODE dbfcmd(DBPROCESS *dbproc, const char *fmt,...)
printf-like way to form SQL to send to the server.
Definition: dblib.c:1309
RETCODE dbanullbind(DBPROCESS *dbprocess, int computeid, int column, DBINT *indicator)
Tie a null-indicator to a compute result column.
Definition: dblib.c:2735
RETCODE dbmnycopy(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Copy a DBMONEY value.
Definition: dblib.c:5806
int dbretlen(DBPROCESS *dbproc, int retnum)
Get size of an output parameter filled by a stored procedure.
Definition: dblib.c:4597
RETCODE dbsetversion(DBINT version)
Specify a db-lib version level.
Definition: dblib.c:5773
RETCODE dbcolinfo(DBPROCESS *dbproc, CI_TYPE type, DBINT column, DBINT computeid, DBCOL *pdbcol)
Get a bunch of column attributes with a single call (Microsoft-compatibility feature).
Definition: dblib.c:2931
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition: dblib.c:1685
RETCODE dbnullbind(DBPROCESS *dbproc, int column, DBINT *indicator)
Tie a null-indicator to a regular result column.
Definition: dblib.c:2699
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition: dblib.c:1400
RETCODE dbstrcpy(DBPROCESS *dbproc, int start, int numbytes, char *dest)
Get a copy of a chunk of the command buffer.
Definition: dblib.c:6125
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
DBINT dbcollen(DBPROCESS *dbproc, int column)
Get size of a regular result column.
Definition: dblib.c:3053
int dbnumrets(DBPROCESS *dbproc)
Get count of output parameters filled by a stored procedure.
Definition: dblib.c:4507
void dbsetinterrupt(DBPROCESS *dbproc, DB_DBCHKINTR_FUNC chkintr, DB_DBHNDLINTR_FUNC hndlintr)
Set interrupt handler for db-lib to use while blocked against a read from the server.
Definition: dblib.c:4446
DBPROCESS * tdsdbopen(LOGINREC *login, const char *server, int msdblib)
Form a connection with the server.
Definition: dblib.c:1160
RETCODE dbsettime(int seconds)
Set maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4016
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
Definition: dblib.c:1348
DBINT dbcurrow(DBPROCESS *dbproc)
Get number of the row currently being read.
Definition: dblib.c:5966
int dbdatecmp(DBPROCESS *dbproc, DBDATETIME *d1, DBDATETIME *d2)
Compare DBDATETIME values, similar to strcmp(3).
Definition: dblib.c:5584
RETCODE bcp_bind(DBPROCESS *dbproc, BYTE *varaddr, int prefixlen, DBINT varlen, BYTE *terminator, int termlen, int type, int table_column)
Bind a program host variable to a database column.
Definition: bcp.c:2009
DBINT bcp_batch(DBPROCESS *dbproc)
Commit a set of rows to the table.
Definition: bcp.c:1940
DBBINARY * dbtxptr(DBPROCESS *dbproc, int column)
Get text pointer for a column in the current row.
Definition: dblib.c:6339
DBINT dbretstatus(DBPROCESS *dbproc)
Fetch status value returned by query or remote procedure call.
Definition: dblib.c:4489
const char * dbmonthname(DBPROCESS *dbproc, char *language, int monthnum, DBBOOL shortform)
Get name of a month, in some human language.
Definition: dblib.c:6740
char * dbcolname(DBPROCESS *dbproc, int column)
Return name of a regular result column.
Definition: dblib.c:1861
RETCODE bcp_options(DBPROCESS *dbproc, int option, BYTE *value, int valuelen)
Set "hints" for uploading a file.
Definition: bcp.c:610
void dbsetifile(char *filename)
set name and location of the interfaces file FreeTDS should use to look up a servername.
Definition: dblib.c:2670
char * dbcolsource(DBPROCESS *dbproc, int colnum)
Get base database column name for a result set column.
Definition: dblib.c:3028
int dbgetpacket(DBPROCESS *dbproc)
Get TDS packet size for the connection.
Definition: dblib.c:3897
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition: dblib.c:4959
RETCODE bcp_colfmt(DBPROCESS *dbproc, int host_column, int host_type, int host_prefixlen, DBINT host_collen, const BYTE *host_term, int host_termlen, int colnum)
Specify the format of a datafile prior to writing to a table.
Definition: bcp.c:375
int dbspid(DBPROCESS *dbproc)
Get server process ID for a DBPROCESS.
Definition: dblib.c:5711
DBBOOL dbwillconvert(int srctype, int desttype)
Test whether or not a datatype can be converted to another datatype.
Definition: dblib.c:2833
void dbloginfree(LOGINREC *login)
free the LOGINREC
Definition: dblib.c:748
int dbcurcmd(DBPROCESS *dbproc)
Get number of the row just returned.
Definition: dblib.c:6000
Definition: dbpivot.c:757
Definition: bsqlodbc.c:97
RETCODE dbmnydec(DBPROCESS *dbproc, DBMONEY *mnyptr)
Subtract $0.0001 from a DBMONEY value.
Definition: dblib.c:5310
int dbaltcolid(DBPROCESS *dbproc, int computeid, int column)
Get column ID of a compute column.
Definition: dblib.c:4104
const char * dbversion(void)
See which version of db-lib is in use.
Definition: dblib.c:6622
RETCODE dbsetlversion(LOGINREC *login, BYTE version)
Set TDS version for future connections.
Definition: dblib.c:931
DBINT dbadlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in a compute column.
Definition: dblib.c:4131
RETCODE dbsetllong(LOGINREC *login, long value, int which)
Set an integer value in a LOGINREC structure.
Definition: dblib.c:831