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
211 #define SYBDATE SYBDATE
213 #define SYBTIME SYBTIME
214 SYBBIGDATETIME = 187,
215 #define SYBBIGDATETIME SYBBIGDATETIME
217 #define SYBBIGTIME SYBBIGTIME
219 #define SYBMSDATE SYBMSDATE
221 #define SYBMSTIME SYBMSTIME
223 #define SYBMSDATETIME2 SYBMSDATETIME2
224 SYBMSDATETIMEOFFSET = 43,
225 #define SYBMSDATETIMEOFFSET SYBMSDATETIMEOFFSET
228 #define SYBAOPCNT 0x4b
229 #define SYBAOPCNTU 0x4c
230 #define SYBAOPSUM 0x4d
231 #define SYBAOPSUMU 0x4e
232 #define SYBAOPAVG 0x4f
233 #define SYBAOPAVGU 0x50
234 #define SYBAOPMIN 0x51
235 #define SYBAOPMAX 0x52
238 #define SYBAOPCNT_BIG 0x09
239 #define SYBAOPSTDEV 0x30
240 #define SYBAOPSTDEVP 0x31
241 #define SYBAOPVAR 0x32
242 #define SYBAOPVARP 0x33
243 #define SYBAOPCHECKSUM_AGG 0x72
247 typedef unsigned char DBBOOL;
249 typedef unsigned char DBBIT;
250 typedef unsigned char DBTINYINT;
251 typedef tds_sysdep_int16_type DBSMALLINT;
252 typedef tds_sysdep_int32_type DBINT;
253 typedef tds_sysdep_int64_type DBBIGINT;
254 typedef unsigned char DBBINARY;
255 typedef tds_sysdep_real32_type DBREAL;
256 typedef tds_sysdep_real64_type DBFLT8;
257 typedef unsigned tds_sysdep_int16_type DBUSMALLINT;
258 typedef unsigned tds_sysdep_int32_type DBUINT;
259 typedef unsigned tds_sysdep_int64_type DBUBIGINT;
270 unsigned char array[256];
275 unsigned char precision;
277 unsigned char array[33];
285 unsigned tds_sysdep_int32_type mnylow;
310 DBUSMALLINT time_prec:3;
312 DBUSMALLINT has_time:1;
313 DBUSMALLINT has_date:1;
314 DBUSMALLINT has_offset:1;
318 # define SQLCHAR SYBCHAR
329 typedef unsigned char BYTE;
348 { MAXCOLNAMELEN = 512 };
349 typedef enum { CI_REGULAR=1, CI_ALTERNATE=2, CI_CURSOR=3 } CI_TYPE;
354 DBCHAR Name[MAXCOLNAMELEN+2];
355 DBCHAR ActualName[MAXCOLNAMELEN+2];
356 DBCHAR TableName[MAXCOLNAMELEN+2];
373 DBCHAR Name[MAXCOLNAMELEN+2];
374 DBCHAR ActualName[MAXCOLNAMELEN+2];
375 DBCHAR TableName[MAXCOLNAMELEN+2];
387 DBINT ServerMaxLength;
388 DBCHAR ServerTypeDeclaration[256];
395 #define DBPARSEONLY 0
399 #define DBARITHIGNORE 4
401 #define DBARITHABORT 6
402 #define DBTEXTLIMIT 7
408 #define DBSTORPROCID 13
410 #define DBNOAUTOFREE 15
411 #define DBROWCOUNT 16
412 #define DBTEXTSIZE 17
414 #define DBDATEFORMAT 19
416 #define DBPRCOLSEP 21
417 #define DBPRLINELEN 22
418 #define DBPRLINESEP 23
419 #define DBLFCONVERT 24
420 #define DBDATEFIRST 25
421 #define DBCHAINXACTS 26
422 #define DBFIPSFLAG 27
423 #define DBISOLATION 28
425 #define DBIDENTITY 30
427 #define DBDATESHORT 32
428 #define DBCLIENTCURSORS 33
430 #define DBQUOTEDIDENT 35
432 #define DBNUMOPTIONS 36
440 #define NOSUCHOPTION 2
442 #define MAXOPTTEXT 32
492 typedef int (*EHANDLEFUNC) (
DBPROCESS * dbproc,
int severity,
int dberr,
int oserr,
char *dberrstr,
char *oserrstr);
494 typedef int (*MHANDLEFUNC) (
DBPROCESS * dbproc, DBINT msgno,
int msgstate,
int severity,
char *msgtext,
char *srvname,
495 char *proc,
int line);
499 #define DBNOTIFICATION 2
501 #define DBINTERRUPT 4
509 #define NTBSTRINGBIND 2
510 #define VARYCHARBIND 3
511 #define VARYBINBIND 4
517 #define DATETIMEBIND 11
518 #define SMALLDATETIMEBIND 12
520 #define SMALLMONEYBIND 14
521 #define BINARYBIND 15
523 #define NUMERICBIND 17
524 #define DECIMALBIND 18
525 #define SRCNUMERICBIND 19
526 #define SRCDECIMALBIND 20
529 #define BIGDATETIMEBIND 23
530 #define BIGTIMEBIND 24
531 #define BIGINTBIND 30
532 #define DATETIME2BIND 31
533 #define MAXBINDTYPES 32
535 #define DBPRCOLSEP 21
536 #define DBPRLINELEN 22
537 #define DBRPCRETURN 1
538 #define DBRPCDEFAULT 2
542 #define NO_MORE_ROWS -2
544 #define NO_MORE_RESULTS 2
550 #define DB_QUERYOUT 3
557 #define DBRPCRECOMPILE TDS_STATIC_CAST(DBSMALLINT, 0x0001)
558 #define DBRPCRESET TDS_STATIC_CAST(DBSMALLINT, 0x0002)
559 #define DBRPCCURSOR TDS_STATIC_CAST(DBSMALLINT, 0x0008)
561 #if defined(DBLIB_UNIMPLEMENTED)
562 DBBOOL db12hour(
DBPROCESS * dbprocess,
const char language[]);
564 DBBOOL dbcolbrowse(
DBPROCESS * dbprocess,
int colnum);
566 RETCODE dbcursor(DBCURSOR * hc, DBINT optype, DBINT bufno, BYTE * table, BYTE * values);
567 RETCODE dbcursorbind(DBCURSOR * hc,
int col,
int vartype, DBINT varlen, DBINT * poutlen, BYTE * pvaraddr,
DBTYPEINFO * typeinfo);
568 void dbcursorclose(DBCURSOR * hc);
569 RETCODE dbcursorcolinfo(DBCURSOR * hc, DBINT column, DBCHAR * colname, DBINT * coltype, DBINT * collen, DBINT * usertype);
570 RETCODE dbcursorfetch(DBCURSOR * hc, DBINT fetchtype, DBINT rownum);
571 RETCODE dbcursorinfo(DBCURSOR * hc, DBINT * ncols, DBINT * nrows);
572 DBCURSOR *dbcursoropen(
DBPROCESS * dbprocess, BYTE * stmt, SHORT scollopt, SHORT concuropt, USHORT nrows, DBINT * pstatus);
576 RETCODE dbdatechar(
DBPROCESS * dbprocess,
char *buf,
int datepart,
int value);
578 char *dateorder(
DBPROCESS * dbprocess,
char *language);
581 char *dbdayname(
DBPROCESS * dbprocess,
char *language,
int daynum);
583 int dbgetoff(
DBPROCESS * dbprocess, DBUSMALLINT offtype,
int startfrom);
585 char *dbqual(
DBPROCESS * dbprocess,
int tabnum,
char *tabname);
586 void dbfreequal(
char *qualptr);
588 DBSORTORDER *dbloadsort(
DBPROCESS * dbprocess);
589 RETCODE dbfreesort(
DBPROCESS * dbprocess, DBSORTORDER * sortorder);
591 RETCODE dbload_xlate(
DBPROCESS * dbprocess,
char *srv_charset,
char *clt_name, DBXLATE ** xlt_tosrv, DBXLATE ** xlt_todisp);
597 RETCODE dbmnydown(
DBPROCESS * dbproc,
DBMONEY * mnyptr,
int divisor,
int *remainder);
598 RETCODE dbmnyinit(
DBPROCESS * dbproc,
DBMONEY * mnyptr,
int trim, DBBOOL * negative);
599 RETCODE dbmnyndigit(
DBPROCESS * dbproc,
DBMONEY * mnyptr, DBCHAR * value, DBBOOL * zero);
601 RETCODE dbmnydigit(
DBPROCESS * dbprocess,
DBMONEY * m1, DBCHAR * value, DBBOOL * zero);
602 RETCODE dbmnyscale(
DBPROCESS * dbproc,
DBMONEY * dest,
int multiplier,
int addend);
605 RETCODE dbnpcreate(
DBPROCESS * dbprocess);
606 RETCODE dbnpdefine(
DBPROCESS * dbprocess, DBCHAR * procedure_name, DBSMALLINT namelen);
610 RETCODE dbpoll(
DBPROCESS * dbproc,
long milliseconds,
DBPROCESS ** ready_dbproc,
int *return_reason);
611 int dbordercol(
DBPROCESS * dbprocess,
int order);
613 RETCODE dbregdrop(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
614 RETCODE dbregexec(
DBPROCESS * dbproc, DBUSMALLINT options);
615 RETCODE dbreghandle(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, INTFUNCPTR handler);
616 RETCODE dbreginit(
DBPROCESS * dbproc, DBCHAR * procedure_name, DBSMALLINT namelen);
618 RETCODE dbregnowatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
619 RETCODE dbregparam(
DBPROCESS * dbproc,
char *param_name,
int type, DBINT datalen, BYTE * data);
620 RETCODE dbregwatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, DBUSMALLINT options);
621 RETCODE dbregwatchlist(
DBPROCESS * dbprocess);
624 RETCODE dbrpwset(
LOGINREC * login,
char *srvname,
char *password,
int pwlen);
626 DBINT dbreadpage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, BYTE * buf);
627 RETCODE dbwritepage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, DBINT size, BYTE * buf);
629 RETCODE dbsetdeflang(
char *language);
631 int dbstrcmp(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
632 int dbstrsort(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
634 DBBOOL dbtabbrowse(
DBPROCESS * dbprocess,
int tabnum);
636 char *dbtabname(
DBPROCESS * dbprocess,
int tabnum);
637 char *dbtabsource(
DBPROCESS * dbprocess,
int colnum,
int *tabnum);
639 RETCODE dbsetlshort(
LOGINREC * login,
int value,
int which);
641 RETCODE dbsendpassthru(
DBPROCESS * dbprocess, DBVOIDPTR bufp);
642 RETCODE dbrecvpassthru(
DBPROCESS * dbprocess, DBVOIDPTR * bufp);
644 RETCODE dbgetloginfo(
DBPROCESS * dbprocess, DBLOGINFO ** loginfo);
645 RETCODE dbsetloginfo(
LOGINREC * loginrec, DBLOGINFO * loginfo);
648 DBBINARY *dbtsnewval(
DBPROCESS * dbprocess);
649 RETCODE dbtsput(
DBPROCESS * dbprocess, DBBINARY * newts,
int newtslen,
int tabnum,
char *tabname);
651 RETCODE dbfree_xlate(
DBPROCESS * dbprocess, DBXLATE * xlt_tosrv, DBXLATE * clt_todisp);
652 int dbxlate(
DBPROCESS * dbprocess,
char *src,
int srclen,
char *dest,
int destlen, DBXLATE * xlt,
int *srcbytes_used,
653 DBBOOL srcend,
int status);
655 RETCODE bcp_moretext(
DBPROCESS * dbproc, DBINT size, BYTE * text);
656 RETCODE bcp_writefmt(
DBPROCESS * dbproc,
const char filename[]);
658 void build_xact_string(
char *xact_name,
char *service_name, DBINT commid,
char *result);
659 RETCODE remove_xact(
DBPROCESS * connect, DBINT commid,
int n);
660 RETCODE abort_xact(
DBPROCESS * connect, DBINT commid);
662 RETCODE commit_xact(
DBPROCESS * connect, DBINT commid);
664 RETCODE scan_xact(
DBPROCESS * connect, DBINT commid);
665 DBINT start_xact(
DBPROCESS * connect,
char *application_name,
char *xact_name,
int site_count);
666 DBINT stat_xact(
DBPROCESS * connect, DBINT commid);
672 RETCODE
dbaltbind(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
673 RETCODE dbaltbind_ps(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
681 RETCODE
dbbind(
DBPROCESS * dbproc,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
682 RETCODE dbbind_ps(
DBPROCESS * dbprocess,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
DBTYPEINFO * typeinfo);
688 DBBOOL dbcharsetconv(
DBPROCESS * dbprocess);
695 #define DBCMDROW(x) dbcmdrow((x))
704 DBINT
dbconvert(
DBPROCESS * dbproc,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen);
705 DBINT
dbconvert_ps(
DBPROCESS * dbprocess,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen,
710 #define DBCOUNT(x) dbcount((x))
713 #define DBCURCMD(x) dbcurcmd((x))
716 #define DBCURROW(x) dbcurrow((x))
723 #define DBDEAD(x) dbdead((x))
729 #define DBFIRSTROW(x) dbfirstrow((x))
732 char *dbgetcharset(
DBPROCESS * dbprocess);
733 int dbgetlusername(
LOGINREC * login, BYTE * name_buffer,
int buffer_len);
735 char *dbgetnatlanf(
DBPROCESS * dbprocess);
739 #define DBGETTIME dbgettime
745 #define DBIORDESC(x) dbiordesc((x))
748 #define DBIOWDESC(x) dbiowdesc((x))
751 #define DBISAVAIL(x) dbisavail((x))
755 #define DBLASTROW(x) dblastrow((x))
781 #define DBMORECMDS(x) dbmorecmds((x))
796 void dbpivot_count (
struct col_t *output,
const struct col_t *input);
797 void dbpivot_sum (
struct col_t *output,
const struct col_t *input);
798 void dbpivot_min (
struct col_t *output,
const struct col_t *input);
799 void dbpivot_max (
struct col_t *output,
const struct col_t *input);
802 typedef void (*DBPIVOT_FUNC)(
struct col_t *output,
const struct col_t *input);
805 RETCODE
dbpivot(
DBPROCESS *dbproc,
int nkeys,
int *keys,
int ncols,
int *cols, DBPIVOT_FUNC func,
int val);
807 DBPIVOT_FUNC dbpivot_lookup_name(
const char name[] );
810 #define dbopen(x,y) tdsdbopen((x),(y), 1)
812 #define dbopen(x,y) tdsdbopen((x),(y), 0)
816 #ifdef PHP_SYBASE_DBOPEN
817 #undef PHP_SYBASE_DBOPEN
818 #define PHP_SYBASE_DBOPEN dbopen
829 RETCODE dbresults_r(
DBPROCESS * dbproc,
int recursive);
837 #define DBROWS(x) dbrows((x))
840 #define DBROWTYPE(x) dbrowtype((x))
842 RETCODE
dbrpcparam(
DBPROCESS * dbproc,
const char paramname[], BYTE status,
int type, DBINT maxlen, DBINT datalen, BYTE * value);
844 RETCODE
dbsafestr(
DBPROCESS * dbproc,
const char *src, DBINT srclen,
char *dest, DBINT destlen,
int quotetype);
845 RETCODE *dbsechandle(DBINT type, INTFUNCPTR handler);
848 void dbsetbusy(
DBPROCESS * dbprocess, DB_DBBUSY_FUNC busyfunc);
849 RETCODE dbsetdefcharset(
char *charset);
850 void dbsetidle(
DBPROCESS * dbprocess, DB_DBIDLE_FUNC idlefunc);
856 RETCODE
dbsetopt(
DBPROCESS * dbproc,
int option,
const char *char_param,
int int_param);
870 int dbstrbuild(
DBPROCESS * dbproc,
char *charbuf,
int bufsize,
char *text,
char *formats, ...);
875 #define SYBEVERDOWN 100
876 #define SYBEICONVIU 2400
877 #define SYBEICONVAVAIL 2401
878 #define SYBEICONVO 2402
879 #define SYBEICONVI 2403
880 #define SYBEICONV2BIG 2404
883 #define SYBETDSVER 2410
884 #define SYBEPORT 2500
885 #define SYBESYNC 20001
886 #define SYBEFCON 20002
887 #define SYBETIME 20003
888 #define SYBEREAD 20004
889 #define SYBEBUFL 20005
890 #define SYBEWRIT 20006
891 #define SYBEVMS 20007
892 #define SYBESOCK 20008
893 #define SYBECONN 20009
894 #define SYBEMEM 20010
895 #define SYBEDBPS 20011
896 #define SYBEINTF 20012
897 #define SYBEUHST 20013
898 #define SYBEPWD 20014
899 #define SYBEOPIN 20015
900 #define SYBEINLN 20016
901 #define SYBESEOF 20017
902 #define SYBESMSG 20018
903 #define SYBERPND 20019
904 #define SYBEBTOK 20020
905 #define SYBEITIM 20021
906 #define SYBEOOB 20022
907 #define SYBEBTYP 20023
908 #define SYBEBNCR 20024
909 #define SYBEIICL 20025
910 #define SYBECNOR 20026
911 #define SYBENPRM 20027
912 #define SYBEUVDT 20028
913 #define SYBEUFDT 20029
914 #define SYBEWAID 20030
915 #define SYBECDNS 20031
916 #define SYBEABNC 20032
917 #define SYBEABMT 20033
918 #define SYBEABNP 20034
919 #define SYBEAAMT 20035
920 #define SYBENXID 20036
921 #define SYBERXID 20037
922 #define SYBEICN 20038
923 #define SYBENMOB 20039
924 #define SYBEAPUT 20040
925 #define SYBEASNL 20041
926 #define SYBENTLL 20042
927 #define SYBEASUL 20043
928 #define SYBERDNR 20044
929 #define SYBENSIP 20045
930 #define SYBEABNV 20046
931 #define SYBEDDNE 20047
932 #define SYBECUFL 20048
933 #define SYBECOFL 20049
934 #define SYBECSYN 20050
935 #define SYBECLPR 20051
936 #define SYBECNOV 20052
937 #define SYBERDCN 20053
938 #define SYBESFOV 20054
939 #define SYBEUNT 20055
940 #define SYBECLOS 20056
941 #define SYBEUAVE 20057
942 #define SYBEUSCT 20058
943 #define SYBEEQVA 20059
944 #define SYBEUDTY 20060
945 #define SYBETSIT 20061
946 #define SYBEAUTN 20062
947 #define SYBEBDIO 20063
948 #define SYBEBCNT 20064
949 #define SYBEIFNB 20065
950 #define SYBETTS 20066
951 #define SYBEKBCO 20067
952 #define SYBEBBCI 20068
953 #define SYBEKBCI 20069
954 #define SYBEBCRE 20070
955 #define SYBETPTN 20071
956 #define SYBEBCWE 20072
957 #define SYBEBCNN 20073
958 #define SYBEBCOR 20074
959 #define SYBEBCIS 20075
960 #define SYBEBCPI 20076
961 #define SYBEBCPN 20077
962 #define SYBEBCPB 20078
963 #define SYBEVDPT 20079
964 #define SYBEBIVI 20080
965 #define SYBEBCBC 20081
966 #define SYBEBCFO 20082
967 #define SYBEBCVH 20083
968 #define SYBEBCUO 20084
969 #define SYBEBCUC 20085
970 #define SYBEBUOE 20086
971 #define SYBEBUCE 20087
972 #define SYBEBWEF 20088
973 #define SYBEASTF 20089
974 #define SYBEUACS 20090
975 #define SYBEASEC 20091
976 #define SYBETMTD 20092
977 #define SYBENTTN 20093
978 #define SYBEDNTI 20094
979 #define SYBEBTMT 20095
980 #define SYBEORPF 20096
981 #define SYBEUVBF 20097
982 #define SYBEBUOF 20098
983 #define SYBEBUCF 20099
984 #define SYBEBRFF 20100
985 #define SYBEBWFF 20101
986 #define SYBEBUDF 20102
987 #define SYBEBIHC 20103
988 #define SYBEBEOF 20104
989 #define SYBEBCNL 20105
990 #define SYBEBCSI 20106
991 #define SYBEBCIT 20107
992 #define SYBEBCSA 20108
993 #define SYBENULL 20109
994 #define SYBEUNAM 20110
995 #define SYBEBCRO 20111
996 #define SYBEMPLL 20112
997 #define SYBERPIL 20113
998 #define SYBERPUL 20114
999 #define SYBEUNOP 20115
1000 #define SYBECRNC 20116
1001 #define SYBERTCC 20117
1002 #define SYBERTSC 20118
1003 #define SYBEUCRR 20119
1004 #define SYBERPNA 20120
1005 #define SYBEOPNA 20121
1006 #define SYBEFGTL 20122
1007 #define SYBECWLL 20123
1008 #define SYBEUFDS 20124
1009 #define SYBEUCPT 20125
1010 #define SYBETMCF 20126
1011 #define SYBEAICF 20127
1012 #define SYBEADST 20128
1013 #define SYBEALTT 20129
1014 #define SYBEAPCT 20130
1015 #define SYBEXOCI 20131
1016 #define SYBEFSHD 20132
1017 #define SYBEAOLF 20133
1018 #define SYBEARDI 20134
1019 #define SYBEURCI 20135
1020 #define SYBEARDL 20136
1021 #define SYBEURMI 20137
1022 #define SYBEUREM 20138
1023 #define SYBEURES 20139
1024 #define SYBEUREI 20140
1025 #define SYBEOREN 20141
1026 #define SYBEISOI 20142
1027 #define SYBEIDCL 20143
1028 #define SYBEIMCL 20144
1029 #define SYBEIFCL 20145
1030 #define SYBEUTDS 20146
1031 #define SYBEBUFF 20147
1032 #define SYBEACNV 20148
1033 #define SYBEDPOR 20149
1034 #define SYBENDC 20150
1035 #define SYBEMVOR 20151
1036 #define SYBEDVOR 20152
1037 #define SYBENBVP 20153
1038 #define SYBESPID 20154
1039 #define SYBENDTP 20155
1040 #define SYBEXTN 20156
1041 #define SYBEXTDN 20157
1042 #define SYBEXTSN 20158
1043 #define SYBENUM 20159
1044 #define SYBETYPE 20160
1045 #define SYBEGENOS 20161
1046 #define SYBEPAGE 20162
1047 #define SYBEOPTNO 20163
1048 #define SYBEETD 20164
1049 #define SYBERTYPE 20165
1050 #define SYBERFILE 20166
1051 #define SYBEFMODE 20167
1052 #define SYBESLCT 20168
1053 #define SYBEZTXT 20169
1054 #define SYBENTST 20170
1055 #define SYBEOSSL 20171
1056 #define SYBEESSL 20172
1057 #define SYBENLNL 20173
1058 #define SYBENHAN 20174
1059 #define SYBENBUF 20175
1060 #define SYBENULP 20176
1061 #define SYBENOTI 20177
1062 #define SYBEEVOP 20178
1063 #define SYBENEHA 20179
1064 #define SYBETRAN 20180
1065 #define SYBEEVST 20181
1066 #define SYBEEINI 20182
1067 #define SYBEECRT 20183
1068 #define SYBEECAN 20184
1069 #define SYBEEUNR 20185
1070 #define SYBERPCS 20186
1071 #define SYBETPAR 20187
1072 #define SYBETEXS 20188
1073 #define SYBETRAC 20189
1074 #define SYBETRAS 20190
1075 #define SYBEPRTF 20191
1076 #define SYBETRSN 20192
1077 #define SYBEBPKS 20193
1078 #define SYBEIPV 20194
1079 #define SYBEMOV 20195
1080 #define SYBEDIVZ 20196
1081 #define SYBEASTL 20197
1082 #define SYBESEFA 20198
1083 #define SYBEPOLL 20199
1084 #define SYBENOEV 20200
1085 #define SYBEBADPK 20201
1086 #define SYBESECURE 20202
1087 #define SYBECAP 20203
1088 #define SYBEFUNC 20204
1089 #define SYBERESP 20205
1090 #define SYBEIVERS 20206
1091 #define SYBEONCE 20207
1092 #define SYBERPNULL 20208
1093 #define SYBERPTXTIM 20209
1094 #define SYBENEG 20210
1095 #define SYBELBLEN 20211
1096 #define SYBEUMSG 20212
1097 #define SYBECAPTYP 20213
1098 #define SYBEBNUM 20214
1099 #define SYBEBBL 20215
1100 #define SYBEBPREC 20216
1101 #define SYBEBSCALE 20217
1102 #define SYBECDOMAIN 20218
1103 #define SYBECINTERNAL 20219
1104 #define SYBEBTYPSRV 20220
1105 #define SYBEBCSET 20221
1106 #define SYBEFENC 20222
1107 #define SYBEFRES 20223
1108 #define SYBEISRVPREC 20224
1109 #define SYBEISRVSCL 20225
1110 #define SYBEINUMCL 20226
1111 #define SYBEIDECCL 20227
1112 #define SYBEBCMTXT 20228
1113 #define SYBEBCPREC 20229
1114 #define SYBEBCBNPR 20230
1115 #define SYBEBCBNTYP 20231
1116 #define SYBEBCSNTYP 20232
1117 #define SYBEBCPCTYP 20233
1118 #define SYBEBCVLEN 20234
1119 #define SYBEBCHLEN 20235
1120 #define SYBEBCBPREF 20236
1121 #define SYBEBCPREF 20237
1122 #define SYBEBCITBNM 20238
1123 #define SYBEBCITBLEN 20239
1124 #define SYBEBCSNDROW 20240
1125 #define SYBEBPROCOL 20241
1126 #define SYBEBPRODEF 20242
1127 #define SYBEBPRONUMDEF 20243
1128 #define SYBEBPRODEFID 20244
1129 #define SYBEBPRONODEF 20245
1130 #define SYBEBPRODEFTYP 20246
1131 #define SYBEBPROEXTDEF 20247
1132 #define SYBEBPROEXTRES 20248
1133 #define SYBEBPROBADDEF 20249
1134 #define SYBEBPROBADTYP 20250
1135 #define SYBEBPROBADLEN 20251
1136 #define SYBEBPROBADPREC 20252
1137 #define SYBEBPROBADSCL 20253
1138 #define SYBEBADTYPE 20254
1139 #define SYBECRSNORES 20255
1140 #define SYBECRSNOIND 20256
1141 #define SYBECRSVIEW 20257
1142 #define SYBECRSVIIND 20258
1143 #define SYBECRSORD 20259
1144 #define SYBECRSBUFR 20260
1145 #define SYBECRSNOFREE 20261
1146 #define SYBECRSDIS 20262
1147 #define SYBECRSAGR 20263
1148 #define SYBECRSFRAND 20264
1149 #define SYBECRSFLAST 20265
1150 #define SYBECRSBROL 20266
1151 #define SYBECRSFROWN 20267
1152 #define SYBECRSBSKEY 20268
1153 #define SYBECRSRO 20269
1154 #define SYBECRSNOCOUNT 20270
1155 #define SYBECRSTAB 20271
1156 #define SYBECRSUPDNB 20272
1157 #define SYBECRSNOWHERE 20273
1158 #define SYBECRSSET 20274
1159 #define SYBECRSUPDTAB 20275
1160 #define SYBECRSNOUPD 20276
1161 #define SYBECRSINV 20277
1162 #define SYBECRSNOKEYS 20278
1163 #define SYBECRSNOBIND 20279
1164 #define SYBECRSFTYPE 20280
1165 #define SYBECRSINVALID 20281
1166 #define SYBECRSMROWS 20282
1167 #define SYBECRSNROWS 20283
1168 #define SYBECRSNOLEN 20284
1169 #define SYBECRSNOPTCC 20285
1170 #define SYBECRSNORDER 20286
1171 #define SYBECRSNOTABLE 20287
1172 #define SYBECRSNUNIQUE 20288
1173 #define SYBECRSVAR 20289
1174 #define SYBENOVALUE 20290
1175 #define SYBEVOIDRET 20291
1176 #define SYBECLOSEIN 20292
1177 #define SYBEBOOL 20293
1178 #define SYBEBCPOPT 20294
1179 #define SYBEERRLABEL 20295
1180 #define SYBEATTNACK 20296
1181 #define SYBEBBFL 20297
1182 #define SYBEDCL 20298
1183 #define SYBECS 20299
1184 #define SYBEBULKINSERT 20599
1185 #define SYBECOLSIZE 22000
1189 #define DBTDS(a) dbtds(a)
1190 DBINT dbtextsize(
DBPROCESS * dbprocess);
1193 DBBINARY *dbtxtsnewval(
DBPROCESS * dbprocess);
1194 RETCODE dbtxtsput(
DBPROCESS * dbprocess, DBBINARY newtxts,
int colnum);
1198 RETCODE
dbwritetext(
DBPROCESS * dbproc,
char *objname, DBBINARY * textptr, DBTINYINT textptrlen, DBBINARY * timestamp,
1199 DBBOOL log, DBINT size, BYTE * text);
1208 #define DBSETLHOST(x,y) dbsetlname((x), (y), DBSETHOST)
1209 #define dbsetlhost(x,y) dbsetlname((x), (y), DBSETHOST)
1211 #define DBSETLUSER(x,y) dbsetlname((x), (y), DBSETUSER)
1212 #define dbsetluser(x,y) dbsetlname((x), (y), DBSETUSER)
1214 #define DBSETLPWD(x,y) dbsetlname((x), (y), DBSETPWD)
1215 #define dbsetlpwd(x,y) dbsetlname((x), (y), DBSETPWD)
1216 #if defined(DBLIB_UNIMPLEMENTED)
1218 # define DBSETLHID(x,y) dbsetlname((x), (y), DBSETHID)
1221 #define DBSETLAPP(x,y) dbsetlname((x), (y), DBSETAPP)
1222 #define dbsetlapp(x,y) dbsetlname((x), (y), DBSETAPP)
1224 #define BCP_SETL(x,y) dbsetlbool((x), (y), DBSETBCP)
1225 #define DBSETLSECURE(x) dbsetlbool((x), (1), DBSETBCP)
1226 #define DBSETNATLANG 7
1227 #define DBSETLNATLANG(x,y) dbsetlname((x), (y), DBSETNATLANG)
1228 #define dbsetlnatlang(x,y) dbsetlname((x), (y), DBSETNATLANG)
1229 #if defined(DBLIB_UNIMPLEMENTED)
1230 # define DBSETNOSHORT 8
1231 # define DBSETLNOSHORT(x,y) dbsetlbool((x), (y), DBSETNOSHORT)
1232 # define DBSETHIER 9
1233 # define DBSETLHIER(x,y) dbsetlshort((x), (y), DBSETHIER)
1235 #define DBSETCHARSET 10
1236 #define DBSETLCHARSET(x,y) dbsetlname((x), (y), DBSETCHARSET)
1237 #define DBSETPACKET 11
1238 #define DBSETLPACKET(x,y) dbsetllong((x), (y), DBSETPACKET)
1239 #define dbsetlpacket(x,y) dbsetllong((x), (y), DBSETPACKET)
1240 #define DBSETENCRYPT 12
1241 #define DBSETLENCRYPT(x,y) dbsetlbool((x), (y), DBSETENCRYPT)
1242 #define DBSETLABELED 13
1243 #define DBSETLLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1244 #define BCP_SETLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1245 #define DBSETDBNAME 14
1246 #define DBSETLDBNAME(x,y) dbsetlname((x), (y), DBSETDBNAME)
1247 #define DBSETLVERSION(login, version) dbsetlversion((login), (version))
1249 RETCODE
bcp_init(
DBPROCESS * dbproc,
const char *tblname,
const char *hfile,
const char *errfile,
int direction);
1253 RETCODE
bcp_bind(
DBPROCESS * dbproc, BYTE * varaddr,
int prefixlen, DBINT varlen, BYTE * terminator,
int termlen,
int type,
1257 RETCODE
bcp_colfmt(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1258 const BYTE * host_term,
int host_termlen,
int colnum);
1259 RETCODE
bcp_colfmt_ps(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1260 BYTE * host_term,
int host_termlen,
int colnum,
DBTYPEINFO * typeinfo);
1263 int bcp_getbatchsize(
DBPROCESS * dbproc);
DBINT dbvarylen(DBPROCESS *dbproc, int column)
Determine whether a column can vary in size.
Definition: dblib.c:3092
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
int dbiordesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to read data coming from the server...
Definition: dblib.c:6997
DBUBIGINT time
time, 7 digit precision
Definition: sybdb.h:307
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
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition: dblib.c:721
RETCODE bcp_options(DBPROCESS *dbproc, int option, BYTE *value, int valuelen)
Set "hints" for uploading a file.
Definition: bcp.c:610
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:2921
int dbgettime(void)
Get maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4026
int dbtds(DBPROCESS *dbprocess)
Get the TDS version in use for dbproc.
Definition: dblib.c:6566
BYTE * dbretdata(DBPROCESS *dbproc, int retnum)
Get value of an output parameter filled by a stored procedure.
Definition: dblib.c:4551
RETCODE dbcmdrow(DBPROCESS *dbproc)
See if the current command can return rows.
Definition: dblib.c:4063
RETCODE dbrpcsend(DBPROCESS *dbproc)
Execute the procedure and free associated memory.
Definition: rpc.c:277
DBSMALLINT offset
time offset
Definition: sybdb.h:309
DBTYPEINFO * dbcoltypeinfo(DBPROCESS *dbproc, int column)
Get precision and scale information for a regular result column.
Definition: dblib.c:2892
RETCODE dbmnydec(DBPROCESS *dbproc, DBMONEY *mnyptr)
Subtract $0.0001 from a DBMONEY value.
Definition: dblib.c:5293
RETCODE dbsetversion(DBINT version)
Specify a db-lib version level.
Definition: dblib.c:5756
void dbloginfree(LOGINREC *login)
free the LOGINREC
Definition: dblib.c:753
void dbexit(void)
Close server connections and free all related structures.
Definition: dblib.c:1543
char * dbretname(DBPROCESS *dbproc, int retnum)
Get name of an output parameter filled by a stored procedure.
Definition: dblib.c:4522
DBINT bcp_batch(DBPROCESS *dbproc)
Commit a set of rows to the table.
Definition: bcp.c:1940
RETCODE dbspr1row(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print a regular result row to a buffer.
Definition: dblib.c:3265
int dbdatecmp(DBPROCESS *dbproc, DBDATETIME *d1, DBDATETIME *d2)
Compare DBDATETIME values, similar to strcmp(3).
Definition: dblib.c:5567
RETCODE dbmny4copy(DBPROCESS *dbprocess, DBMONEY4 *m1, DBMONEY4 *m2)
Copy a DBMONEY4 value.
Definition: dblib.c:5542
DBINT dbcolutype(DBPROCESS *dbprocess, int column)
Get user-defined datatype of a regular result column.
Definition: dblib.c:2869
RETCODE dbsetllong(LOGINREC *login, long value, int which)
Set an integer value in a LOGINREC structure.
Definition: dblib.c:836
DBINT dblastrow(DBPROCESS *dbproc)
Get number of the last row in the row buffer.
Definition: dblib.c:6973
RETCODE bcp_exec(DBPROCESS *dbproc, DBINT *rows_copied)
Write a datafile to a table.
Definition: bcp.c:1554
int dbaltcolid(DBPROCESS *dbproc, int computeid, int column)
Get column ID of a compute column.
Definition: dblib.c:4087
RETCODE dbcancel(DBPROCESS *dbproc)
Cancel the current command batch.
Definition: dblib.c:3202
const char * dbmonthname(DBPROCESS *dbproc, char *language, int monthnum, DBBOOL shortform)
Get name of a month, in some human language.
Definition: dblib.c:6723
DBINT dbdatlen(DBPROCESS *dbproc, int column)
Get size of current row's data in a regular result column.
Definition: dblib.c:3141
RETCODE dbprrow(DBPROCESS *dbproc)
Print a result set to stdout.
Definition: dblib.c:3347
STATUS dbsetrow(DBPROCESS *dbprocess, DBINT row)
Make a buffered row "current" without fetching it into bound variables.
Definition: dblib.c:2013
RETCODE dbsetopt(DBPROCESS *dbproc, int option, const char *char_param, int int_param)
Set db-lib or server option.
Definition: dblib.c:4285
DBINT date
date, 0 = 1900-01-01
Definition: sybdb.h:308
RETCODE dbuse(DBPROCESS *dbproc, const char *name)
Change current database.
Definition: dblib.c:1431
void dbrecftos(const char filename[])
Record to a file all SQL commands sent to the server.
Definition: dblib.c:6532
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:6359
RETCODE dbmnyzero(DBPROCESS *dbproc, DBMONEY *dest)
Set a DBMONEY value to zero.
Definition: dblib.c:5126
DBBOOL bcp_getl(LOGINREC *login)
See if BCP_SETL() was used to set the LOGINREC for BCP work.
Definition: bcp.c:694
RETCODE dbmny4add(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *sum)
Add two DBMONEY4 values.
Definition: dblib.c:5395
RETCODE bcp_readfmt(DBPROCESS *dbproc, const char filename[])
Read a format definition file.
Definition: bcp.c:1615
DBBOOL dbhasretstat(DBPROCESS *dbproc)
Determine if query generated a return status number.
Definition: dblib.c:4448
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:4429
BYTE * dbbylist(DBPROCESS *dbproc, int computeid, int *size)
Get bylist for a compute row.
Definition: dblib.c:4801
STATUS dbrowtype(DBPROCESS *dbprocess)
Get returned row's type.
Definition: dblib.c:5966
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 dbaltop(DBPROCESS *dbproc, int computeid, int column)
Get aggregation operator for a compute column.
Definition: dblib.c:4257
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition: dblib.c:4923
RETCODE dbmnyinc(DBPROCESS *dbproc, DBMONEY *mnyptr)
Add $0.0001 to a DBMONEY value.
Definition: dblib.c:5265
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:2257
int dbgetmaxprocs(void)
get maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3978
RETCODE dbsetnull(DBPROCESS *dbprocess, int bindtype, int bindlen, BYTE *bindval)
Define substitution values to be used when binding null values.
Definition: dblib.c:1930
RETCODE dbmorecmds(DBPROCESS *dbproc)
See if more commands are to be processed.
Definition: dblib.c:6000
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition: dblib.c:4942
int dbnumcols(DBPROCESS *dbproc)
Return number of regular columns in a result set.
Definition: dblib.c:1842
RETCODE dbanullbind(DBPROCESS *dbprocess, int computeid, int column, DBINT *indicator)
Tie a null-indicator to a compute result column.
Definition: dblib.c:2725
DBINT dbfirstrow(DBPROCESS *dbproc)
See if a server response has arrived.
Definition: dblib.c:6958
RETCODE dbsprhead(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print result set headings to a buffer.
Definition: dblib.c:3701
RETCODE dbrpcinit(DBPROCESS *dbproc, const char rpcname[], DBSMALLINT options)
Initialize a remote procedure call.
Definition: rpc.c:72
DBINT dbcollen(DBPROCESS *dbproc, int column)
Get size of a regular result column.
Definition: dblib.c:3043
BYTE * dbgetuserdata(DBPROCESS *dbproc)
Get address of user-allocated data from a DBPROCESS.
Definition: dblib.c:5738
DBINT dbprcollen(DBPROCESS *dbproc, int column)
Get size of a result column needed to print column.
Definition: dblib.c:3066
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:4181
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
Definition: dblib.c:1353
int dbcurcmd(DBPROCESS *dbproc)
Get number of the row just returned.
Definition: dblib.c:5983
RETCODE bcp_columns(DBPROCESS *dbproc, int host_colcount)
Indicate how many columns are to be found in the datafile.
Definition: bcp.c:299
Definition: dbpivot.c:757
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 bcp_colptr(DBPROCESS *dbproc, BYTE *colptr, int table_column)
Override bcp_bind() by pointing to a different host variable.
Definition: bcp.c:658
int dbstrlen(DBPROCESS *dbproc)
Get size of the command buffer, in bytes.
Definition: dblib.c:6056
RETCODE dbsprline(DBPROCESS *dbproc, char *buffer, DBINT buf_len, DBCHAR line_char)
Get formatted string for underlining dbsprhead() column names.
Definition: dblib.c:3643
char * dbservcharset(DBPROCESS *dbprocess)
Get syscharset name of the server character set.
Definition: dblib.c:6788
RETCODE bcp_sendrow(DBPROCESS *dbproc)
Write data in host variables to the table.
Definition: bcp.c:1327
int dbnumalts(DBPROCESS *dbproc, int computeid)
Get count of columns in a compute row.
Definition: dblib.c:4742
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
void dbclose(DBPROCESS *dbproc)
Close a connection to the server and free associated resources.
Definition: dblib.c:1474
char * dbcolname(DBPROCESS *dbproc, int column)
Return name of a regular result column.
Definition: dblib.c:1866
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Definition: dblib.c:6772
void dbsetuserdata(DBPROCESS *dbproc, BYTE *ptr)
Associate client-allocated (and defined) data with a DBPROCESS.
Definition: dblib.c:5720
void dbclrbuf(DBPROCESS *dbproc, DBINT n)
Clear n rows from the row buffer.
Definition: dblib.c:2793
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:6230
RETCODE dbsqlok(DBPROCESS *dbproc)
Wait for results of a query from the server.
Definition: dblib.c:4615
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition: bcp.c:536
RETCODE dbsqlsend(DBPROCESS *dbproc)
Transmit the command buffer to the server.
Definition: dblib.c:6808
RETCODE dbsettime(int seconds)
Set maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:3999
DBINT bcp_done(DBPROCESS *dbproc)
Conclude the transfer of data from program variables.
Definition: bcp.c:1967
RETCODE dbdatecrack(DBPROCESS *dbproc, DBDATEREC *di, DBDATETIME *dt)
Break a DBDATETIME value into useful pieces.
Definition: dblib.c:5612
RETCODE dbcanquery(DBPROCESS *dbproc)
Cancel the query currently being retrieved, discarding all pending rows.
Definition: dblib.c:5810
RETCODE dbmnyminus(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Negate a DBMONEY value.
Definition: dblib.c:5321
int dbretlen(DBPROCESS *dbproc, int retnum)
Get size of an output parameter filled by a stored procedure.
Definition: dblib.c:4580
DBBINARY * dbtxptr(DBPROCESS *dbproc, int column)
Get text pointer for a column in the current row.
Definition: dblib.c:6322
DBINT dbaltutype(DBPROCESS *dbproc, int computeid, int column)
Get user-defined datatype of a compute column.
Definition: dblib.c:6879
RETCODE dbclropt(DBPROCESS *dbproc, int option, const char param[])
Reset an option.
Definition: dblib.c:5874
DBBOOL dbdead(DBPROCESS *dbproc)
Check if dbproc is an ex-parrot.
Definition: dblib.c:4860
RETCODE dbsetmaxprocs(int maxprocs)
Set maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3904
int dbspid(DBPROCESS *dbproc)
Get server process ID for a DBPROCESS.
Definition: dblib.c:5694
DBPROCESS * dbopen(LOGINREC *login, const char *server)
Normally not used.
Definition: dbopen.c:35
DBINT dbaltlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in compute column.
Definition: dblib.c:6903
BYTE * dbdata(DBPROCESS *dbproc, int column)
Get address of data in a regular result column.
Definition: dblib.c:3169
DBINT dbspr1rowlen(DBPROCESS *dbproc)
Determine size buffer required to hold the results returned by dbsprhead(), dbsprline(), and dbspr1row().
Definition: dblib.c:3227
char * dbchange(DBPROCESS *dbprocess)
See if a command caused the current database to change.
Definition: dblib.c:6752
DBINT dbconvert(DBPROCESS *dbproc, int srctype, const BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen)
cf.
Definition: dblib.c:2544
RETCODE dbmny4minus(DBPROCESS *dbproc, DBMONEY4 *src, DBMONEY4 *dest)
Negate a DBMONEY4 value.
Definition: dblib.c:5348
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:7066
int dbmny4cmp(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2)
Compare two DBMONEY4 values.
Definition: dblib.c:5514
void dbfreebuf(DBPROCESS *dbproc)
Erase the command buffer, in case DBNOAUTOFREE was set with dbsetopt().
Definition: dblib.c:5840
DBPROCESS * tdsdbopen(LOGINREC *login, const char *server, int msdblib)
Form a connection with the server.
Definition: dblib.c:1165
RETCODE dbsetlbool(LOGINREC *login, int value, int which)
Set a boolean value in a LOGINREC structure.
Definition: dblib.c:907
RETCODE dbsetlname(LOGINREC *login, const char *value, int which)
Set the value of a string in a LOGINREC structure.
Definition: dblib.c:775
char * dbgetchar(DBPROCESS *dbprocess, int n)
Get address of a position in the command buffer.
Definition: dblib.c:6075
BYTE * dbadata(DBPROCESS *dbproc, int computeid, int column)
Get address of compute column data.
Definition: dblib.c:4227
RETCODE dbinit(void)
Initialize db-lib.
Definition: dblib.c:676
RETCODE dbmnymaxneg(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum negative DBMONEY value supported.
Definition: dblib.c:5168
DBBOOL dbwillconvert(int srctype, int desttype)
Test whether or not a datatype can be converted to another datatype.
Definition: dblib.c:2823
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 dbstrcpy(DBPROCESS *dbproc, int start, int numbytes, char *dest)
Get a copy of a chunk of the command buffer.
Definition: dblib.c:6108
int dbnumcompute(DBPROCESS *dbprocess)
Get count of COMPUTE clauses for a result set.
Definition: dblib.c:4775
RETCODE dbsetlogintime(int seconds)
Set maximum seconds db-lib waits for a server response to a login attempt.
Definition: dblib.c:4042
DBINT dbcount(DBPROCESS *dbproc)
Get count of rows processed.
Definition: dblib.c:2773
RETCODE dbmny4sub(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *diff)
Subtract two DBMONEY4 values.
Definition: dblib.c:5426
STATUS dbreadtext(DBPROCESS *dbproc, void *buf, DBINT bufsize)
Fetch part of a text or image value from the server.
Definition: dblib.c:6428
Definition: bsqlodbc.c:97
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
void dbsetifile(char *filename)
set name and location of the interfaces file FreeTDS should use to look up a servername.
Definition: dblib.c:2660
RETCODE dbfcmd(DBPROCESS *dbproc, const char *fmt,...)
printf-like way to form SQL to send to the server.
Definition: dblib.c:1314
RETCODE dbsetlversion(LOGINREC *login, BYTE version)
Set TDS version for future connections.
Definition: dblib.c:936
int dbrettype(DBPROCESS *dbproc, int retnum)
Get datatype of a stored procedure's return parameter.
Definition: dblib.c:6031
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:6152
const char * dbversion(void)
See which version of db-lib is in use.
Definition: dblib.c:6605
RETCODE dbmnymaxpos(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum positive DBMONEY value supported.
Definition: dblib.c:5147
RETCODE dbmoretext(DBPROCESS *dbproc, DBINT size, const BYTE text[])
Send chunk of a text/image value to the server.
Definition: dblib.c:6497
void dbprhead(DBPROCESS *dbproc)
Print result set headings to stdout.
Definition: dblib.c:3764
DBINT dbretstatus(DBPROCESS *dbproc)
Fetch status value returned by query or remote procedure call.
Definition: dblib.c:4472
DBINT dbadlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in a compute column.
Definition: dblib.c:4114
DBBOOL dbisopt(DBPROCESS *dbproc, int option, const char param[])
Get value of an option.
Definition: dblib.c:5926
RETCODE dbbind(DBPROCESS *dbproc, int column, int vartype, DBINT varlen, BYTE *varaddr)
Tie a host variable to a resultset column.
Definition: dblib.c:2583
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition: dblib.c:1405
RETCODE dbrows(DBPROCESS *dbproc)
Indicate whether a query returned rows.
Definition: dblib.c:3839
int dbiowdesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to write data coming to the server...
Definition: dblib.c:7013
const char * dbprtype(int token)
Print a token value's name to a buffer.
Definition: dblib.c:6213
RETCODE dbgetrow(DBPROCESS *dbproc, DBINT row)
Read a row from the row buffer.
Definition: dblib.c:1898
int dbgetpacket(DBPROCESS *dbproc)
Get TDS packet size for the connection.
Definition: dblib.c:3880
DBINT dbcurrow(DBPROCESS *dbproc)
Get number of the row currently being read.
Definition: dblib.c:5949
int dbnumrets(DBPROCESS *dbproc)
Get count of output parameters filled by a stored procedure.
Definition: dblib.c:4490
int dbmnycmp(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2)
Compare two DBMONEY values.
Definition: dblib.c:5068
int dbalttype(DBPROCESS *dbproc, int computeid, int column)
Get datatype for a compute column.
Definition: dblib.c:4145
RETCODE dbmnycopy(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Copy a DBMONEY value.
Definition: dblib.c:5789
void dbsetavail(DBPROCESS *dbprocess)
Mark a DBPROCESS as "available".
Definition: dblib.c:7041
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition: dblib.c:1690
RETCODE dbnullbind(DBPROCESS *dbproc, int column, DBINT *indicator)
Tie a null-indicator to a regular result column.
Definition: dblib.c:2689
DBBINARY * dbtxtimestamp(DBPROCESS *dbproc, int column)
Get text timestamp for a column in the current row.
Definition: dblib.c:6292
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition: dblib.c:2840
BOOL dbiscount(DBPROCESS *dbproc)
Indicates whether or not the count returned by dbcount is real (Microsoft-compatibility feature)...
Definition: dblib.c:2753
char * dbcolsource(DBPROCESS *dbproc, int colnum)
Get base database column name for a result set column.
Definition: dblib.c:3018
RETCODE dbmny4zero(DBPROCESS *dbproc, DBMONEY4 *dest)
Zero a DBMONEY4 value.
Definition: dblib.c:5372