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
70 #define DBVERSION_UNKNOWN 0
71 #define DBVERSION_46 1
72 #define DBVERSION_100 2
73 #define DBVERSION_42 3
74 #define DBVERSION_70 4
75 #define DBVERSION_71 5
76 #define DBVERSION_72 6
77 #define DBVERSION_73 7
78 #define DBVERSION_74 8
81 #define DBVER42 DBVERSION_42
82 #define DBVER60 DBVERSION_70
88 #define DBTDS_UNKNOWN 0
110 #define BCPKEEPIDENTITY 8
121 typedef void DBCURSOR;
122 typedef void DBXLATE;
123 typedef void DBSORTORDER;
124 typedef void DBLOGINFO;
125 typedef void *DBVOIDPTR;
127 typedef unsigned short USHORT;
128 typedef int (*INTFUNCPTR) (
void *, ...);
129 typedef int (*DBWAITFUNC) (void);
130 typedef DBWAITFUNC(*DB_DBBUSY_FUNC) (
void *dbproc);
131 typedef void (*DB_DBIDLE_FUNC) (DBWAITFUNC dfunc,
void *dbproc);
132 typedef int (*DB_DBCHKINTR_FUNC) (
void *dbproc);
133 typedef int (*DB_DBHNDLINTR_FUNC) (
void *dbproc);
135 #ifndef __INCvxWorksh
147 #if !defined(_WINDEF_) && !defined(_WINDEF_H) && !defined(DOS32X)
158 #define SYBCHAR SYBCHAR
160 #define SYBVARCHAR SYBVARCHAR
162 #define SYBINTN SYBINTN
164 #define SYBINT1 SYBINT1
166 #define SYBINT2 SYBINT2
168 #define SYBINT4 SYBINT4
170 #define SYBINT8 SYBINT8
172 #define SYBFLT8 SYBFLT8
174 #define SYBDATETIME SYBDATETIME
176 #define SYBBIT SYBBIT
178 #define SYBBITN SYBBITN
180 #define SYBTEXT SYBTEXT
182 #define SYBNTEXT SYBNTEXT
184 #define SYBIMAGE SYBIMAGE
186 #define SYBMONEY4 SYBMONEY4
188 #define SYBMONEY SYBMONEY
190 #define SYBDATETIME4 SYBDATETIME4
192 #define SYBREAL SYBREAL
194 #define SYBBINARY SYBBINARY
196 #define SYBVOID SYBVOID
198 #define SYBVARBINARY SYBVARBINARY
200 #define SYBNUMERIC SYBNUMERIC
202 #define SYBDECIMAL SYBDECIMAL
204 #define SYBFLTN SYBFLTN
206 #define SYBMONEYN SYBMONEYN
208 #define SYBDATETIMN SYBDATETIMN
210 #define SYBNVARCHAR SYBNVARCHAR
212 #define SYBDATE SYBDATE
214 #define SYBTIME SYBTIME
215 SYBBIGDATETIME = 187,
216 #define SYBBIGDATETIME SYBBIGDATETIME
218 #define SYBBIGTIME SYBBIGTIME
220 #define SYBMSDATE SYBMSDATE
222 #define SYBMSTIME SYBMSTIME
224 #define SYBMSDATETIME2 SYBMSDATETIME2
225 SYBMSDATETIMEOFFSET = 43,
226 #define SYBMSDATETIMEOFFSET SYBMSDATETIMEOFFSET
229 #define SYBAOPCNT 0x4b
230 #define SYBAOPCNTU 0x4c
231 #define SYBAOPSUM 0x4d
232 #define SYBAOPSUMU 0x4e
233 #define SYBAOPAVG 0x4f
234 #define SYBAOPAVGU 0x50
235 #define SYBAOPMIN 0x51
236 #define SYBAOPMAX 0x52
239 #define SYBAOPCNT_BIG 0x09
240 #define SYBAOPSTDEV 0x30
241 #define SYBAOPSTDEVP 0x31
242 #define SYBAOPVAR 0x32
243 #define SYBAOPVARP 0x33
244 #define SYBAOPCHECKSUM_AGG 0x72
248 typedef unsigned char DBBOOL;
250 typedef unsigned char DBBIT;
251 typedef unsigned char DBTINYINT;
252 typedef int16_t DBSMALLINT;
253 typedef int32_t DBINT;
254 typedef int64_t DBBIGINT;
255 typedef unsigned char DBBINARY;
256 typedef tds_sysdep_real32_type DBREAL;
257 typedef tds_sysdep_real64_type DBFLT8;
258 typedef uint16_t DBUSMALLINT;
259 typedef uint32_t DBUINT;
260 typedef uint64_t DBUBIGINT;
271 unsigned char array[256];
276 unsigned char precision;
278 unsigned char array[33];
311 DBUSMALLINT time_prec:3;
313 DBUSMALLINT has_time:1;
314 DBUSMALLINT has_date:1;
315 DBUSMALLINT has_offset:1;
319 # define SQLCHAR SYBCHAR
330 typedef unsigned char BYTE;
349 { MAXCOLNAMELEN = 512 };
350 typedef enum { CI_REGULAR=1, CI_ALTERNATE=2, CI_CURSOR=3 } CI_TYPE;
355 DBCHAR Name[MAXCOLNAMELEN+2];
356 DBCHAR ActualName[MAXCOLNAMELEN+2];
357 DBCHAR TableName[MAXCOLNAMELEN+2];
374 DBCHAR Name[MAXCOLNAMELEN+2];
375 DBCHAR ActualName[MAXCOLNAMELEN+2];
376 DBCHAR TableName[MAXCOLNAMELEN+2];
388 DBINT ServerMaxLength;
389 DBCHAR ServerTypeDeclaration[256];
396 #define DBPARSEONLY 0
400 #define DBARITHIGNORE 4
402 #define DBARITHABORT 6
403 #define DBTEXTLIMIT 7
409 #define DBSTORPROCID 13
411 #define DBNOAUTOFREE 15
412 #define DBROWCOUNT 16
413 #define DBTEXTSIZE 17
415 #define DBDATEFORMAT 19
417 #define DBPRCOLSEP 21
418 #define DBPRLINELEN 22
419 #define DBPRLINESEP 23
420 #define DBLFCONVERT 24
421 #define DBDATEFIRST 25
422 #define DBCHAINXACTS 26
423 #define DBFIPSFLAG 27
424 #define DBISOLATION 28
426 #define DBIDENTITY 30
428 #define DBDATESHORT 32
429 #define DBCLIENTCURSORS 33
431 #define DBQUOTEDIDENT 35
433 #define DBNUMOPTIONS 36
441 #define NOSUCHOPTION 2
443 #define MAXOPTTEXT 32
528 typedef int (*EHANDLEFUNC) (
DBPROCESS * dbproc,
int severity,
int dberr,
int oserr,
char *dberrstr,
char *oserrstr);
530 typedef int (*MHANDLEFUNC) (
DBPROCESS * dbproc, DBINT msgno,
int msgstate,
int severity,
char *msgtext,
char *srvname,
531 char *proc,
int line);
535 #define DBNOTIFICATION 2
537 #define DBINTERRUPT 4
545 #define NTBSTRINGBIND 2
546 #define VARYCHARBIND 3
547 #define VARYBINBIND 4
553 #define DATETIMEBIND 11
554 #define SMALLDATETIMEBIND 12
556 #define SMALLMONEYBIND 14
557 #define BINARYBIND 15
559 #define NUMERICBIND 17
560 #define DECIMALBIND 18
561 #define SRCNUMERICBIND 19
562 #define SRCDECIMALBIND 20
565 #define BIGDATETIMEBIND 23
566 #define BIGTIMEBIND 24
567 #define BIGINTBIND 30
568 #define DATETIME2BIND 31
569 #define MAXBINDTYPES 32
571 #define DBPRCOLSEP 21
572 #define DBPRLINELEN 22
573 #define DBRPCRETURN 1
574 #define DBRPCDEFAULT 2
578 #define NO_MORE_ROWS -2
580 #define NO_MORE_RESULTS 2
586 #define DB_QUERYOUT 3
593 #define DBRPCRECOMPILE TDS_STATIC_CAST(DBSMALLINT, 0x0001)
594 #define DBRPCRESET TDS_STATIC_CAST(DBSMALLINT, 0x0002)
595 #define DBRPCCURSOR TDS_STATIC_CAST(DBSMALLINT, 0x0008)
597 #if defined(DBLIB_UNIMPLEMENTED)
598 DBBOOL db12hour(
DBPROCESS * dbprocess,
const char language[]);
600 DBBOOL dbcolbrowse(
DBPROCESS * dbprocess,
int colnum);
602 RETCODE dbcursor(DBCURSOR * hc, DBINT optype, DBINT bufno, BYTE * table, BYTE * values);
603 RETCODE dbcursorbind(DBCURSOR * hc,
int col,
int vartype, DBINT varlen, DBINT * poutlen, BYTE * pvaraddr,
DBTYPEINFO * typeinfo);
604 void dbcursorclose(DBCURSOR * hc);
605 RETCODE dbcursorcolinfo(DBCURSOR * hc, DBINT column, DBCHAR * colname, DBINT * coltype, DBINT * collen, DBINT * usertype);
606 RETCODE dbcursorfetch(DBCURSOR * hc, DBINT fetchtype, DBINT rownum);
607 RETCODE dbcursorinfo(DBCURSOR * hc, DBINT * ncols, DBINT * nrows);
608 DBCURSOR *dbcursoropen(
DBPROCESS * dbprocess, BYTE * stmt, SHORT scollopt, SHORT concuropt, USHORT nrows, DBINT * pstatus);
612 RETCODE dbdatechar(
DBPROCESS * dbprocess,
char *buf,
int datepart,
int value);
614 char *dateorder(
DBPROCESS * dbprocess,
char *language);
617 char *dbdayname(
DBPROCESS * dbprocess,
char *language,
int daynum);
619 int dbgetoff(
DBPROCESS * dbprocess, DBUSMALLINT offtype,
int startfrom);
621 char *dbqual(
DBPROCESS * dbprocess,
int tabnum,
char *tabname);
622 void dbfreequal(
char *qualptr);
624 DBSORTORDER *dbloadsort(
DBPROCESS * dbprocess);
625 RETCODE dbfreesort(
DBPROCESS * dbprocess, DBSORTORDER * sortorder);
627 RETCODE dbload_xlate(
DBPROCESS * dbprocess,
char *srv_charset,
char *clt_name, DBXLATE ** xlt_tosrv, DBXLATE ** xlt_todisp);
633 RETCODE dbmnydown(
DBPROCESS * dbproc,
DBMONEY * mnyptr,
int divisor,
int *remainder);
634 RETCODE dbmnyinit(
DBPROCESS * dbproc,
DBMONEY * mnyptr,
int trim, DBBOOL * negative);
635 RETCODE dbmnyndigit(
DBPROCESS * dbproc,
DBMONEY * mnyptr, DBCHAR * value, DBBOOL * zero);
637 RETCODE dbmnydigit(
DBPROCESS * dbprocess,
DBMONEY * m1, DBCHAR * value, DBBOOL * zero);
638 RETCODE dbmnyscale(
DBPROCESS * dbproc,
DBMONEY * dest,
int multiplier,
int addend);
641 RETCODE dbnpcreate(
DBPROCESS * dbprocess);
642 RETCODE dbnpdefine(
DBPROCESS * dbprocess, DBCHAR * procedure_name, DBSMALLINT namelen);
646 RETCODE dbpoll(
DBPROCESS * dbproc,
long milliseconds,
DBPROCESS ** ready_dbproc,
int *return_reason);
647 int dbordercol(
DBPROCESS * dbprocess,
int order);
649 RETCODE dbregdrop(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
650 RETCODE dbregexec(
DBPROCESS * dbproc, DBUSMALLINT options);
651 RETCODE dbreghandle(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, INTFUNCPTR handler);
652 RETCODE dbreginit(
DBPROCESS * dbproc, DBCHAR * procedure_name, DBSMALLINT namelen);
654 RETCODE dbregnowatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
655 RETCODE dbregparam(
DBPROCESS * dbproc,
char *param_name,
int type, DBINT datalen, BYTE * data);
656 RETCODE dbregwatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, DBUSMALLINT options);
657 RETCODE dbregwatchlist(
DBPROCESS * dbprocess);
660 RETCODE dbrpwset(
LOGINREC * login,
char *srvname,
char *password,
int pwlen);
662 DBINT dbreadpage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, BYTE * buf);
663 RETCODE dbwritepage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, DBINT size, BYTE * buf);
665 RETCODE dbsetdeflang(
char *language);
667 int dbstrcmp(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
668 int dbstrsort(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
670 DBBOOL dbtabbrowse(
DBPROCESS * dbprocess,
int tabnum);
672 char *dbtabname(
DBPROCESS * dbprocess,
int tabnum);
673 char *dbtabsource(
DBPROCESS * dbprocess,
int colnum,
int *tabnum);
675 RETCODE dbsendpassthru(
DBPROCESS * dbprocess, DBVOIDPTR bufp);
676 RETCODE dbrecvpassthru(
DBPROCESS * dbprocess, DBVOIDPTR * bufp);
678 RETCODE dbgetloginfo(
DBPROCESS * dbprocess, DBLOGINFO ** loginfo);
679 RETCODE dbsetloginfo(
LOGINREC * loginrec, DBLOGINFO * loginfo);
682 DBBINARY *dbtsnewval(
DBPROCESS * dbprocess);
683 RETCODE dbtsput(
DBPROCESS * dbprocess, DBBINARY * newts,
int newtslen,
int tabnum,
char *tabname);
685 RETCODE dbfree_xlate(
DBPROCESS * dbprocess, DBXLATE * xlt_tosrv, DBXLATE * clt_todisp);
686 int dbxlate(
DBPROCESS * dbprocess,
char *src,
int srclen,
char *dest,
int destlen, DBXLATE * xlt,
int *srcbytes_used,
687 DBBOOL srcend,
int status);
689 RETCODE bcp_moretext(
DBPROCESS * dbproc, DBINT size, BYTE * text);
690 RETCODE bcp_writefmt(
DBPROCESS * dbproc,
const char filename[]);
692 void build_xact_string(
char *xact_name,
char *service_name, DBINT commid,
char *result);
693 RETCODE remove_xact(
DBPROCESS * connect, DBINT commid,
int n);
694 RETCODE abort_xact(
DBPROCESS * connect, DBINT commid);
696 RETCODE commit_xact(
DBPROCESS * connect, DBINT commid);
698 RETCODE scan_xact(
DBPROCESS * connect, DBINT commid);
699 DBINT start_xact(
DBPROCESS * connect,
char *application_name,
char *xact_name,
int site_count);
700 DBINT stat_xact(
DBPROCESS * connect, DBINT commid);
706 RETCODE
dbaltbind(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
707 RETCODE dbaltbind_ps(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
715 RETCODE
dbbind(
DBPROCESS * dbproc,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
716 RETCODE dbbind_ps(
DBPROCESS * dbprocess,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
DBTYPEINFO * typeinfo);
722 DBBOOL dbcharsetconv(
DBPROCESS * dbprocess);
729 #define DBCMDROW(x) dbcmdrow((x))
739 DBINT
dbconvert(
DBPROCESS * dbproc,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen);
740 DBINT
dbconvert_ps(
DBPROCESS * dbprocess,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen,
745 #define DBCOUNT(x) dbcount((x))
748 #define DBCURCMD(x) dbcurcmd((x))
751 #define DBCURROW(x) dbcurrow((x))
759 #define DBDEAD(x) dbdead((x))
765 #define DBFIRSTROW(x) dbfirstrow((x))
768 char *dbgetcharset(
DBPROCESS * dbprocess);
769 int dbgetlusername(
LOGINREC * login, BYTE * name_buffer,
int buffer_len);
771 char *dbgetnatlanf(
DBPROCESS * dbprocess);
775 #define DBGETTIME dbgettime
781 #define DBIORDESC(x) dbiordesc((x))
784 #define DBIOWDESC(x) dbiowdesc((x))
787 #define DBISAVAIL(x) dbisavail((x))
791 #define DBLASTROW(x) dblastrow((x))
817 #define DBMORECMDS(x) dbmorecmds((x))
832 void dbpivot_count (
struct col_t *output,
const struct col_t *input);
833 void dbpivot_sum (
struct col_t *output,
const struct col_t *input);
834 void dbpivot_min (
struct col_t *output,
const struct col_t *input);
835 void dbpivot_max (
struct col_t *output,
const struct col_t *input);
838 typedef void (*DBPIVOT_FUNC)(
struct col_t *output,
const struct col_t *input);
841 RETCODE
dbpivot(
DBPROCESS *dbproc,
int nkeys,
int *keys,
int ncols,
int *cols, DBPIVOT_FUNC func,
int val);
843 DBPIVOT_FUNC dbpivot_lookup_name(
const char name[] );
846 #define dbopen(x,y) tdsdbopen((x),(y), 1)
848 #define dbopen(x,y) tdsdbopen((x),(y), 0)
852 #ifdef PHP_SYBASE_DBOPEN
853 #undef PHP_SYBASE_DBOPEN
854 #define PHP_SYBASE_DBOPEN dbopen
865 RETCODE dbresults_r(
DBPROCESS * dbproc,
int recursive);
873 #define DBROWS(x) dbrows((x))
876 #define DBROWTYPE(x) dbrowtype((x))
878 RETCODE
dbrpcparam(
DBPROCESS * dbproc,
const char paramname[], BYTE status,
int type, DBINT maxlen, DBINT datalen, BYTE * value);
880 RETCODE
dbsafestr(
DBPROCESS * dbproc,
const char *src, DBINT srclen,
char *dest, DBINT destlen,
int quotetype);
881 RETCODE *dbsechandle(DBINT type, INTFUNCPTR handler);
884 void dbsetbusy(
DBPROCESS * dbprocess, DB_DBBUSY_FUNC busyfunc);
885 RETCODE dbsetdefcharset(
char *charset);
886 void dbsetidle(
DBPROCESS * dbprocess, DB_DBIDLE_FUNC idlefunc);
892 RETCODE
dbsetopt(
DBPROCESS * dbproc,
int option,
const char *char_param,
int int_param);
906 int dbstrbuild(
DBPROCESS * dbproc,
char *charbuf,
int bufsize,
char *text,
char *formats, ...);
911 #define SYBEVERDOWN 100
912 #define SYBEICONVIU 2400
913 #define SYBEICONVAVAIL 2401
914 #define SYBEICONVO 2402
915 #define SYBEICONVI 2403
916 #define SYBEICONV2BIG 2404
919 #define SYBETDSVER 2410
920 #define SYBEPORT 2500
921 #define SYBESYNC 20001
922 #define SYBEFCON 20002
923 #define SYBETIME 20003
924 #define SYBEREAD 20004
925 #define SYBEBUFL 20005
926 #define SYBEWRIT 20006
927 #define SYBEVMS 20007
928 #define SYBESOCK 20008
929 #define SYBECONN 20009
930 #define SYBEMEM 20010
931 #define SYBEDBPS 20011
932 #define SYBEINTF 20012
933 #define SYBEUHST 20013
934 #define SYBEPWD 20014
935 #define SYBEOPIN 20015
936 #define SYBEINLN 20016
937 #define SYBESEOF 20017
938 #define SYBESMSG 20018
939 #define SYBERPND 20019
940 #define SYBEBTOK 20020
941 #define SYBEITIM 20021
942 #define SYBEOOB 20022
943 #define SYBEBTYP 20023
944 #define SYBEBNCR 20024
945 #define SYBEIICL 20025
946 #define SYBECNOR 20026
947 #define SYBENPRM 20027
948 #define SYBEUVDT 20028
949 #define SYBEUFDT 20029
950 #define SYBEWAID 20030
951 #define SYBECDNS 20031
952 #define SYBEABNC 20032
953 #define SYBEABMT 20033
954 #define SYBEABNP 20034
955 #define SYBEAAMT 20035
956 #define SYBENXID 20036
957 #define SYBERXID 20037
958 #define SYBEICN 20038
959 #define SYBENMOB 20039
960 #define SYBEAPUT 20040
961 #define SYBEASNL 20041
962 #define SYBENTLL 20042
963 #define SYBEASUL 20043
964 #define SYBERDNR 20044
965 #define SYBENSIP 20045
966 #define SYBEABNV 20046
967 #define SYBEDDNE 20047
968 #define SYBECUFL 20048
969 #define SYBECOFL 20049
970 #define SYBECSYN 20050
971 #define SYBECLPR 20051
972 #define SYBECNOV 20052
973 #define SYBERDCN 20053
974 #define SYBESFOV 20054
975 #define SYBEUNT 20055
976 #define SYBECLOS 20056
977 #define SYBEUAVE 20057
978 #define SYBEUSCT 20058
979 #define SYBEEQVA 20059
980 #define SYBEUDTY 20060
981 #define SYBETSIT 20061
982 #define SYBEAUTN 20062
983 #define SYBEBDIO 20063
984 #define SYBEBCNT 20064
985 #define SYBEIFNB 20065
986 #define SYBETTS 20066
987 #define SYBEKBCO 20067
988 #define SYBEBBCI 20068
989 #define SYBEKBCI 20069
990 #define SYBEBCRE 20070
991 #define SYBETPTN 20071
992 #define SYBEBCWE 20072
993 #define SYBEBCNN 20073
994 #define SYBEBCOR 20074
995 #define SYBEBCIS 20075
996 #define SYBEBCPI 20076
997 #define SYBEBCPN 20077
998 #define SYBEBCPB 20078
999 #define SYBEVDPT 20079
1000 #define SYBEBIVI 20080
1001 #define SYBEBCBC 20081
1002 #define SYBEBCFO 20082
1003 #define SYBEBCVH 20083
1004 #define SYBEBCUO 20084
1005 #define SYBEBCUC 20085
1006 #define SYBEBUOE 20086
1007 #define SYBEBUCE 20087
1008 #define SYBEBWEF 20088
1009 #define SYBEASTF 20089
1010 #define SYBEUACS 20090
1011 #define SYBEASEC 20091
1012 #define SYBETMTD 20092
1013 #define SYBENTTN 20093
1014 #define SYBEDNTI 20094
1015 #define SYBEBTMT 20095
1016 #define SYBEORPF 20096
1017 #define SYBEUVBF 20097
1018 #define SYBEBUOF 20098
1019 #define SYBEBUCF 20099
1020 #define SYBEBRFF 20100
1021 #define SYBEBWFF 20101
1022 #define SYBEBUDF 20102
1023 #define SYBEBIHC 20103
1024 #define SYBEBEOF 20104
1025 #define SYBEBCNL 20105
1026 #define SYBEBCSI 20106
1027 #define SYBEBCIT 20107
1028 #define SYBEBCSA 20108
1029 #define SYBENULL 20109
1030 #define SYBEUNAM 20110
1031 #define SYBEBCRO 20111
1032 #define SYBEMPLL 20112
1033 #define SYBERPIL 20113
1034 #define SYBERPUL 20114
1035 #define SYBEUNOP 20115
1036 #define SYBECRNC 20116
1037 #define SYBERTCC 20117
1038 #define SYBERTSC 20118
1039 #define SYBEUCRR 20119
1040 #define SYBERPNA 20120
1041 #define SYBEOPNA 20121
1042 #define SYBEFGTL 20122
1043 #define SYBECWLL 20123
1044 #define SYBEUFDS 20124
1045 #define SYBEUCPT 20125
1046 #define SYBETMCF 20126
1047 #define SYBEAICF 20127
1048 #define SYBEADST 20128
1049 #define SYBEALTT 20129
1050 #define SYBEAPCT 20130
1051 #define SYBEXOCI 20131
1052 #define SYBEFSHD 20132
1053 #define SYBEAOLF 20133
1054 #define SYBEARDI 20134
1055 #define SYBEURCI 20135
1056 #define SYBEARDL 20136
1057 #define SYBEURMI 20137
1058 #define SYBEUREM 20138
1059 #define SYBEURES 20139
1060 #define SYBEUREI 20140
1061 #define SYBEOREN 20141
1062 #define SYBEISOI 20142
1063 #define SYBEIDCL 20143
1064 #define SYBEIMCL 20144
1065 #define SYBEIFCL 20145
1066 #define SYBEUTDS 20146
1067 #define SYBEBUFF 20147
1068 #define SYBEACNV 20148
1069 #define SYBEDPOR 20149
1070 #define SYBENDC 20150
1071 #define SYBEMVOR 20151
1072 #define SYBEDVOR 20152
1073 #define SYBENBVP 20153
1074 #define SYBESPID 20154
1075 #define SYBENDTP 20155
1076 #define SYBEXTN 20156
1077 #define SYBEXTDN 20157
1078 #define SYBEXTSN 20158
1079 #define SYBENUM 20159
1080 #define SYBETYPE 20160
1081 #define SYBEGENOS 20161
1082 #define SYBEPAGE 20162
1083 #define SYBEOPTNO 20163
1084 #define SYBEETD 20164
1085 #define SYBERTYPE 20165
1086 #define SYBERFILE 20166
1087 #define SYBEFMODE 20167
1088 #define SYBESLCT 20168
1089 #define SYBEZTXT 20169
1090 #define SYBENTST 20170
1091 #define SYBEOSSL 20171
1092 #define SYBEESSL 20172
1093 #define SYBENLNL 20173
1094 #define SYBENHAN 20174
1095 #define SYBENBUF 20175
1096 #define SYBENULP 20176
1097 #define SYBENOTI 20177
1098 #define SYBEEVOP 20178
1099 #define SYBENEHA 20179
1100 #define SYBETRAN 20180
1101 #define SYBEEVST 20181
1102 #define SYBEEINI 20182
1103 #define SYBEECRT 20183
1104 #define SYBEECAN 20184
1105 #define SYBEEUNR 20185
1106 #define SYBERPCS 20186
1107 #define SYBETPAR 20187
1108 #define SYBETEXS 20188
1109 #define SYBETRAC 20189
1110 #define SYBETRAS 20190
1111 #define SYBEPRTF 20191
1112 #define SYBETRSN 20192
1113 #define SYBEBPKS 20193
1114 #define SYBEIPV 20194
1115 #define SYBEMOV 20195
1116 #define SYBEDIVZ 20196
1117 #define SYBEASTL 20197
1118 #define SYBESEFA 20198
1119 #define SYBEPOLL 20199
1120 #define SYBENOEV 20200
1121 #define SYBEBADPK 20201
1122 #define SYBESECURE 20202
1123 #define SYBECAP 20203
1124 #define SYBEFUNC 20204
1125 #define SYBERESP 20205
1126 #define SYBEIVERS 20206
1127 #define SYBEONCE 20207
1128 #define SYBERPNULL 20208
1129 #define SYBERPTXTIM 20209
1130 #define SYBENEG 20210
1131 #define SYBELBLEN 20211
1132 #define SYBEUMSG 20212
1133 #define SYBECAPTYP 20213
1134 #define SYBEBNUM 20214
1135 #define SYBEBBL 20215
1136 #define SYBEBPREC 20216
1137 #define SYBEBSCALE 20217
1138 #define SYBECDOMAIN 20218
1139 #define SYBECINTERNAL 20219
1140 #define SYBEBTYPSRV 20220
1141 #define SYBEBCSET 20221
1142 #define SYBEFENC 20222
1143 #define SYBEFRES 20223
1144 #define SYBEISRVPREC 20224
1145 #define SYBEISRVSCL 20225
1146 #define SYBEINUMCL 20226
1147 #define SYBEIDECCL 20227
1148 #define SYBEBCMTXT 20228
1149 #define SYBEBCPREC 20229
1150 #define SYBEBCBNPR 20230
1151 #define SYBEBCBNTYP 20231
1152 #define SYBEBCSNTYP 20232
1153 #define SYBEBCPCTYP 20233
1154 #define SYBEBCVLEN 20234
1155 #define SYBEBCHLEN 20235
1156 #define SYBEBCBPREF 20236
1157 #define SYBEBCPREF 20237
1158 #define SYBEBCITBNM 20238
1159 #define SYBEBCITBLEN 20239
1160 #define SYBEBCSNDROW 20240
1161 #define SYBEBPROCOL 20241
1162 #define SYBEBPRODEF 20242
1163 #define SYBEBPRONUMDEF 20243
1164 #define SYBEBPRODEFID 20244
1165 #define SYBEBPRONODEF 20245
1166 #define SYBEBPRODEFTYP 20246
1167 #define SYBEBPROEXTDEF 20247
1168 #define SYBEBPROEXTRES 20248
1169 #define SYBEBPROBADDEF 20249
1170 #define SYBEBPROBADTYP 20250
1171 #define SYBEBPROBADLEN 20251
1172 #define SYBEBPROBADPREC 20252
1173 #define SYBEBPROBADSCL 20253
1174 #define SYBEBADTYPE 20254
1175 #define SYBECRSNORES 20255
1176 #define SYBECRSNOIND 20256
1177 #define SYBECRSVIEW 20257
1178 #define SYBECRSVIIND 20258
1179 #define SYBECRSORD 20259
1180 #define SYBECRSBUFR 20260
1181 #define SYBECRSNOFREE 20261
1182 #define SYBECRSDIS 20262
1183 #define SYBECRSAGR 20263
1184 #define SYBECRSFRAND 20264
1185 #define SYBECRSFLAST 20265
1186 #define SYBECRSBROL 20266
1187 #define SYBECRSFROWN 20267
1188 #define SYBECRSBSKEY 20268
1189 #define SYBECRSRO 20269
1190 #define SYBECRSNOCOUNT 20270
1191 #define SYBECRSTAB 20271
1192 #define SYBECRSUPDNB 20272
1193 #define SYBECRSNOWHERE 20273
1194 #define SYBECRSSET 20274
1195 #define SYBECRSUPDTAB 20275
1196 #define SYBECRSNOUPD 20276
1197 #define SYBECRSINV 20277
1198 #define SYBECRSNOKEYS 20278
1199 #define SYBECRSNOBIND 20279
1200 #define SYBECRSFTYPE 20280
1201 #define SYBECRSINVALID 20281
1202 #define SYBECRSMROWS 20282
1203 #define SYBECRSNROWS 20283
1204 #define SYBECRSNOLEN 20284
1205 #define SYBECRSNOPTCC 20285
1206 #define SYBECRSNORDER 20286
1207 #define SYBECRSNOTABLE 20287
1208 #define SYBECRSNUNIQUE 20288
1209 #define SYBECRSVAR 20289
1210 #define SYBENOVALUE 20290
1211 #define SYBEVOIDRET 20291
1212 #define SYBECLOSEIN 20292
1213 #define SYBEBOOL 20293
1214 #define SYBEBCPOPT 20294
1215 #define SYBEERRLABEL 20295
1216 #define SYBEATTNACK 20296
1217 #define SYBEBBFL 20297
1218 #define SYBEDCL 20298
1219 #define SYBECS 20299
1220 #define SYBEBULKINSERT 20599
1221 #define SYBECOLSIZE 22000
1225 #define DBTDS(a) dbtds(a)
1226 DBINT dbtextsize(
DBPROCESS * dbprocess);
1229 DBBINARY *dbtxtsnewval(
DBPROCESS * dbprocess);
1230 RETCODE dbtxtsput(
DBPROCESS * dbprocess, DBBINARY newtxts,
int colnum);
1234 RETCODE
dbwritetext(
DBPROCESS * dbproc,
char *objname, DBBINARY * textptr, DBTINYINT textptrlen, DBBINARY * timestamp,
1235 DBBOOL log, DBINT size, BYTE * text);
1240 RETCODE dbsetlshort(
LOGINREC * login,
int value,
int which);
1245 #define DBSETLHOST(x,y) dbsetlname((x), (y), DBSETHOST)
1246 #define dbsetlhost(x,y) dbsetlname((x), (y), DBSETHOST)
1248 #define DBSETLUSER(x,y) dbsetlname((x), (y), DBSETUSER)
1249 #define dbsetluser(x,y) dbsetlname((x), (y), DBSETUSER)
1251 #define DBSETLPWD(x,y) dbsetlname((x), (y), DBSETPWD)
1252 #define dbsetlpwd(x,y) dbsetlname((x), (y), DBSETPWD)
1253 #if defined(DBLIB_UNIMPLEMENTED)
1255 # define DBSETLHID(x,y) dbsetlname((x), (y), DBSETHID)
1258 #define DBSETLAPP(x,y) dbsetlname((x), (y), DBSETAPP)
1259 #define dbsetlapp(x,y) dbsetlname((x), (y), DBSETAPP)
1261 #define BCP_SETL(x,y) dbsetlbool((x), (y), DBSETBCP)
1262 #define DBSETLSECURE(x) dbsetlbool((x), (1), DBSETBCP)
1263 #define DBSETNATLANG 7
1264 #define DBSETLNATLANG(x,y) dbsetlname((x), (y), DBSETNATLANG)
1265 #define dbsetlnatlang(x,y) dbsetlname((x), (y), DBSETNATLANG)
1266 #if defined(DBLIB_UNIMPLEMENTED)
1267 # define DBSETNOSHORT 8
1268 # define DBSETLNOSHORT(x,y) dbsetlbool((x), (y), DBSETNOSHORT)
1269 # define DBSETHIER 9
1270 # define DBSETLHIER(x,y) dbsetlshort((x), (y), DBSETHIER)
1272 #define DBSETCHARSET 10
1273 #define DBSETLCHARSET(x,y) dbsetlname((x), (y), DBSETCHARSET)
1274 #define DBSETPACKET 11
1275 #define DBSETLPACKET(x,y) dbsetllong((x), (y), DBSETPACKET)
1276 #define dbsetlpacket(x,y) dbsetllong((x), (y), DBSETPACKET)
1277 #define DBSETENCRYPT 12
1278 #define DBSETLENCRYPT(x,y) dbsetlbool((x), (y), DBSETENCRYPT)
1279 #define DBSETLABELED 13
1280 #define DBSETLLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1281 #define BCP_SETLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1282 #define DBSETDBNAME 14
1283 #define DBSETLDBNAME(x,y) dbsetlname((x), (y), DBSETDBNAME)
1284 #define DBSETLVERSION(login, version) dbsetlversion((login), (version))
1286 #define DBSETUTF16 1001
1287 #define DBSETLUTF16(x,y) dbsetlbool((x), (y), DBSETUTF16)
1288 #define DBSETNTLMV2 1002
1289 #define DBSETLNTLMV2(x,y) dbsetlbool((x), (y), DBSETNTLMV2)
1291 RETCODE
bcp_init(
DBPROCESS * dbproc,
const char *tblname,
const char *hfile,
const char *errfile,
int direction);
1295 RETCODE
bcp_bind(
DBPROCESS * dbproc, BYTE * varaddr,
int prefixlen, DBINT varlen, BYTE * terminator,
int termlen,
int type,
1299 RETCODE
bcp_colfmt(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1300 const BYTE * host_term,
int host_termlen,
int colnum);
1301 RETCODE
bcp_colfmt_ps(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1302 BYTE * host_term,
int host_termlen,
int colnum,
DBTYPEINFO * typeinfo);
1305 int bcp_getbatchsize(
DBPROCESS * dbproc);
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition: dblib.c:1402
DBINT dbretstatus(DBPROCESS *dbproc)
Fetch status value returned by query or remote procedure call.
Definition: dblib.c:4578
BOOL dbiscount(DBPROCESS *dbproc)
Indicates whether or not the count returned by dbcount is real (Microsoft-compatibility feature)...
Definition: dblib.c:2794
RETCODE bcp_colptr(DBPROCESS *dbproc, BYTE *colptr, int table_column)
Override bcp_bind() by pointing to a different host variable.
Definition: bcp.c:661
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:7209
DBINT dbdatlen(DBPROCESS *dbproc, int column)
Get size of current row's data in a regular result column.
Definition: dblib.c:3245
DBPROCESS * tdsdbopen(LOGINREC *login, const char *server, int msdblib)
Form a connection with the server.
Definition: dblib.c:1168
int dbcurcmd(DBPROCESS *dbproc)
Get number of the row just returned.
Definition: dblib.c:6127
DBBOOL bcp_getl(LOGINREC *login)
See if BCP_SETL() was used to set the LOGINREC for BCP work.
Definition: bcp.c:697
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:4535
DBINT dbcollen(DBPROCESS *dbproc, int column)
Get size of a regular result column.
Definition: dblib.c:3090
int dbnumrets(DBPROCESS *dbproc)
Get count of output parameters filled by a stored procedure.
Definition: dblib.c:4596
RETCODE bcp_collen(DBPROCESS *dbproc, DBINT varlen, int table_column)
Set the length of a host variable to be written to a table.
Definition: bcp.c:261
DBTYPEINFO * dbcoltypeinfo(DBPROCESS *dbproc, int column)
Get precision and scale information for a regular result column.
Definition: dblib.c:2939
void dbloginfree(LOGINREC *login)
free the LOGINREC
Definition: dblib.c:747
RETCODE dbinit(void)
Initialize db-lib.
Definition: dblib.c:670
const char * dbversion(void)
See which version of db-lib is in use.
Definition: dblib.c:6749
int dbrettype(DBPROCESS *dbproc, int retnum)
Get datatype of a stored procedure's return parameter.
Definition: dblib.c:6175
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
Definition: dblib.c:1356
DBINT dbcurrow(DBPROCESS *dbproc)
Get number of the row currently being read.
Definition: dblib.c:6093
char * dbcolname(DBPROCESS *dbproc, int column)
Return name of a regular result column.
Definition: dblib.c:1861
DBPROCESS * dbopen(LOGINREC *login, const char *server)
Normally not used.
Definition: dbopen.c:36
void dbfreebuf(DBPROCESS *dbproc)
Erase the command buffer, in case DBNOAUTOFREE was set with dbsetopt().
Definition: dblib.c:5967
int dbnumalts(DBPROCESS *dbproc, int computeid)
Get count of columns in a compute row.
Definition: dblib.c:4848
RETCODE dbsetopt(DBPROCESS *dbproc, int option, const char *char_param, int int_param)
Set db-lib or server option.
Definition: dblib.c:4379
DBBINARY * dbtxptr(DBPROCESS *dbproc, int column)
Get text pointer for a column in the current row.
Definition: dblib.c:6466
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:2968
RETCODE dbmoretext(DBPROCESS *dbproc, DBINT size, const BYTE text[])
Send chunk of a text/image value to the server.
Definition: dblib.c:6641
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:2026
const char * dbmonthname(DBPROCESS *dbproc, char *language, int monthnum, DBBOOL shortform)
Get name of a month, in some human language.
Definition: dblib.c:6867
void dbprhead(DBPROCESS *dbproc)
Print result set headings to stdout.
Definition: dblib.c:3869
RETCODE dbsqlsend(DBPROCESS *dbproc)
Transmit the command buffer to the server.
Definition: dblib.c:6952
RETCODE bcp_options(DBPROCESS *dbproc, int option, BYTE *value, int valuelen)
Set "hints" for uploading a file.
Definition: bcp.c:613
int dbdatecmp(DBPROCESS *dbproc, DBDATETIME *d1, DBDATETIME *d2)
Compare DBDATETIME values, similar to strcmp(3).
Definition: dblib.c:5673
RETCODE dbsqlok(DBPROCESS *dbproc)
Wait for results of a query from the server.
Definition: dblib.c:4721
int dbnumcompute(DBPROCESS *dbprocess)
Get count of COMPUTE clauses for a result set.
Definition: dblib.c:4881
BYTE * dbretdata(DBPROCESS *dbproc, int retnum)
Get value of an output parameter filled by a stored procedure.
Definition: dblib.c:4657
RETCODE dbanydatecrack(DBPROCESS *dbproc, DBDATEREC2 *di, int type, const void *data)
Break any kind of date or time value into useful pieces.
Definition: dblib.c:5776
void dbsetavail(DBPROCESS *dbprocess)
Mark a DBPROCESS as "available".
Definition: dblib.c:7184
RETCODE dbcmdrow(DBPROCESS *dbproc)
See if the current command can return rows.
Definition: dblib.c:4168
DBINT dbconvert(DBPROCESS *dbproc, int srctype, const BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen)
cf.
Definition: dblib.c:2583
RETCODE dbsetlversion(LOGINREC *login, BYTE version)
Set TDS version for future connections.
Definition: dblib.c:939
RETCODE dbspr1row(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print a regular result row to a buffer.
Definition: dblib.c:3369
RETCODE dbmny4copy(DBPROCESS *dbprocess, DBMONEY4 *m1, DBMONEY4 *m2)
Copy a DBMONEY4 value.
Definition: dblib.c:5648
RETCODE dbfcmd(DBPROCESS *dbproc, const char *fmt,...)
printf-like way to form SQL to send to the server.
Definition: dblib.c:1317
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition: bcp.c:539
DBINT bcp_done(DBPROCESS *dbproc)
Conclude the transfer of data from program variables.
Definition: bcp.c:1984
int dbalttype(DBPROCESS *dbproc, int computeid, int column)
Get datatype for a compute column.
Definition: dblib.c:4248
Definition: dbpivot.c:765
BYTE * dbbylist(DBPROCESS *dbproc, int computeid, int *size)
Get bylist for a compute row.
Definition: dblib.c:4907
RETCODE dbmny4sub(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *diff)
Subtract two DBMONEY4 values.
Definition: dblib.c:5532
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:6374
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:4277
DBINT dbadlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in a compute column.
Definition: dblib.c:4218
RETCODE dbcanquery(DBPROCESS *dbproc)
Cancel the query currently being retrieved, discarding all pending rows.
Definition: dblib.c:5938
BYTE * dbadata(DBPROCESS *dbproc, int computeid, int column)
Get address of compute column data.
Definition: dblib.c:4323
RETCODE dbgetrow(DBPROCESS *dbproc, DBINT row)
Read a row from the row buffer.
Definition: dblib.c:1919
RETCODE dbprrow(DBPROCESS *dbproc)
Print a result set to stdout.
Definition: dblib.c:3452
RETCODE dbmnydec(DBPROCESS *dbproc, DBMONEY *mnyptr)
Subtract $0.0001 from a DBMONEY value.
Definition: dblib.c:5399
DBINT date
date, 0 = 1900-01-01
Definition: sybdb.h:309
RETCODE dbmnymaxpos(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum positive DBMONEY value supported.
Definition: dblib.c:5253
int dbnumcols(DBPROCESS *dbproc)
Return number of regular columns in a result set.
Definition: dblib.c:1837
RETCODE bcp_init(DBPROCESS *dbproc, const char *tblname, const char *hfile, const char *errfile, int direction)
Prepare for bulk copy operation on a table.
Definition: bcp.c:164
RETCODE dbsafestr(DBPROCESS *dbproc, const char *src, DBINT srclen, char *dest, DBINT destlen, int quotetype)
safely quotes character values in SQL text.
Definition: dblib.c:6296
DBBOOL dbwillconvert(int srctype, int desttype)
Test whether or not a datatype can be converted to another datatype.
Definition: dblib.c:2864
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Definition: dblib.c:6916
RETCODE bcp_exec(DBPROCESS *dbproc, DBINT *rows_copied)
Write a datafile to a table.
Definition: bcp.c:1564
STATUS dbsetrow(DBPROCESS *dbprocess, DBINT row)
Make a buffered row "current" without fetching it into bound variables.
Definition: dblib.c:2034
RETCODE dbuse(DBPROCESS *dbproc, const char *name)
Change current database.
Definition: dblib.c:1428
RETCODE dbsprhead(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print result set headings to a buffer.
Definition: dblib.c:3806
RETCODE dbsetlbool(LOGINREC *login, int value, int which)
Set a boolean value in a LOGINREC structure.
Definition: dblib.c:903
int dbmny4cmp(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2)
Compare two DBMONEY4 values.
Definition: dblib.c:5620
RETCODE dbmorecmds(DBPROCESS *dbproc)
See if more commands are to be processed.
Definition: dblib.c:6144
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
const char * dbacolname(DBPROCESS *dbproc, int computeid, int column)
Return name of a computed result column.
Definition: dblib.c:1887
RETCODE dbsetnull(DBPROCESS *dbprocess, int bindtype, int bindlen, BYTE *bindval)
Define substitution values to be used when binding null values.
Definition: dblib.c:1951
RETCODE dbsetversion(DBINT version)
Specify a db-lib version level.
Definition: dblib.c:5884
DBINT dbaltlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in compute column.
Definition: dblib.c:7046
RETCODE dbcancel(DBPROCESS *dbproc)
Cancel the current command batch.
Definition: dblib.c:3306
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition: dblib.c:5029
STATUS dbreadtext(DBPROCESS *dbproc, void *buf, DBINT bufsize)
Fetch part of a text or image value from the server.
Definition: dblib.c:6572
RETCODE dbstrcpy(DBPROCESS *dbproc, int start, int numbytes, char *dest)
Get a copy of a chunk of the command buffer.
Definition: dblib.c:6252
int dbgettime(void)
Get maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4131
DBBOOL dbhasretstat(DBPROCESS *dbproc)
Determine if query generated a return status number.
Definition: dblib.c:4554
RETCODE dbmny4add(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *sum)
Add two DBMONEY4 values.
Definition: dblib.c:5501
DBBINARY * dbtxtimestamp(DBPROCESS *dbproc, int column)
Get text timestamp for a column in the current row.
Definition: dblib.c:6436
int dbmnycmp(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2)
Compare two DBMONEY values.
Definition: dblib.c:5174
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:372
void dbexit(void)
Close server connections and free all related structures.
Definition: dblib.c:1538
char * dbgetchar(DBPROCESS *dbprocess, int n)
Get address of a position in the command buffer.
Definition: dblib.c:6219
RETCODE dbsettime(int seconds)
Set maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4104
RETCODE dbsetllong(LOGINREC *login, long value, int which)
Set an integer value in a LOGINREC structure.
Definition: dblib.c:832
DBSMALLINT offset
time offset
Definition: sybdb.h:310
Definition: bsqlodbc.c:97
RETCODE dbmnycopy(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Copy a DBMONEY value.
Definition: dblib.c:5917
RETCODE dbmnyzero(DBPROCESS *dbproc, DBMONEY *dest)
Set a DBMONEY value to zero.
Definition: dblib.c:5232
int dbtds(DBPROCESS *dbprocess)
Get the TDS version in use for dbproc.
Definition: dblib.c:6710
RETCODE dbrows(DBPROCESS *dbproc)
Indicate whether a query returned rows.
Definition: dblib.c:3944
int dbiowdesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to write data coming to the server...
Definition: dblib.c:7156
int dbiordesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to read data coming from the server...
Definition: dblib.c:7140
RETCODE dbrpcinit(DBPROCESS *dbproc, const char rpcname[], DBSMALLINT options)
Initialize a remote procedure call.
Definition: rpc.c:72
DBUBIGINT time
time, 7 digit precision
Definition: sybdb.h:308
char * dbcolsource(DBPROCESS *dbproc, int colnum)
Get base database column name for a result set column.
Definition: dblib.c:3065
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:2290
RETCODE dbbind(DBPROCESS *dbproc, int column, int vartype, DBINT varlen, BYTE *varaddr)
Tie a host variable to a resultset column.
Definition: dblib.c:2624
int dbspid(DBPROCESS *dbproc)
Get server process ID for a DBPROCESS.
Definition: dblib.c:5828
int dbstrlen(DBPROCESS *dbproc)
Get size of the command buffer, in bytes.
Definition: dblib.c:6200
RETCODE dbsetmaxprocs(int maxprocs)
Set maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:4009
int dbgetpacket(DBPROCESS *dbproc)
Get TDS packet size for the connection.
Definition: dblib.c:3985
char * dbchange(DBPROCESS *dbprocess)
See if a command caused the current database to change.
Definition: dblib.c:6896
DBINT bcp_batch(DBPROCESS *dbproc)
Commit a set of rows to the table.
Definition: bcp.c:1957
RETCODE dbsetlogintime(int seconds)
Set maximum seconds db-lib waits for a server response to a login attempt.
Definition: dblib.c:4147
DBINT dblastrow(DBPROCESS *dbproc)
Get number of the last row in the row buffer.
Definition: dblib.c:7116
int dbretlen(DBPROCESS *dbproc, int retnum)
Get size of an output parameter filled by a stored procedure.
Definition: dblib.c:4686
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition: dblib.c:2893
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:908
void dbclose(DBPROCESS *dbproc)
Close a connection to the server and free associated resources.
Definition: dblib.c:1471
RETCODE bcp_sendrow(DBPROCESS *dbproc)
Write data in host variables to the table.
Definition: bcp.c:1337
void dbsetifile(char *filename)
set name and location of the interfaces file FreeTDS should use to look up a servername.
Definition: dblib.c:2701
void dbsetuserdata(DBPROCESS *dbproc, BYTE *ptr)
Associate client-allocated (and defined) data with a DBPROCESS.
Definition: dblib.c:5848
DBINT dbspr1rowlen(DBPROCESS *dbproc)
Determine size buffer required to hold the results returned by dbsprhead(), dbsprline(), and dbspr1row().
Definition: dblib.c:3331
DBINT dbaltutype(DBPROCESS *dbproc, int computeid, int column)
Get user-defined datatype of a compute column.
Definition: dblib.c:7023
RETCODE dbclropt(DBPROCESS *dbproc, int option, const char param[])
Reset an option.
Definition: dblib.c:6002
int dbaltop(DBPROCESS *dbproc, int computeid, int column)
Get aggregation operator for a compute column.
Definition: dblib.c:4352
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition: dblib.c:5048
RETCODE dbmny4minus(DBPROCESS *dbproc, DBMONEY4 *src, DBMONEY4 *dest)
Negate a DBMONEY4 value.
Definition: dblib.c:5454
DBINT dbcount(DBPROCESS *dbproc)
Get count of rows processed.
Definition: dblib.c:2814
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:6503
RETCODE dbmnymaxneg(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum negative DBMONEY value supported.
Definition: dblib.c:5274
RETCODE bcp_columns(DBPROCESS *dbproc, int host_colcount)
Indicate how many columns are to be found in the datafile.
Definition: bcp.c:296
RETCODE dbsprline(DBPROCESS *dbproc, char *buffer, DBINT buf_len, DBCHAR line_char)
Get formatted string for underlining dbsprhead() column names.
Definition: dblib.c:3748
char * dbservcharset(DBPROCESS *dbprocess)
Get syscharset name of the server character set.
Definition: dblib.c:6932
DBINT dbfirstrow(DBPROCESS *dbproc)
See if a server response has arrived.
Definition: dblib.c:7101
int dbaltcolid(DBPROCESS *dbproc, int computeid, int column)
Get column ID of a compute column.
Definition: dblib.c:4192
RETCODE dbrpcsend(DBPROCESS *dbproc)
Execute the procedure and free associated memory.
Definition: rpc.c:281
BYTE * dbgetuserdata(DBPROCESS *dbproc)
Get address of user-allocated data from a DBPROCESS.
Definition: dblib.c:5866
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:504
RETCODE dbmnyinc(DBPROCESS *dbproc, DBMONEY *mnyptr)
Add $0.0001 to a DBMONEY value.
Definition: dblib.c:5371
RETCODE dbsetlname(LOGINREC *login, const char *value, int which)
Set the value of a string in a LOGINREC structure.
Definition: dblib.c:769
DBINT dbcolutype(DBPROCESS *dbprocess, int column)
Get user-defined datatype of a regular result column.
Definition: dblib.c:2916
void dbrecftos(const char filename[])
Record to a file all SQL commands sent to the server.
Definition: dblib.c:6676
int dbgetmaxprocs(void)
get maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:4083
DBBOOL dbisopt(DBPROCESS *dbproc, int option, const char param[])
Get value of an option.
Definition: dblib.c:6070
DBINT dbvarylen(DBPROCESS *dbproc, int column)
Determine whether a column can vary in size.
Definition: dblib.c:3139
RETCODE bcp_readfmt(DBPROCESS *dbproc, const char filename[])
Read a format definition file.
Definition: bcp.c:1625
DBBOOL dbdead(DBPROCESS *dbproc)
Check if dbproc is an ex-parrot.
Definition: dblib.c:4966
RETCODE dbmnyminus(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Negate a DBMONEY value.
Definition: dblib.c:5427
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition: dblib.c:715
char * dbretname(DBPROCESS *dbproc, int retnum)
Get name of an output parameter filled by a stored procedure.
Definition: dblib.c:4628
BYTE * dbdata(DBPROCESS *dbproc, int column)
Get address of data in a regular result column.
Definition: dblib.c:3273
STATUS dbrowtype(DBPROCESS *dbprocess)
Get returned row's type.
Definition: dblib.c:6110
RETCODE dbmny4zero(DBPROCESS *dbproc, DBMONEY4 *dest)
Zero a DBMONEY4 value.
Definition: dblib.c:5478
RETCODE dbdatecrack(DBPROCESS *dbproc, DBDATEREC *di, DBDATETIME *dt)
Break a DBDATETIME value into useful pieces.
Definition: dblib.c:5755
void dbclrbuf(DBPROCESS *dbproc, DBINT n)
Clear n rows from the row buffer.
Definition: dblib.c:2834
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition: dblib.c:1685
const char * dbprtype(int token)
Print a token value's name to a buffer.
Definition: dblib.c:6357
RETCODE dbnullbind(DBPROCESS *dbproc, int column, DBINT *indicator)
Tie a null-indicator to a regular result column.
Definition: dblib.c:2730
RETCODE dbanullbind(DBPROCESS *dbprocess, int computeid, int column, DBINT *indicator)
Tie a null-indicator to a compute result column.
Definition: dblib.c:2766
DBINT dbprcollen(DBPROCESS *dbproc, int column)
Get size of a result column needed to print column.
Definition: dblib.c:3113