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))
45 static const char rcsid_sybdb_h[] =
"$Id: sybdb.h,v 1.100.2.1 2011-06-06 12:31:45 freddy77 Exp $";
46 static const void *
const no_unused_sybdb_h_warn[] = { rcsid_sybdb_h, no_unused_sybdb_h_warn };
62 #define INT_CONTINUE 1
66 #define DBMAXNUMLEN 33
72 #define DBVERSION_UNKNOWN 0
73 #define DBVERSION_46 1
74 #define DBVERSION_100 2
75 #define DBVERSION_42 3
76 #define DBVERSION_70 4
77 #define DBVERSION_71 5
78 #define DBVERSION_80 DBVERSION_71
79 #define DBVERSION_72 6
82 #define DBVER42 DBVERSION_42
83 #define DBVER60 DBVERSION_70
89 #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)
151 #if !defined(_FREETDS_LIBRARY_SOURCE) || !defined(_tds_h_)
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];
344 #define DBPARSEONLY 0
348 #define DBARITHIGNORE 4
350 #define DBARITHABORT 6
351 #define DBTEXTLIMIT 7
357 #define DBSTORPROCID 13
359 #define DBNOAUTOFREE 15
360 #define DBROWCOUNT 16
361 #define DBTEXTSIZE 17
363 #define DBDATEFORMAT 19
365 #define DBPRCOLSEP 21
366 #define DBPRLINELEN 22
367 #define DBPRLINESEP 23
368 #define DBLFCONVERT 24
369 #define DBDATEFIRST 25
370 #define DBCHAINXACTS 26
371 #define DBFIPSFLAG 27
372 #define DBISOLATION 28
374 #define DBIDENTITY 30
376 #define DBDATESHORT 32
377 #define DBCLIENTCURSORS 33
379 #define DBQUOTEDIDENT 35
381 #define DBNUMOPTIONS 36
389 #define NOSUCHOPTION 2
391 #define MAXOPTTEXT 32
441 typedef int (*EHANDLEFUNC) (
DBPROCESS * dbproc,
int severity,
int dberr,
int oserr,
char *dberrstr,
char *oserrstr);
443 typedef int (*MHANDLEFUNC) (
DBPROCESS * dbproc, DBINT msgno,
int msgstate,
int severity,
char *msgtext,
char *srvname,
444 char *proc,
int line);
448 #define DBNOTIFICATION 2
450 #define DBINTERRUPT 4
458 #define NTBSTRINGBIND 2
459 #define VARYCHARBIND 3
460 #define VARYBINBIND 4
466 #define DATETIMEBIND 11
467 #define SMALLDATETIMEBIND 12
469 #define SMALLMONEYBIND 14
470 #define BINARYBIND 15
472 #define NUMERICBIND 17
473 #define DECIMALBIND 18
474 #define BIGINTBIND 30
475 #define MAXBINDTYPES 31
477 #define DBPRCOLSEP 21
478 #define DBPRLINELEN 22
479 #define DBRPCRETURN 1
480 #define DBRPCDEFAULT 2
484 #define NO_MORE_ROWS -2
486 #define NO_MORE_RESULTS 2
492 #define DB_QUERYOUT 3
499 #define DBRPCRECOMPILE TDS_STATIC_CAST(DBSMALLINT, 0x0001)
500 #define DBRPCRESET TDS_STATIC_CAST(DBSMALLINT, 0x0002)
501 #define DBRPCCURSOR TDS_STATIC_CAST(DBSMALLINT, 0x0008)
503 #if defined(DBLIB_UNIMPLEMENTED)
504 DBBOOL db12hour(
DBPROCESS * dbprocess,
const char language[]);
506 DBBOOL dbcolbrowse(
DBPROCESS * dbprocess,
int colnum);
508 RETCODE dbcursor(DBCURSOR * hc, DBINT optype, DBINT bufno, BYTE * table, BYTE * values);
509 RETCODE dbcursorbind(DBCURSOR * hc,
int col,
int vartype, DBINT varlen, DBINT * poutlen, BYTE * pvaraddr,
DBTYPEINFO * typeinfo);
510 void dbcursorclose(DBCURSOR * hc);
511 RETCODE dbcursorcolinfo(DBCURSOR * hc, DBINT column, DBCHAR * colname, DBINT * coltype, DBINT * collen, DBINT * usertype);
512 RETCODE dbcursorfetch(DBCURSOR * hc, DBINT fetchtype, DBINT rownum);
513 RETCODE dbcursorinfo(DBCURSOR * hc, DBINT * ncols, DBINT * nrows);
514 DBCURSOR *dbcursoropen(
DBPROCESS * dbprocess, BYTE * stmt, SHORT scollopt, SHORT concuropt, USHORT nrows, DBINT * pstatus);
518 RETCODE dbdatechar(
DBPROCESS * dbprocess,
char *buf,
int datepart,
int value);
520 char *dateorder(
DBPROCESS * dbprocess,
char *language);
523 char *dbdayname(
DBPROCESS * dbprocess,
char *language,
int daynum);
525 int dbgetoff(
DBPROCESS * dbprocess, DBUSMALLINT offtype,
int startfrom);
527 char *dbqual(
DBPROCESS * dbprocess,
int tabnum,
char *tabname);
528 void dbfreequal(
char *qualptr);
530 DBSORTORDER *dbloadsort(
DBPROCESS * dbprocess);
531 RETCODE dbfreesort(
DBPROCESS * dbprocess, DBSORTORDER * sortorder);
533 RETCODE dbload_xlate(
DBPROCESS * dbprocess,
char *srv_charset,
char *clt_name, DBXLATE ** xlt_tosrv, DBXLATE ** xlt_todisp);
539 RETCODE dbmnydown(
DBPROCESS * dbproc,
DBMONEY * mnyptr,
int divisor,
int *remainder);
540 RETCODE dbmnyinit(
DBPROCESS * dbproc,
DBMONEY * mnyptr,
int trim, DBBOOL * negative);
541 RETCODE dbmnyndigit(
DBPROCESS * dbproc,
DBMONEY * mnyptr, DBCHAR * value, DBBOOL * zero);
543 RETCODE dbmnydigit(
DBPROCESS * dbprocess,
DBMONEY * m1, DBCHAR * value, DBBOOL * zero);
544 RETCODE dbmnyscale(
DBPROCESS * dbproc,
DBMONEY * dest,
int multiplier,
int addend);
547 RETCODE dbnpcreate(
DBPROCESS * dbprocess);
548 RETCODE dbnpdefine(
DBPROCESS * dbprocess, DBCHAR * procedure_name, DBSMALLINT namelen);
552 RETCODE dbpoll(
DBPROCESS * dbproc,
long milliseconds,
DBPROCESS ** ready_dbproc,
int *return_reason);
553 int dbordercol(
DBPROCESS * dbprocess,
int order);
555 RETCODE dbregdrop(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
556 RETCODE dbregexec(
DBPROCESS * dbproc, DBUSMALLINT options);
557 RETCODE dbreghandle(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, INTFUNCPTR handler);
558 RETCODE dbreginit(
DBPROCESS * dbproc, DBCHAR * procedure_name, DBSMALLINT namelen);
560 RETCODE dbregnowatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
561 RETCODE dbregparam(
DBPROCESS * dbproc,
char *param_name,
int type, DBINT datalen, BYTE * data);
562 RETCODE dbregwatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, DBUSMALLINT options);
563 RETCODE dbregwatchlist(
DBPROCESS * dbprocess);
566 RETCODE dbrpwset(
LOGINREC * login,
char *srvname,
char *password,
int pwlen);
568 DBINT dbreadpage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, BYTE * buf);
569 RETCODE dbwritepage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, DBINT size, BYTE * buf);
571 RETCODE dbsetdeflang(
char *language);
573 int dbstrcmp(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
574 int dbstrsort(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
576 DBBOOL dbtabbrowse(
DBPROCESS * dbprocess,
int tabnum);
578 char *dbtabname(
DBPROCESS * dbprocess,
int tabnum);
579 char *dbtabsoruce(
DBPROCESS * dbprocess,
int colnum,
int *tabnum);
581 RETCODE dbsetlshort(
LOGINREC * login,
int value,
int which);
583 RETCODE dbsendpassthru(
DBPROCESS * dbprocess, DBVOIDPTR bufp);
584 RETCODE dbrecvpassthru(
DBPROCESS * dbprocess, DBVOIDPTR * bufp);
586 RETCODE dbgetloginfo(
DBPROCESS * dbprocess, DBLOGINFO ** loginfo);
587 RETCODE dbsetloginfo(
LOGINREC * loginrec, DBLOGINFO * loginfo);
590 DBBINARY *dbtsnewval(
DBPROCESS * dbprocess);
591 RETCODE dbtsput(
DBPROCESS * dbprocess, DBBINARY * newts,
int newtslen,
int tabnum,
char *tabname);
593 RETCODE dbfree_xlate(
DBPROCESS * dbprocess, DBXLATE * xlt_tosrv, DBXLATE * clt_todisp);
594 int dbxlate(
DBPROCESS * dbprocess,
char *src,
int srclen,
char *dest,
int destlen, DBXLATE * xlt,
int *srcbytes_used,
595 DBBOOL srcend,
int status);
597 RETCODE bcp_moretext(
DBPROCESS * dbproc, DBINT size, BYTE * text);
598 RETCODE bcp_writefmt(
DBPROCESS * dbproc,
const char filename[]);
600 void build_xact_string(
char *xact_name,
char *service_name, DBINT commid,
char *result);
601 RETCODE remove_xact(
DBPROCESS * connect, DBINT commid,
int n);
602 RETCODE abort_xact(
DBPROCESS * connect, DBINT commid);
604 RETCODE commit_xact(
DBPROCESS * connect, DBINT commid);
606 RETCODE scan_xact(
DBPROCESS * connect, DBINT commid);
607 DBINT start_xact(
DBPROCESS * connect,
char *application_name,
char *xact_name,
int site_count);
608 DBINT stat_xact(
DBPROCESS * connect, DBINT commid);
614 RETCODE
dbaltbind(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
615 RETCODE dbaltbind_ps(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
623 RETCODE
dbbind(
DBPROCESS * dbproc,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
624 RETCODE dbbind_ps(
DBPROCESS * dbprocess,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
DBTYPEINFO * typeinfo);
630 DBBOOL dbcharsetconv(
DBPROCESS * dbprocess);
637 #define DBCMDROW(x) dbcmdrow((x))
646 DBINT
dbconvert(
DBPROCESS * dbproc,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen);
647 DBINT
dbconvert_ps(
DBPROCESS * dbprocess,
int srctype, BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen,
652 #define DBCOUNT(x) dbcount((x))
655 #define DBCURCMD(x) dbcurcmd((x))
658 #define DBCURROW(x) dbcurrow((x))
665 #define DBDEAD(x) dbdead((x))
671 #define DBFIRSTROW(x) dbfirstrow((x))
674 char *dbgetcharset(
DBPROCESS * dbprocess);
675 int dbgetlusername(
LOGINREC * login, BYTE * name_buffer,
int buffer_len);
677 char *dbgetnatlanf(
DBPROCESS * dbprocess);
681 #define DBGETTIME dbgettime
687 #define DBIORDESC(x) dbiordesc((x))
690 #define DBIOWDESC(x) dbiowdesc((x))
693 #define DBISAVAIL(x) dbisavail((x))
697 #define DBLASTROW(x) dblastrow((x))
723 #define DBMORECMDS(x) dbmorecmds((x))
737 #define dbopen(x,y) tdsdbopen((x),(y), 1)
739 #define dbopen(x,y) tdsdbopen((x),(y), 0)
743 #ifdef PHP_SYBASE_DBOPEN
744 #undef PHP_SYBASE_DBOPEN
745 #define PHP_SYBASE_DBOPEN dbopen
755 RETCODE dbresults_r(
DBPROCESS * dbproc,
int recursive);
763 #define DBROWS(x) dbrows((x))
766 #define DBROWTYPE(x) dbrowtype((x))
768 RETCODE
dbrpcparam(
DBPROCESS * dbproc,
const char paramname[], BYTE status,
int type, DBINT maxlen, DBINT datalen, BYTE * value);
770 RETCODE
dbsafestr(
DBPROCESS * dbproc,
const char *src, DBINT srclen,
char *dest, DBINT destlen,
int quotetype);
771 RETCODE *dbsechandle(DBINT type, INTFUNCPTR handler);
774 void dbsetbusy(
DBPROCESS * dbprocess, DB_DBBUSY_FUNC busyfunc);
775 RETCODE dbsetdefcharset(
char *charset);
776 void dbsetidle(
DBPROCESS * dbprocess, DB_DBIDLE_FUNC idlefunc);
782 RETCODE
dbsetopt(
DBPROCESS * dbproc,
int option,
const char *char_param,
int int_param);
796 int dbstrbuild(
DBPROCESS * dbproc,
char *charbuf,
int bufsize,
char *text,
char *formats, ...);
801 #define SYBEVERDOWN 100
802 #define SYBEICONVIU 2400
803 #define SYBEICONVAVAIL 2401
804 #define SYBEICONVO 2402
805 #define SYBEICONVI 2403
806 #define SYBEICONV2BIG 2404
809 #define SYBETDSVER 2410
810 #define SYBEPORT 2500
811 #define SYBESYNC 20001
812 #define SYBEFCON 20002
813 #define SYBETIME 20003
814 #define SYBEREAD 20004
815 #define SYBEBUFL 20005
816 #define SYBEWRIT 20006
817 #define SYBEVMS 20007
818 #define SYBESOCK 20008
819 #define SYBECONN 20009
820 #define SYBEMEM 20010
821 #define SYBEDBPS 20011
822 #define SYBEINTF 20012
823 #define SYBEUHST 20013
824 #define SYBEPWD 20014
825 #define SYBEOPIN 20015
826 #define SYBEINLN 20016
827 #define SYBESEOF 20017
828 #define SYBESMSG 20018
829 #define SYBERPND 20019
830 #define SYBEBTOK 20020
831 #define SYBEITIM 20021
832 #define SYBEOOB 20022
833 #define SYBEBTYP 20023
834 #define SYBEBNCR 20024
835 #define SYBEIICL 20025
836 #define SYBECNOR 20026
837 #define SYBENPRM 20027
838 #define SYBEUVDT 20028
839 #define SYBEUFDT 20029
840 #define SYBEWAID 20030
841 #define SYBECDNS 20031
842 #define SYBEABNC 20032
843 #define SYBEABMT 20033
844 #define SYBEABNP 20034
845 #define SYBEAAMT 20035
846 #define SYBENXID 20036
847 #define SYBERXID 20037
848 #define SYBEICN 20038
849 #define SYBENMOB 20039
850 #define SYBEAPUT 20040
851 #define SYBEASNL 20041
852 #define SYBENTLL 20042
853 #define SYBEASUL 20043
854 #define SYBERDNR 20044
855 #define SYBENSIP 20045
856 #define SYBEABNV 20046
857 #define SYBEDDNE 20047
858 #define SYBECUFL 20048
859 #define SYBECOFL 20049
860 #define SYBECSYN 20050
861 #define SYBECLPR 20051
862 #define SYBECNOV 20052
863 #define SYBERDCN 20053
864 #define SYBESFOV 20054
865 #define SYBEUNT 20055
866 #define SYBECLOS 20056
867 #define SYBEUAVE 20057
868 #define SYBEUSCT 20058
869 #define SYBEEQVA 20059
870 #define SYBEUDTY 20060
871 #define SYBETSIT 20061
872 #define SYBEAUTN 20062
873 #define SYBEBDIO 20063
874 #define SYBEBCNT 20064
875 #define SYBEIFNB 20065
876 #define SYBETTS 20066
877 #define SYBEKBCO 20067
878 #define SYBEBBCI 20068
879 #define SYBEKBCI 20069
880 #define SYBEBCRE 20070
881 #define SYBETPTN 20071
882 #define SYBEBCWE 20072
883 #define SYBEBCNN 20073
884 #define SYBEBCOR 20074
885 #define SYBEBCIS 20075
886 #define SYBEBCPI 20076
887 #define SYBEBCPN 20077
888 #define SYBEBCPB 20078
889 #define SYBEVDPT 20079
890 #define SYBEBIVI 20080
891 #define SYBEBCBC 20081
892 #define SYBEBCFO 20082
893 #define SYBEBCVH 20083
894 #define SYBEBCUO 20084
895 #define SYBEBCUC 20085
896 #define SYBEBUOE 20086
897 #define SYBEBUCE 20087
898 #define SYBEBWEF 20088
899 #define SYBEASTF 20089
900 #define SYBEUACS 20090
901 #define SYBEASEC 20091
902 #define SYBETMTD 20092
903 #define SYBENTTN 20093
904 #define SYBEDNTI 20094
905 #define SYBEBTMT 20095
906 #define SYBEORPF 20096
907 #define SYBEUVBF 20097
908 #define SYBEBUOF 20098
909 #define SYBEBUCF 20099
910 #define SYBEBRFF 20100
911 #define SYBEBWFF 20101
912 #define SYBEBUDF 20102
913 #define SYBEBIHC 20103
914 #define SYBEBEOF 20104
915 #define SYBEBCNL 20105
916 #define SYBEBCSI 20106
917 #define SYBEBCIT 20107
918 #define SYBEBCSA 20108
919 #define SYBENULL 20109
920 #define SYBEUNAM 20110
921 #define SYBEBCRO 20111
922 #define SYBEMPLL 20112
923 #define SYBERPIL 20113
924 #define SYBERPUL 20114
925 #define SYBEUNOP 20115
926 #define SYBECRNC 20116
927 #define SYBERTCC 20117
928 #define SYBERTSC 20118
929 #define SYBEUCRR 20119
930 #define SYBERPNA 20120
931 #define SYBEOPNA 20121
932 #define SYBEFGTL 20122
933 #define SYBECWLL 20123
934 #define SYBEUFDS 20124
935 #define SYBEUCPT 20125
936 #define SYBETMCF 20126
937 #define SYBEAICF 20127
938 #define SYBEADST 20128
939 #define SYBEALTT 20129
940 #define SYBEAPCT 20130
941 #define SYBEXOCI 20131
942 #define SYBEFSHD 20132
943 #define SYBEAOLF 20133
944 #define SYBEARDI 20134
945 #define SYBEURCI 20135
946 #define SYBEARDL 20136
947 #define SYBEURMI 20137
948 #define SYBEUREM 20138
949 #define SYBEURES 20139
950 #define SYBEUREI 20140
951 #define SYBEOREN 20141
952 #define SYBEISOI 20142
953 #define SYBEIDCL 20143
954 #define SYBEIMCL 20144
955 #define SYBEIFCL 20145
956 #define SYBEUTDS 20146
957 #define SYBEBUFF 20147
958 #define SYBEACNV 20148
959 #define SYBEDPOR 20149
960 #define SYBENDC 20150
961 #define SYBEMVOR 20151
962 #define SYBEDVOR 20152
963 #define SYBENBVP 20153
964 #define SYBESPID 20154
965 #define SYBENDTP 20155
966 #define SYBEXTN 20156
967 #define SYBEXTDN 20157
968 #define SYBEXTSN 20158
969 #define SYBENUM 20159
970 #define SYBETYPE 20160
971 #define SYBEGENOS 20161
972 #define SYBEPAGE 20162
973 #define SYBEOPTNO 20163
974 #define SYBEETD 20164
975 #define SYBERTYPE 20165
976 #define SYBERFILE 20166
977 #define SYBEFMODE 20167
978 #define SYBESLCT 20168
979 #define SYBEZTXT 20169
980 #define SYBENTST 20170
981 #define SYBEOSSL 20171
982 #define SYBEESSL 20172
983 #define SYBENLNL 20173
984 #define SYBENHAN 20174
985 #define SYBENBUF 20175
986 #define SYBENULP 20176
987 #define SYBENOTI 20177
988 #define SYBEEVOP 20178
989 #define SYBENEHA 20179
990 #define SYBETRAN 20180
991 #define SYBEEVST 20181
992 #define SYBEEINI 20182
993 #define SYBEECRT 20183
994 #define SYBEECAN 20184
995 #define SYBEEUNR 20185
996 #define SYBERPCS 20186
997 #define SYBETPAR 20187
998 #define SYBETEXS 20188
999 #define SYBETRAC 20189
1000 #define SYBETRAS 20190
1001 #define SYBEPRTF 20191
1002 #define SYBETRSN 20192
1003 #define SYBEBPKS 20193
1004 #define SYBEIPV 20194
1005 #define SYBEMOV 20195
1006 #define SYBEDIVZ 20196
1007 #define SYBEASTL 20197
1008 #define SYBESEFA 20198
1009 #define SYBEPOLL 20199
1010 #define SYBENOEV 20200
1011 #define SYBEBADPK 20201
1012 #define SYBESECURE 20202
1013 #define SYBECAP 20203
1014 #define SYBEFUNC 20204
1015 #define SYBERESP 20205
1016 #define SYBEIVERS 20206
1017 #define SYBEONCE 20207
1018 #define SYBERPNULL 20208
1019 #define SYBERPTXTIM 20209
1020 #define SYBENEG 20210
1021 #define SYBELBLEN 20211
1022 #define SYBEUMSG 20212
1023 #define SYBECAPTYP 20213
1024 #define SYBEBNUM 20214
1025 #define SYBEBBL 20215
1026 #define SYBEBPREC 20216
1027 #define SYBEBSCALE 20217
1028 #define SYBECDOMAIN 20218
1029 #define SYBECINTERNAL 20219
1030 #define SYBEBTYPSRV 20220
1031 #define SYBEBCSET 20221
1032 #define SYBEFENC 20222
1033 #define SYBEFRES 20223
1034 #define SYBEISRVPREC 20224
1035 #define SYBEISRVSCL 20225
1036 #define SYBEINUMCL 20226
1037 #define SYBEIDECCL 20227
1038 #define SYBEBCMTXT 20228
1039 #define SYBEBCPREC 20229
1040 #define SYBEBCBNPR 20230
1041 #define SYBEBCBNTYP 20231
1042 #define SYBEBCSNTYP 20232
1043 #define SYBEBCPCTYP 20233
1044 #define SYBEBCVLEN 20234
1045 #define SYBEBCHLEN 20235
1046 #define SYBEBCBPREF 20236
1047 #define SYBEBCPREF 20237
1048 #define SYBEBCITBNM 20238
1049 #define SYBEBCITBLEN 20239
1050 #define SYBEBCSNDROW 20240
1051 #define SYBEBPROCOL 20241
1052 #define SYBEBPRODEF 20242
1053 #define SYBEBPRONUMDEF 20243
1054 #define SYBEBPRODEFID 20244
1055 #define SYBEBPRONODEF 20245
1056 #define SYBEBPRODEFTYP 20246
1057 #define SYBEBPROEXTDEF 20247
1058 #define SYBEBPROEXTRES 20248
1059 #define SYBEBPROBADDEF 20249
1060 #define SYBEBPROBADTYP 20250
1061 #define SYBEBPROBADLEN 20251
1062 #define SYBEBPROBADPREC 20252
1063 #define SYBEBPROBADSCL 20253
1064 #define SYBEBADTYPE 20254
1065 #define SYBECRSNORES 20255
1066 #define SYBECRSNOIND 20256
1067 #define SYBECRSVIEW 20257
1068 #define SYBECRSVIIND 20258
1069 #define SYBECRSORD 20259
1070 #define SYBECRSBUFR 20260
1071 #define SYBECRSNOFREE 20261
1072 #define SYBECRSDIS 20262
1073 #define SYBECRSAGR 20263
1074 #define SYBECRSFRAND 20264
1075 #define SYBECRSFLAST 20265
1076 #define SYBECRSBROL 20266
1077 #define SYBECRSFROWN 20267
1078 #define SYBECRSBSKEY 20268
1079 #define SYBECRSRO 20269
1080 #define SYBECRSNOCOUNT 20270
1081 #define SYBECRSTAB 20271
1082 #define SYBECRSUPDNB 20272
1083 #define SYBECRSNOWHERE 20273
1084 #define SYBECRSSET 20274
1085 #define SYBECRSUPDTAB 20275
1086 #define SYBECRSNOUPD 20276
1087 #define SYBECRSINV 20277
1088 #define SYBECRSNOKEYS 20278
1089 #define SYBECRSNOBIND 20279
1090 #define SYBECRSFTYPE 20280
1091 #define SYBECRSINVALID 20281
1092 #define SYBECRSMROWS 20282
1093 #define SYBECRSNROWS 20283
1094 #define SYBECRSNOLEN 20284
1095 #define SYBECRSNOPTCC 20285
1096 #define SYBECRSNORDER 20286
1097 #define SYBECRSNOTABLE 20287
1098 #define SYBECRSNUNIQUE 20288
1099 #define SYBECRSVAR 20289
1100 #define SYBENOVALUE 20290
1101 #define SYBEVOIDRET 20291
1102 #define SYBECLOSEIN 20292
1103 #define SYBEBOOL 20293
1104 #define SYBEBCPOPT 20294
1105 #define SYBEERRLABEL 20295
1106 #define SYBEATTNACK 20296
1107 #define SYBEBBFL 20297
1108 #define SYBEDCL 20298
1109 #define SYBECS 20299
1110 #define SYBEBULKINSERT 20599
1114 #define DBTDS(a) dbtds(a)
1115 DBINT dbtextsize(
DBPROCESS * dbprocess);
1118 DBBINARY *dbtxtsnewval(
DBPROCESS * dbprocess);
1119 RETCODE dbtxtsput(
DBPROCESS * dbprocess, DBBINARY newtxts,
int colnum);
1123 RETCODE
dbwritetext(
DBPROCESS * dbproc,
char *objname, DBBINARY * textptr, DBTINYINT textptrlen, DBBINARY * timestamp,
1124 DBBOOL log, DBINT size, BYTE * text);
1133 #define DBSETLHOST(x,y) dbsetlname((x), (y), DBSETHOST)
1134 #define dbsetlhost(x,y) dbsetlname((x), (y), DBSETHOST)
1136 #define DBSETLUSER(x,y) dbsetlname((x), (y), DBSETUSER)
1137 #define dbsetluser(x,y) dbsetlname((x), (y), DBSETUSER)
1139 #define DBSETLPWD(x,y) dbsetlname((x), (y), DBSETPWD)
1140 #define dbsetlpwd(x,y) dbsetlname((x), (y), DBSETPWD)
1141 #if defined(DBLIB_UNIMPLEMENTED)
1143 # define DBSETLHID(x,y) dbsetlname((x), (y), DBSETHID)
1146 #define DBSETLAPP(x,y) dbsetlname((x), (y), DBSETAPP)
1147 #define dbsetlapp(x,y) dbsetlname((x), (y), DBSETAPP)
1149 #define BCP_SETL(x,y) dbsetlbool((x), (y), DBSETBCP)
1150 #define DBSETLSECURE(x) dbsetlbool((x), (1), DBSETBCP)
1151 #define DBSETNATLANG 7
1152 #define DBSETLNATLANG(x,y) dbsetlname((x), (y), DBSETNATLANG)
1153 #define dbsetlnatlang(x,y) dbsetlname((x), (y), DBSETNATLANG)
1154 #if defined(DBLIB_UNIMPLEMENTED)
1155 # define DBSETNOSHORT 8
1156 # define DBSETLNOSHORT(x,y) dbsetlbool((x), (y), DBSETNOSHORT)
1157 # define DBSETHIER 9
1158 # define DBSETLHIER(x,y) dbsetlshort((x), (y), DBSETHIER)
1160 #define DBSETCHARSET 10
1161 #define DBSETLCHARSET(x,y) dbsetlname((x), (y), DBSETCHARSET)
1162 #define DBSETPACKET 11
1163 #define DBSETLPACKET(x,y) dbsetllong((x), (y), DBSETPACKET)
1164 #define dbsetlpacket(x,y) dbsetllong((x), (y), DBSETPACKET)
1165 #define DBSETENCRYPT 12
1166 #define DBSETLENCRYPT(x,y) dbsetlbool((x), (y), DBSETENCRYPT)
1167 #define DBSETLABELED 13
1168 #define DBSETLLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1169 #define BCP_SETLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1170 #define DBSETDBNAME 14
1171 #define DBSETLDBNAME(x,y) dbsetlname((x), (y), DBSETDBNAME)
1172 #define DBSETLVERSION(login, version) dbsetlversion((login), (version))
1174 RETCODE
bcp_init(
DBPROCESS * dbproc,
const char *tblname,
const char *hfile,
const char *errfile,
int direction);
1178 RETCODE
bcp_bind(
DBPROCESS * dbproc, BYTE * varaddr,
int prefixlen, DBINT varlen, BYTE * terminator,
int termlen,
int type,
1182 RETCODE
bcp_colfmt(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1183 const BYTE * host_term,
int host_termlen,
int colnum);
1184 RETCODE
bcp_colfmt_ps(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1185 BYTE * host_term,
int host_termlen,
int colnum,
DBTYPEINFO * typeinfo);
1188 int bcp_getbatchsize(
DBPROCESS * dbproc);
RETCODE bcp_colptr(DBPROCESS *dbproc, BYTE *colptr, int table_column)
Override bcp_bind() by pointing to a different host variable.
Definition: bcp.c:672
RETCODE dbmny4sub(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *diff)
Subtract two DBMONEY4 values.
Definition: dblib.c:5461
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:7115
void dbfreebuf(DBPROCESS *dbproc)
Erase the command buffer, in case DBNOAUTOFREE was set with dbsetopt().
Definition: dblib.c:5880
DBINT dbretstatus(DBPROCESS *dbproc)
Fetch status value returned by query or remote procedure call.
Definition: dblib.c:4489
DBBINARY * dbtxptr(DBPROCESS *dbproc, int column)
Get text pointer for a column in the current row.
Definition: dblib.c:6369
BOOL dbiscount(DBPROCESS *dbproc)
Indicates whether or not the count returned by dbcount is real (Microsoft-compatibility feature)...
Definition: dblib.c:2739
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:2911
RETCODE dbmny4minus(DBPROCESS *dbproc, DBMONEY4 *src, DBMONEY4 *dest)
Negate a DBMONEY4 value.
Definition: dblib.c:5380
DBBOOL bcp_getl(LOGINREC *login)
See if BCP_SETL() was used to set the LOGINREC for BCP work.
Definition: bcp.c:709
char * dbretname(DBPROCESS *dbproc, int retnum)
Get name of an output parameter filled by a stored procedure.
Definition: dblib.c:4539
RETCODE dbsetrow(DBPROCESS *dbproc, DBINT row)
Make a buffered row "current" without fetching it into bound variables.
Definition: dblib.c:1980
BYTE * dbdata(DBPROCESS *dbproc, int column)
Get address of data in a regular result column.
Definition: dblib.c:3157
void dbprhead(DBPROCESS *dbproc)
Print result set headings to stdout.
Definition: dblib.c:3763
RETCODE dbmnymaxpos(DBPROCESS *dbproc, DBMONEY *amount)
Get maximum positive DBMONEY value supported.
Definition: dblib.c:5171
int dbnumrets(DBPROCESS *dbproc)
Get count of output parameters filled by a stored procedure.
Definition: dblib.c:4507
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:274
RETCODE dbinit(void)
Initialize db-lib.
Definition: dblib.c:664
int dbrettype(DBPROCESS *dbproc, int retnum)
Get datatype of a stored procedure's return parameter.
Definition: dblib.c:6073
RETCODE dbmnyinc(DBPROCESS *dbproc, DBMONEY *amount)
Add $0.0001 to a DBMONEY value.
Definition: dblib.c:5294
RETCODE dbsetlbool(LOGINREC *login, int value, int which)
Set a boolean value in a LOGINREC structure.
Definition: dblib.c:892
RETCODE dbsetlname(LOGINREC *login, const char *value, int which)
Set the value of a string in a LOGINREC structure.
Definition: dblib.c:759
char * dbcolname(DBPROCESS *dbproc, int column)
Return name of a regular result column.
Definition: dblib.c:1835
const char * dbversion()
See which version of db-lib is in use.
Definition: dblib.c:6647
int dbnumalts(DBPROCESS *dbproc, int computeid)
Get count of columns in a compute row.
Definition: dblib.c:4760
RETCODE dbspr1row(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print a regular result row to a buffer.
Definition: dblib.c:3256
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
Definition: dblib.c:1310
RETCODE dbmoretext(DBPROCESS *dbproc, DBINT size, const BYTE text[])
Send chunk of a text/image value to the server.
Definition: dblib.c:6542
RETCODE dbsqlsend(DBPROCESS *dbproc)
Transmit the command buffer to the server.
Definition: dblib.c:6854
RETCODE bcp_options(DBPROCESS *dbproc, int option, BYTE *value, int valuelen)
Set "hints" for uploading a file.
Definition: bcp.c:623
BYTE * dbbylist(DBPROCESS *dbproc, int computeid, int *size)
Get bylist for a compute row.
Definition: dblib.c:4819
RETCODE dbmnyminus(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Negate a DBMONEY value.
Definition: dblib.c:5352
RETCODE dbsetopt(DBPROCESS *dbproc, int option, const char *char_param, int int_param)
Set db-lib or server option.
Definition: dblib.c:4312
DBINT dbadlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in a compute column.
Definition: dblib.c:4111
RETCODE dbcanquery(DBPROCESS *dbproc)
Cancel the query currently being retrieved, discarding all pending rows.
Definition: dblib.c:5849
RETCODE dbmny4add(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *sum)
Add two DBMONEY4 values.
Definition: dblib.c:5429
BYTE * dbretdata(DBPROCESS *dbproc, int retnum)
Get value of an output parameter filled by a stored procedure.
Definition: dblib.c:4569
DBINT dbcollen(DBPROCESS *dbproc, int column)
Get size of a regular result column.
Definition: dblib.c:3052
DBTYPEINFO * dbcoltypeinfo(DBPROCESS *dbproc, int column)
Get precision and scale information for a regular result column.
Definition: dblib.c:2881
void dbloginfree(LOGINREC *login)
free the LOGINREC
Definition: dblib.c:737
RETCODE dbsqlok(DBPROCESS *dbproc)
Wait for results of a query from the server.
Definition: dblib.c:4633
RETCODE dbsetlversion(LOGINREC *login, BYTE version)
Set TDS version for future connections.
Definition: dblib.c:921
int dbnumcols(DBPROCESS *dbproc)
Return number of regular columns in a result set.
Definition: dblib.c:1811
int dbnumcompute(DBPROCESS *dbproc)
Get count of COMPUTE clauses for a result set.
Definition: dblib.c:4793
RETCODE dbsetllong(LOGINREC *login, long value, int which)
Set an integer value in a LOGINREC structure.
Definition: dblib.c:821
STATUS dbrowtype(DBPROCESS *dbproc)
Get returned row's type.
Definition: dblib.c:6007
RETCODE dbmnycopy(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Copy a DBMONEY value.
Definition: dblib.c:5827
RETCODE dbmnyzero(DBPROCESS *dbproc, DBMONEY *dest)
Set a DBMONEY value to zero.
Definition: dblib.c:5149
DBINT dbconvert(DBPROCESS *dbproc, int srctype, const BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen)
Convert one datatype to another.
Definition: dblib.c:2209
int dbiowdesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to write data coming to the server...
Definition: dblib.c:7062
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:6273
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition: bcp.c:549
RETCODE dbaltbind(DBPROCESS *dbproc, int computeid, int column, int vartype, DBINT varlen, BYTE *varaddr)
Bind a compute column to a program variable.
Definition: dblib.c:4208
int dbiordesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to read data coming from the server...
Definition: dblib.c:7046
DBPROCESS * dbopen(LOGINREC *login, const char *server)
Normally not used.
Definition: dbopen.c:43
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:164
RETCODE dbsetversion(DBINT version)
Specify a db-lib version level.
Definition: dblib.c:5796
RETCODE dbcancel(DBPROCESS *dbproc)
Cancel the current command batch.
Definition: dblib.c:3192
DBBOOL dbwillconvert(int srctype, int desttype)
Test whether or not a datatype can be converted to another datatype.
Definition: dblib.c:2810
RETCODE dbnextrow(DBPROCESS *dbproc)
Read result row into the row buffer and into any bound host variables.
Definition: dblib.c:2009
int dbgettime(void)
Get maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4022
DBBOOL dbhasretstat(DBPROCESS *dbproc)
Determine if query generated a return status number.
Definition: dblib.c:4465
RETCODE bcp_exec(DBPROCESS *dbproc, DBINT *rows_copied)
Write a datafile to a table.
Definition: bcp.c:1810
DBINT dbconvert_ps(DBPROCESS *dbproc, int srctype, BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen, DBTYPEINFO *typeinfo)
cf.
Definition: dblib.c:2523
RETCODE dbuse(DBPROCESS *dbproc, const char *name)
Change current database.
Definition: dblib.c:1393
RETCODE dbsprhead(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print result set headings to a buffer.
Definition: dblib.c:3699
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:172
RETCODE dbfcmd(DBPROCESS *dbproc, const char *fmt,...)
printf-like way to form SQL to send to the server.
Definition: dblib.c:1270
DBINT bcp_done(DBPROCESS *dbproc)
Conclude the transfer of data from program variables.
Definition: bcp.c:2242
char * dbgetchar(DBPROCESS *dbproc, int pos)
Get address of a position in the command buffer.
Definition: dblib.c:6117
DBINT dbcurrow(DBPROCESS *dbproc)
Get number of the row currently being read.
Definition: dblib.c:5990
int dbalttype(DBPROCESS *dbproc, int computeid, int column)
Get datatype for a compute column.
Definition: dblib.c:4142
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition: dblib.c:4941
RETCODE dbsetnull(DBPROCESS *dbproc, int bindtype, int bindlen, BYTE *bindval)
Define substitution values to be used when binding null values.
Definition: dblib.c:1902
BYTE * dbadata(DBPROCESS *dbproc, int computeid, int column)
Get address of compute column data.
Definition: dblib.c:4254
DBINT dbaltlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in compute column.
Definition: dblib.c:6950
RETCODE dbgetrow(DBPROCESS *dbproc, DBINT row)
Read a row from the row buffer.
Definition: dblib.c:1869
RETCODE dbprrow(DBPROCESS *dbproc)
Print a result set to stdout.
Definition: dblib.c:3340
DBBINARY * dbtxtimestamp(DBPROCESS *dbproc, int column)
Get text timestamp for a column in the current row.
Definition: dblib.c:6342
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:6195
RETCODE dbstrcpy(DBPROCESS *dbproc, int start, int numbytes, char *dest)
Get a copy of a chunk of the command buffer.
Definition: dblib.c:6150
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Definition: dblib.c:6818
RETCODE bcp_colfmt(DBPROCESS *dbproc, int host_colnum, int host_type, int host_prefixlen, DBINT host_collen, const BYTE *host_term, int host_termlen, int table_colnum)
Specify the format of a datafile prior to writing to a table.
Definition: bcp.c:386
void dbexit()
Close server connections and free all related structures.
Definition: dblib.c:1506
RETCODE dbmnymaxneg(DBPROCESS *dbproc, DBMONEY *amount)
Get maximum negative DBMONEY value supported.
Definition: dblib.c:5193
RETCODE dbmorecmds(DBPROCESS *dbproc)
See if more commands are to be processed.
Definition: dblib.c:6041
RETCODE dbcmdrow(DBPROCESS *dbproc)
See if the current command can return rows.
Definition: dblib.c:4059
RETCODE dbdatecmp(DBPROCESS *dbproc, DBDATETIME *d1, DBDATETIME *d2)
Compare DBDATETIME values, similar to strcmp(3).
Definition: dblib.c:5606
DBINT dbfirstrow(DBPROCESS *dbproc)
See if a server response has arrived.
Definition: dblib.c:7006
RETCODE dbmny4copy(DBPROCESS *dbproc, DBMONEY4 *src, DBMONEY4 *dest)
Copy a DBMONEY4 value.
Definition: dblib.c:5580
RETCODE dbrpcinit(DBPROCESS *dbproc, const char rpcname[], DBSMALLINT options)
Initialize a remote procedure call.
Definition: rpc.c:79
DBINT bcp_batch(DBPROCESS *dbproc)
Commit a set of rows to the table.
Definition: bcp.c:2214
STATUS dbreadtext(DBPROCESS *dbproc, void *buf, DBINT bufsize)
Fetch part of a text or image value from the server.
Definition: dblib.c:6473
RETCODE dbsetlogintime(int seconds)
Set maximum seconds db-lib waits for a server response to a login attempt.
Definition: dblib.c:4038
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition: dblib.c:2827
RETCODE dbbind(DBPROCESS *dbproc, int column, int vartype, DBINT varlen, BYTE *varaddr)
Tie a host variable to a resultset column.
Definition: dblib.c:2568
void dbclose(DBPROCESS *dbproc)
Close a connection to the server and free associated resources.
Definition: dblib.c:1437
int dbspid(DBPROCESS *dbproc)
Get server process ID for a DBPROCESS.
Definition: dblib.c:5734
int dbstrlen(DBPROCESS *dbproc)
Get size of the command buffer, in bytes.
Definition: dblib.c:6098
RETCODE dbmnydec(DBPROCESS *dbproc, DBMONEY *amount)
Subtract $0.0001 from a DBMONEY value.
Definition: dblib.c:5323
RETCODE dbsettime(int seconds)
Set maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:3995
DBBOOL dbdead(DBPROCESS *dbproc)
Check if dbproc is an ex-parrot.
Definition: dblib.c:4878
DBINT dbaltutype(DBPROCESS *dbproc, int computeid, int column)
Get user-defined datatype of a compute column.
Definition: dblib.c:6926
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition: dblib.c:4960
int dbmny4cmp(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2)
Compare two DBMONEY4 values.
Definition: dblib.c:5552
RETCODE bcp_columns(DBPROCESS *dbproc, int host_colcount)
Indicate how many columns are to be found in the datafile.
Definition: bcp.c:309
RETCODE bcp_bind(DBPROCESS *dbproc, BYTE *varaddr, int prefixlen, DBINT varlen, BYTE *terminator, int termlen, int vartype, int table_column)
Bind a program host variable to a database column.
Definition: bcp.c:2287
char * dbservcharset(DBPROCESS *dbproc)
Get syscharset name of the server character set.
Definition: dblib.c:6834
char * dbchange(DBPROCESS *dbproc)
See if a command caused the current database to change.
Definition: dblib.c:6798
RETCODE dbmny4zero(DBPROCESS *dbproc, DBMONEY4 *dest)
Zero a DBMONEY4 value.
Definition: dblib.c:5405
int dbretlen(DBPROCESS *dbproc, int retnum)
Get size of an output parameter filled by a stored procedure.
Definition: dblib.c:4598
RETCODE bcp_sendrow(DBPROCESS *dbproc)
Write data in host variables to the table.
Definition: bcp.c:1582
void dbsetifile(char *filename)
set name and location of the interfaces file FreeTDS should use to look up a servername.
Definition: dblib.c:2646
char * dbcolsource(DBPROCESS *dbproc, int column)
Get base database column name for a result set column.
Definition: dblib.c:3028
BYTE * dbgetuserdata(DBPROCESS *dbproc)
Get address of user-allocated data from a DBPROCESS.
Definition: dblib.c:5778
DBINT dbspr1rowlen(DBPROCESS *dbproc)
Determine size buffer required to hold the results returned by dbsprhead(), dbsprline(), and dbspr1row().
Definition: dblib.c:3218
RETCODE dbdatecrack(DBPROCESS *dbproc, DBDATEREC *output, DBDATETIME *datetime)
Break a DBDATETIME value into useful pieces.
Definition: dblib.c:5652
void dbsetuserdata(DBPROCESS *dbproc, BYTE *ptr)
Associate client-allocated (and defined) data with a DBPROCESS.
Definition: dblib.c:5760
int dbaltop(DBPROCESS *dbproc, int computeid, int column)
Get aggregation operator for a compute column.
Definition: dblib.c:4284
RETCODE dbsetmaxprocs(int maxprocs)
Set maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3904
int dbmnycmp(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2)
Compare two DBMONEY values.
Definition: dblib.c:5090
DBINT dbvarylen(DBPROCESS *dbproc, int column)
Determine whether a column can vary in size.
Definition: dblib.c:3078
int dbgetpacket(DBPROCESS *dbproc)
Get TDS packet size for the connection.
Definition: dblib.c:3880
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:6403
Definition: bsqlodbc.c:100
DBPROCESS * tdsdbopen(LOGINREC *login, const char *server, int msdblib)
Form a connection with the server.
Definition: dblib.c:1141
int dbcurcmd(DBPROCESS *dbproc)
Get number of the row just returned.
Definition: dblib.c:6024
int dbaltcolid(DBPROCESS *dbproc, int computeid, int column)
Get column ID of a compute column.
Definition: dblib.c:4084
DBINT dbcount(DBPROCESS *dbproc)
Get count of rows processed.
Definition: dblib.c:2759
RETCODE bcp_colfmt_ps(DBPROCESS *dbproc, int host_colnum, int host_type, int host_prefixlen, DBINT host_collen, BYTE *host_term, int host_termlen, int table_colnum, DBTYPEINFO *typeinfo)
Specify the format of a host file for bulk copy purposes, with precision and scale support for numeri...
Definition: bcp.c:513
int dbtds(DBPROCESS *dbproc)
Get the TDS version in use for dbproc.
Definition: dblib.c:6612
RETCODE dbrows(DBPROCESS *dbproc)
Indicate whether a query returned rows.
Definition: dblib.c:3838
void dbrecftos(const char filename[])
Record to a file all SQL commands sent to the server.
Definition: dblib.c:6578
int dbgetmaxprocs(void)
get maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3974
DBBOOL dbisopt(DBPROCESS *dbproc, int option, const char param[])
Get value of an option.
Definition: dblib.c:5967
RETCODE dbclropt(DBPROCESS *dbproc, int option, const char param[])
Reset an option.
Definition: dblib.c:5914
RETCODE bcp_readfmt(DBPROCESS *dbproc, const char filename[])
Read a format definition file.
Definition: bcp.c:1872
void dbclrbuf(DBPROCESS *dbproc, DBINT n)
Clear n rows from the row buffer.
Definition: dblib.c:2779
RETCODE dbanullbind(DBPROCESS *dbproc, int computeid, int column, DBINT *indicator)
Tie a null-indicator to a compute result column.
Definition: dblib.c:2711
const char * dbmonthname(DBPROCESS *dbproc, char *language, int monthnum, DBBOOL shortform)
Get name of a month, in some human language.
Definition: dblib.c:6769
RETCODE dbsprline(DBPROCESS *dbproc, char *buffer, DBINT buf_len, DBCHAR line_char)
Get formatted string for underlining dbsprhead() column names.
Definition: dblib.c:3640
RETCODE dbrpcsend(DBPROCESS *dbproc)
Execute the procedure and free associated memory.
Definition: rpc.c:278
DBINT dbdatlen(DBPROCESS *dbproc, int column)
Get size of current row's data in a regular result column.
Definition: dblib.c:3128
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition: dblib.c:709
DBINT dblastrow(DBPROCESS *dbproc)
Get number of the last row in the row buffer.
Definition: dblib.c:7022
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
void dbsetavail(DBPROCESS *dbproc)
Mark a DBPROCESS as "available".
Definition: dblib.c:7090
int dbcolutype(DBPROCESS *dbproc, int column)
Get user-defined datatype of a regular result column.
Definition: dblib.c:2857
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition: dblib.c:1654
const char * dbprtype(int token)
Print a token value's name to a buffer.
Definition: dblib.c:6256
RETCODE dbnullbind(DBPROCESS *dbproc, int column, DBINT *indicator)
Tie a null-indicator to a regular result column.
Definition: dblib.c:2675
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition: dblib.c:1365