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
216 #define SYBAOPCNT 0x4b
217 #define SYBAOPCNTU 0x4c
218 #define SYBAOPSUM 0x4d
219 #define SYBAOPSUMU 0x4e
220 #define SYBAOPAVG 0x4f
221 #define SYBAOPAVGU 0x50
222 #define SYBAOPMIN 0x51
223 #define SYBAOPMAX 0x52
226 #define SYBAOPCNT_BIG 0x09
227 #define SYBAOPSTDEV 0x30
228 #define SYBAOPSTDEVP 0x31
229 #define SYBAOPVAR 0x32
230 #define SYBAOPVARP 0x33
231 #define SYBAOPCHECKSUM_AGG 0x72
235 typedef unsigned char DBBOOL;
237 typedef unsigned char DBBIT;
238 typedef unsigned char DBTINYINT;
239 typedef tds_sysdep_int16_type DBSMALLINT;
240 typedef tds_sysdep_int32_type DBINT;
241 typedef tds_sysdep_int64_type DBBIGINT;
242 typedef unsigned char DBBINARY;
243 typedef tds_sysdep_real32_type DBREAL;
244 typedef tds_sysdep_real64_type DBFLT8;
245 typedef unsigned tds_sysdep_int16_type DBUSMALLINT;
256 unsigned char array[256];
261 unsigned char precision;
263 unsigned char array[33];
271 unsigned tds_sysdep_int32_type mnylow;
292 # define SQLCHAR SYBCHAR
303 typedef unsigned char BYTE;
322 { MAXCOLNAMELEN = 512 };
323 typedef enum { CI_REGULAR=1, CI_ALTERNATE=2, CI_CURSOR=3 } CI_TYPE;
328 DBCHAR Name[MAXCOLNAMELEN+2];
329 DBCHAR ActualName[MAXCOLNAMELEN+2];
330 DBCHAR TableName[MAXCOLNAMELEN+2];
347 DBCHAR Name[MAXCOLNAMELEN+2];
348 DBCHAR ActualName[MAXCOLNAMELEN+2];
349 DBCHAR TableName[MAXCOLNAMELEN+2];
361 DBINT ServerMaxLength;
362 DBCHAR ServerTypeDeclaration[256];
369 #define DBPARSEONLY 0
373 #define DBARITHIGNORE 4
375 #define DBARITHABORT 6
376 #define DBTEXTLIMIT 7
382 #define DBSTORPROCID 13
384 #define DBNOAUTOFREE 15
385 #define DBROWCOUNT 16
386 #define DBTEXTSIZE 17
388 #define DBDATEFORMAT 19
390 #define DBPRCOLSEP 21
391 #define DBPRLINELEN 22
392 #define DBPRLINESEP 23
393 #define DBLFCONVERT 24
394 #define DBDATEFIRST 25
395 #define DBCHAINXACTS 26
396 #define DBFIPSFLAG 27
397 #define DBISOLATION 28
399 #define DBIDENTITY 30
401 #define DBDATESHORT 32
402 #define DBCLIENTCURSORS 33
404 #define DBQUOTEDIDENT 35
406 #define DBNUMOPTIONS 36
414 #define NOSUCHOPTION 2
416 #define MAXOPTTEXT 32
466 typedef int (*EHANDLEFUNC) (
DBPROCESS * dbproc,
int severity,
int dberr,
int oserr,
char *dberrstr,
char *oserrstr);
468 typedef int (*MHANDLEFUNC) (
DBPROCESS * dbproc, DBINT msgno,
int msgstate,
int severity,
char *msgtext,
char *srvname,
469 char *proc,
int line);
473 #define DBNOTIFICATION 2
475 #define DBINTERRUPT 4
483 #define NTBSTRINGBIND 2
484 #define VARYCHARBIND 3
485 #define VARYBINBIND 4
491 #define DATETIMEBIND 11
492 #define SMALLDATETIMEBIND 12
494 #define SMALLMONEYBIND 14
495 #define BINARYBIND 15
497 #define NUMERICBIND 17
498 #define DECIMALBIND 18
499 #define SRCNUMERICBIND 19
500 #define SRCDECIMALBIND 20
503 #define BIGINTBIND 30
504 #define DATETIME2BIND 31
505 #define MAXBINDTYPES 32
507 #define DBPRCOLSEP 21
508 #define DBPRLINELEN 22
509 #define DBRPCRETURN 1
510 #define DBRPCDEFAULT 2
514 #define NO_MORE_ROWS -2
516 #define NO_MORE_RESULTS 2
522 #define DB_QUERYOUT 3
529 #define DBRPCRECOMPILE TDS_STATIC_CAST(DBSMALLINT, 0x0001)
530 #define DBRPCRESET TDS_STATIC_CAST(DBSMALLINT, 0x0002)
531 #define DBRPCCURSOR TDS_STATIC_CAST(DBSMALLINT, 0x0008)
533 #if defined(DBLIB_UNIMPLEMENTED)
534 DBBOOL db12hour(
DBPROCESS * dbprocess,
const char language[]);
536 DBBOOL dbcolbrowse(
DBPROCESS * dbprocess,
int colnum);
538 RETCODE dbcursor(DBCURSOR * hc, DBINT optype, DBINT bufno, BYTE * table, BYTE * values);
539 RETCODE dbcursorbind(DBCURSOR * hc,
int col,
int vartype, DBINT varlen, DBINT * poutlen, BYTE * pvaraddr,
DBTYPEINFO * typeinfo);
540 void dbcursorclose(DBCURSOR * hc);
541 RETCODE dbcursorcolinfo(DBCURSOR * hc, DBINT column, DBCHAR * colname, DBINT * coltype, DBINT * collen, DBINT * usertype);
542 RETCODE dbcursorfetch(DBCURSOR * hc, DBINT fetchtype, DBINT rownum);
543 RETCODE dbcursorinfo(DBCURSOR * hc, DBINT * ncols, DBINT * nrows);
544 DBCURSOR *dbcursoropen(
DBPROCESS * dbprocess, BYTE * stmt, SHORT scollopt, SHORT concuropt, USHORT nrows, DBINT * pstatus);
548 RETCODE dbdatechar(
DBPROCESS * dbprocess,
char *buf,
int datepart,
int value);
550 char *dateorder(
DBPROCESS * dbprocess,
char *language);
553 char *dbdayname(
DBPROCESS * dbprocess,
char *language,
int daynum);
555 int dbgetoff(
DBPROCESS * dbprocess, DBUSMALLINT offtype,
int startfrom);
557 char *dbqual(
DBPROCESS * dbprocess,
int tabnum,
char *tabname);
558 void dbfreequal(
char *qualptr);
560 DBSORTORDER *dbloadsort(
DBPROCESS * dbprocess);
561 RETCODE dbfreesort(
DBPROCESS * dbprocess, DBSORTORDER * sortorder);
563 RETCODE dbload_xlate(
DBPROCESS * dbprocess,
char *srv_charset,
char *clt_name, DBXLATE ** xlt_tosrv, DBXLATE ** xlt_todisp);
569 RETCODE dbmnydown(
DBPROCESS * dbproc,
DBMONEY * mnyptr,
int divisor,
int *remainder);
570 RETCODE dbmnyinit(
DBPROCESS * dbproc,
DBMONEY * mnyptr,
int trim, DBBOOL * negative);
571 RETCODE dbmnyndigit(
DBPROCESS * dbproc,
DBMONEY * mnyptr, DBCHAR * value, DBBOOL * zero);
573 RETCODE dbmnydigit(
DBPROCESS * dbprocess,
DBMONEY * m1, DBCHAR * value, DBBOOL * zero);
574 RETCODE dbmnyscale(
DBPROCESS * dbproc,
DBMONEY * dest,
int multiplier,
int addend);
577 RETCODE dbnpcreate(
DBPROCESS * dbprocess);
578 RETCODE dbnpdefine(
DBPROCESS * dbprocess, DBCHAR * procedure_name, DBSMALLINT namelen);
582 RETCODE dbpoll(
DBPROCESS * dbproc,
long milliseconds,
DBPROCESS ** ready_dbproc,
int *return_reason);
583 int dbordercol(
DBPROCESS * dbprocess,
int order);
585 RETCODE dbregdrop(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
586 RETCODE dbregexec(
DBPROCESS * dbproc, DBUSMALLINT options);
587 RETCODE dbreghandle(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, INTFUNCPTR handler);
588 RETCODE dbreginit(
DBPROCESS * dbproc, DBCHAR * procedure_name, DBSMALLINT namelen);
590 RETCODE dbregnowatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
591 RETCODE dbregparam(
DBPROCESS * dbproc,
char *param_name,
int type, DBINT datalen, BYTE * data);
592 RETCODE dbregwatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, DBUSMALLINT options);
593 RETCODE dbregwatchlist(
DBPROCESS * dbprocess);
596 RETCODE dbrpwset(
LOGINREC * login,
char *srvname,
char *password,
int pwlen);
598 DBINT dbreadpage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, BYTE * buf);
599 RETCODE dbwritepage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, DBINT size, BYTE * buf);
601 RETCODE dbsetdeflang(
char *language);
603 int dbstrcmp(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
604 int dbstrsort(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
606 DBBOOL dbtabbrowse(
DBPROCESS * dbprocess,
int tabnum);
608 char *dbtabname(
DBPROCESS * dbprocess,
int tabnum);
609 char *dbtabsource(
DBPROCESS * dbprocess,
int colnum,
int *tabnum);
611 RETCODE dbsetlshort(
LOGINREC * login,
int value,
int which);
613 RETCODE dbsendpassthru(
DBPROCESS * dbprocess, DBVOIDPTR bufp);
614 RETCODE dbrecvpassthru(
DBPROCESS * dbprocess, DBVOIDPTR * bufp);
616 RETCODE dbgetloginfo(
DBPROCESS * dbprocess, DBLOGINFO ** loginfo);
617 RETCODE dbsetloginfo(
LOGINREC * loginrec, DBLOGINFO * loginfo);
620 DBBINARY *dbtsnewval(
DBPROCESS * dbprocess);
621 RETCODE dbtsput(
DBPROCESS * dbprocess, DBBINARY * newts,
int newtslen,
int tabnum,
char *tabname);
623 RETCODE dbfree_xlate(
DBPROCESS * dbprocess, DBXLATE * xlt_tosrv, DBXLATE * clt_todisp);
624 int dbxlate(
DBPROCESS * dbprocess,
char *src,
int srclen,
char *dest,
int destlen, DBXLATE * xlt,
int *srcbytes_used,
625 DBBOOL srcend,
int status);
627 RETCODE bcp_moretext(
DBPROCESS * dbproc, DBINT size, BYTE * text);
628 RETCODE bcp_writefmt(
DBPROCESS * dbproc,
const char filename[]);
630 void build_xact_string(
char *xact_name,
char *service_name, DBINT commid,
char *result);
631 RETCODE remove_xact(
DBPROCESS * connect, DBINT commid,
int n);
632 RETCODE abort_xact(
DBPROCESS * connect, DBINT commid);
634 RETCODE commit_xact(
DBPROCESS * connect, DBINT commid);
636 RETCODE scan_xact(
DBPROCESS * connect, DBINT commid);
637 DBINT start_xact(
DBPROCESS * connect,
char *application_name,
char *xact_name,
int site_count);
638 DBINT stat_xact(
DBPROCESS * connect, DBINT commid);
644 RETCODE
dbaltbind(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
645 RETCODE dbaltbind_ps(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
653 RETCODE
dbbind(
DBPROCESS * dbproc,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
654 RETCODE dbbind_ps(
DBPROCESS * dbprocess,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
DBTYPEINFO * typeinfo);
660 DBBOOL dbcharsetconv(
DBPROCESS * dbprocess);
667 #define DBCMDROW(x) dbcmdrow((x))
676 DBINT
dbconvert(
DBPROCESS * dbproc,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen);
677 DBINT
dbconvert_ps(
DBPROCESS * dbprocess,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen,
682 #define DBCOUNT(x) dbcount((x))
685 #define DBCURCMD(x) dbcurcmd((x))
688 #define DBCURROW(x) dbcurrow((x))
695 #define DBDEAD(x) dbdead((x))
701 #define DBFIRSTROW(x) dbfirstrow((x))
704 char *dbgetcharset(
DBPROCESS * dbprocess);
705 int dbgetlusername(
LOGINREC * login, BYTE * name_buffer,
int buffer_len);
707 char *dbgetnatlanf(
DBPROCESS * dbprocess);
711 #define DBGETTIME dbgettime
717 #define DBIORDESC(x) dbiordesc((x))
720 #define DBIOWDESC(x) dbiowdesc((x))
723 #define DBISAVAIL(x) dbisavail((x))
727 #define DBLASTROW(x) dblastrow((x))
753 #define DBMORECMDS(x) dbmorecmds((x))
768 void dbpivot_count (
struct col_t *output,
const struct col_t *input);
769 void dbpivot_sum (
struct col_t *output,
const struct col_t *input);
770 void dbpivot_min (
struct col_t *output,
const struct col_t *input);
771 void dbpivot_max (
struct col_t *output,
const struct col_t *input);
774 typedef void (*DBPIVOT_FUNC)(
struct col_t *output,
const struct col_t *input);
777 RETCODE
dbpivot(
DBPROCESS *dbproc,
int nkeys,
int *keys,
int ncols,
int *cols, DBPIVOT_FUNC func,
int val);
779 DBPIVOT_FUNC dbpivot_lookup_name(
const char name[] );
782 #define dbopen(x,y) tdsdbopen((x),(y), 1)
784 #define dbopen(x,y) tdsdbopen((x),(y), 0)
788 #ifdef PHP_SYBASE_DBOPEN
789 #undef PHP_SYBASE_DBOPEN
790 #define PHP_SYBASE_DBOPEN dbopen
801 RETCODE dbresults_r(
DBPROCESS * dbproc,
int recursive);
809 #define DBROWS(x) dbrows((x))
812 #define DBROWTYPE(x) dbrowtype((x))
814 RETCODE
dbrpcparam(
DBPROCESS * dbproc,
const char paramname[], BYTE status,
int type, DBINT maxlen, DBINT datalen, BYTE * value);
816 RETCODE
dbsafestr(
DBPROCESS * dbproc,
const char *src, DBINT srclen,
char *dest, DBINT destlen,
int quotetype);
817 RETCODE *dbsechandle(DBINT type, INTFUNCPTR handler);
820 void dbsetbusy(
DBPROCESS * dbprocess, DB_DBBUSY_FUNC busyfunc);
821 RETCODE dbsetdefcharset(
char *charset);
822 void dbsetidle(
DBPROCESS * dbprocess, DB_DBIDLE_FUNC idlefunc);
828 RETCODE
dbsetopt(
DBPROCESS * dbproc,
int option,
const char *char_param,
int int_param);
842 int dbstrbuild(
DBPROCESS * dbproc,
char *charbuf,
int bufsize,
char *text,
char *formats, ...);
847 #define SYBEVERDOWN 100
848 #define SYBEICONVIU 2400
849 #define SYBEICONVAVAIL 2401
850 #define SYBEICONVO 2402
851 #define SYBEICONVI 2403
852 #define SYBEICONV2BIG 2404
855 #define SYBETDSVER 2410
856 #define SYBEPORT 2500
857 #define SYBESYNC 20001
858 #define SYBEFCON 20002
859 #define SYBETIME 20003
860 #define SYBEREAD 20004
861 #define SYBEBUFL 20005
862 #define SYBEWRIT 20006
863 #define SYBEVMS 20007
864 #define SYBESOCK 20008
865 #define SYBECONN 20009
866 #define SYBEMEM 20010
867 #define SYBEDBPS 20011
868 #define SYBEINTF 20012
869 #define SYBEUHST 20013
870 #define SYBEPWD 20014
871 #define SYBEOPIN 20015
872 #define SYBEINLN 20016
873 #define SYBESEOF 20017
874 #define SYBESMSG 20018
875 #define SYBERPND 20019
876 #define SYBEBTOK 20020
877 #define SYBEITIM 20021
878 #define SYBEOOB 20022
879 #define SYBEBTYP 20023
880 #define SYBEBNCR 20024
881 #define SYBEIICL 20025
882 #define SYBECNOR 20026
883 #define SYBENPRM 20027
884 #define SYBEUVDT 20028
885 #define SYBEUFDT 20029
886 #define SYBEWAID 20030
887 #define SYBECDNS 20031
888 #define SYBEABNC 20032
889 #define SYBEABMT 20033
890 #define SYBEABNP 20034
891 #define SYBEAAMT 20035
892 #define SYBENXID 20036
893 #define SYBERXID 20037
894 #define SYBEICN 20038
895 #define SYBENMOB 20039
896 #define SYBEAPUT 20040
897 #define SYBEASNL 20041
898 #define SYBENTLL 20042
899 #define SYBEASUL 20043
900 #define SYBERDNR 20044
901 #define SYBENSIP 20045
902 #define SYBEABNV 20046
903 #define SYBEDDNE 20047
904 #define SYBECUFL 20048
905 #define SYBECOFL 20049
906 #define SYBECSYN 20050
907 #define SYBECLPR 20051
908 #define SYBECNOV 20052
909 #define SYBERDCN 20053
910 #define SYBESFOV 20054
911 #define SYBEUNT 20055
912 #define SYBECLOS 20056
913 #define SYBEUAVE 20057
914 #define SYBEUSCT 20058
915 #define SYBEEQVA 20059
916 #define SYBEUDTY 20060
917 #define SYBETSIT 20061
918 #define SYBEAUTN 20062
919 #define SYBEBDIO 20063
920 #define SYBEBCNT 20064
921 #define SYBEIFNB 20065
922 #define SYBETTS 20066
923 #define SYBEKBCO 20067
924 #define SYBEBBCI 20068
925 #define SYBEKBCI 20069
926 #define SYBEBCRE 20070
927 #define SYBETPTN 20071
928 #define SYBEBCWE 20072
929 #define SYBEBCNN 20073
930 #define SYBEBCOR 20074
931 #define SYBEBCIS 20075
932 #define SYBEBCPI 20076
933 #define SYBEBCPN 20077
934 #define SYBEBCPB 20078
935 #define SYBEVDPT 20079
936 #define SYBEBIVI 20080
937 #define SYBEBCBC 20081
938 #define SYBEBCFO 20082
939 #define SYBEBCVH 20083
940 #define SYBEBCUO 20084
941 #define SYBEBCUC 20085
942 #define SYBEBUOE 20086
943 #define SYBEBUCE 20087
944 #define SYBEBWEF 20088
945 #define SYBEASTF 20089
946 #define SYBEUACS 20090
947 #define SYBEASEC 20091
948 #define SYBETMTD 20092
949 #define SYBENTTN 20093
950 #define SYBEDNTI 20094
951 #define SYBEBTMT 20095
952 #define SYBEORPF 20096
953 #define SYBEUVBF 20097
954 #define SYBEBUOF 20098
955 #define SYBEBUCF 20099
956 #define SYBEBRFF 20100
957 #define SYBEBWFF 20101
958 #define SYBEBUDF 20102
959 #define SYBEBIHC 20103
960 #define SYBEBEOF 20104
961 #define SYBEBCNL 20105
962 #define SYBEBCSI 20106
963 #define SYBEBCIT 20107
964 #define SYBEBCSA 20108
965 #define SYBENULL 20109
966 #define SYBEUNAM 20110
967 #define SYBEBCRO 20111
968 #define SYBEMPLL 20112
969 #define SYBERPIL 20113
970 #define SYBERPUL 20114
971 #define SYBEUNOP 20115
972 #define SYBECRNC 20116
973 #define SYBERTCC 20117
974 #define SYBERTSC 20118
975 #define SYBEUCRR 20119
976 #define SYBERPNA 20120
977 #define SYBEOPNA 20121
978 #define SYBEFGTL 20122
979 #define SYBECWLL 20123
980 #define SYBEUFDS 20124
981 #define SYBEUCPT 20125
982 #define SYBETMCF 20126
983 #define SYBEAICF 20127
984 #define SYBEADST 20128
985 #define SYBEALTT 20129
986 #define SYBEAPCT 20130
987 #define SYBEXOCI 20131
988 #define SYBEFSHD 20132
989 #define SYBEAOLF 20133
990 #define SYBEARDI 20134
991 #define SYBEURCI 20135
992 #define SYBEARDL 20136
993 #define SYBEURMI 20137
994 #define SYBEUREM 20138
995 #define SYBEURES 20139
996 #define SYBEUREI 20140
997 #define SYBEOREN 20141
998 #define SYBEISOI 20142
999 #define SYBEIDCL 20143
1000 #define SYBEIMCL 20144
1001 #define SYBEIFCL 20145
1002 #define SYBEUTDS 20146
1003 #define SYBEBUFF 20147
1004 #define SYBEACNV 20148
1005 #define SYBEDPOR 20149
1006 #define SYBENDC 20150
1007 #define SYBEMVOR 20151
1008 #define SYBEDVOR 20152
1009 #define SYBENBVP 20153
1010 #define SYBESPID 20154
1011 #define SYBENDTP 20155
1012 #define SYBEXTN 20156
1013 #define SYBEXTDN 20157
1014 #define SYBEXTSN 20158
1015 #define SYBENUM 20159
1016 #define SYBETYPE 20160
1017 #define SYBEGENOS 20161
1018 #define SYBEPAGE 20162
1019 #define SYBEOPTNO 20163
1020 #define SYBEETD 20164
1021 #define SYBERTYPE 20165
1022 #define SYBERFILE 20166
1023 #define SYBEFMODE 20167
1024 #define SYBESLCT 20168
1025 #define SYBEZTXT 20169
1026 #define SYBENTST 20170
1027 #define SYBEOSSL 20171
1028 #define SYBEESSL 20172
1029 #define SYBENLNL 20173
1030 #define SYBENHAN 20174
1031 #define SYBENBUF 20175
1032 #define SYBENULP 20176
1033 #define SYBENOTI 20177
1034 #define SYBEEVOP 20178
1035 #define SYBENEHA 20179
1036 #define SYBETRAN 20180
1037 #define SYBEEVST 20181
1038 #define SYBEEINI 20182
1039 #define SYBEECRT 20183
1040 #define SYBEECAN 20184
1041 #define SYBEEUNR 20185
1042 #define SYBERPCS 20186
1043 #define SYBETPAR 20187
1044 #define SYBETEXS 20188
1045 #define SYBETRAC 20189
1046 #define SYBETRAS 20190
1047 #define SYBEPRTF 20191
1048 #define SYBETRSN 20192
1049 #define SYBEBPKS 20193
1050 #define SYBEIPV 20194
1051 #define SYBEMOV 20195
1052 #define SYBEDIVZ 20196
1053 #define SYBEASTL 20197
1054 #define SYBESEFA 20198
1055 #define SYBEPOLL 20199
1056 #define SYBENOEV 20200
1057 #define SYBEBADPK 20201
1058 #define SYBESECURE 20202
1059 #define SYBECAP 20203
1060 #define SYBEFUNC 20204
1061 #define SYBERESP 20205
1062 #define SYBEIVERS 20206
1063 #define SYBEONCE 20207
1064 #define SYBERPNULL 20208
1065 #define SYBERPTXTIM 20209
1066 #define SYBENEG 20210
1067 #define SYBELBLEN 20211
1068 #define SYBEUMSG 20212
1069 #define SYBECAPTYP 20213
1070 #define SYBEBNUM 20214
1071 #define SYBEBBL 20215
1072 #define SYBEBPREC 20216
1073 #define SYBEBSCALE 20217
1074 #define SYBECDOMAIN 20218
1075 #define SYBECINTERNAL 20219
1076 #define SYBEBTYPSRV 20220
1077 #define SYBEBCSET 20221
1078 #define SYBEFENC 20222
1079 #define SYBEFRES 20223
1080 #define SYBEISRVPREC 20224
1081 #define SYBEISRVSCL 20225
1082 #define SYBEINUMCL 20226
1083 #define SYBEIDECCL 20227
1084 #define SYBEBCMTXT 20228
1085 #define SYBEBCPREC 20229
1086 #define SYBEBCBNPR 20230
1087 #define SYBEBCBNTYP 20231
1088 #define SYBEBCSNTYP 20232
1089 #define SYBEBCPCTYP 20233
1090 #define SYBEBCVLEN 20234
1091 #define SYBEBCHLEN 20235
1092 #define SYBEBCBPREF 20236
1093 #define SYBEBCPREF 20237
1094 #define SYBEBCITBNM 20238
1095 #define SYBEBCITBLEN 20239
1096 #define SYBEBCSNDROW 20240
1097 #define SYBEBPROCOL 20241
1098 #define SYBEBPRODEF 20242
1099 #define SYBEBPRONUMDEF 20243
1100 #define SYBEBPRODEFID 20244
1101 #define SYBEBPRONODEF 20245
1102 #define SYBEBPRODEFTYP 20246
1103 #define SYBEBPROEXTDEF 20247
1104 #define SYBEBPROEXTRES 20248
1105 #define SYBEBPROBADDEF 20249
1106 #define SYBEBPROBADTYP 20250
1107 #define SYBEBPROBADLEN 20251
1108 #define SYBEBPROBADPREC 20252
1109 #define SYBEBPROBADSCL 20253
1110 #define SYBEBADTYPE 20254
1111 #define SYBECRSNORES 20255
1112 #define SYBECRSNOIND 20256
1113 #define SYBECRSVIEW 20257
1114 #define SYBECRSVIIND 20258
1115 #define SYBECRSORD 20259
1116 #define SYBECRSBUFR 20260
1117 #define SYBECRSNOFREE 20261
1118 #define SYBECRSDIS 20262
1119 #define SYBECRSAGR 20263
1120 #define SYBECRSFRAND 20264
1121 #define SYBECRSFLAST 20265
1122 #define SYBECRSBROL 20266
1123 #define SYBECRSFROWN 20267
1124 #define SYBECRSBSKEY 20268
1125 #define SYBECRSRO 20269
1126 #define SYBECRSNOCOUNT 20270
1127 #define SYBECRSTAB 20271
1128 #define SYBECRSUPDNB 20272
1129 #define SYBECRSNOWHERE 20273
1130 #define SYBECRSSET 20274
1131 #define SYBECRSUPDTAB 20275
1132 #define SYBECRSNOUPD 20276
1133 #define SYBECRSINV 20277
1134 #define SYBECRSNOKEYS 20278
1135 #define SYBECRSNOBIND 20279
1136 #define SYBECRSFTYPE 20280
1137 #define SYBECRSINVALID 20281
1138 #define SYBECRSMROWS 20282
1139 #define SYBECRSNROWS 20283
1140 #define SYBECRSNOLEN 20284
1141 #define SYBECRSNOPTCC 20285
1142 #define SYBECRSNORDER 20286
1143 #define SYBECRSNOTABLE 20287
1144 #define SYBECRSNUNIQUE 20288
1145 #define SYBECRSVAR 20289
1146 #define SYBENOVALUE 20290
1147 #define SYBEVOIDRET 20291
1148 #define SYBECLOSEIN 20292
1149 #define SYBEBOOL 20293
1150 #define SYBEBCPOPT 20294
1151 #define SYBEERRLABEL 20295
1152 #define SYBEATTNACK 20296
1153 #define SYBEBBFL 20297
1154 #define SYBEDCL 20298
1155 #define SYBECS 20299
1156 #define SYBEBULKINSERT 20599
1157 #define SYBECOLSIZE 22000
1161 #define DBTDS(a) dbtds(a)
1162 DBINT dbtextsize(
DBPROCESS * dbprocess);
1165 DBBINARY *dbtxtsnewval(
DBPROCESS * dbprocess);
1166 RETCODE dbtxtsput(
DBPROCESS * dbprocess, DBBINARY newtxts,
int colnum);
1170 RETCODE
dbwritetext(
DBPROCESS * dbproc,
char *objname, DBBINARY * textptr, DBTINYINT textptrlen, DBBINARY * timestamp,
1171 DBBOOL log, DBINT size, BYTE * text);
1180 #define DBSETLHOST(x,y) dbsetlname((x), (y), DBSETHOST)
1181 #define dbsetlhost(x,y) dbsetlname((x), (y), DBSETHOST)
1183 #define DBSETLUSER(x,y) dbsetlname((x), (y), DBSETUSER)
1184 #define dbsetluser(x,y) dbsetlname((x), (y), DBSETUSER)
1186 #define DBSETLPWD(x,y) dbsetlname((x), (y), DBSETPWD)
1187 #define dbsetlpwd(x,y) dbsetlname((x), (y), DBSETPWD)
1188 #if defined(DBLIB_UNIMPLEMENTED)
1190 # define DBSETLHID(x,y) dbsetlname((x), (y), DBSETHID)
1193 #define DBSETLAPP(x,y) dbsetlname((x), (y), DBSETAPP)
1194 #define dbsetlapp(x,y) dbsetlname((x), (y), DBSETAPP)
1196 #define BCP_SETL(x,y) dbsetlbool((x), (y), DBSETBCP)
1197 #define DBSETLSECURE(x) dbsetlbool((x), (1), DBSETBCP)
1198 #define DBSETNATLANG 7
1199 #define DBSETLNATLANG(x,y) dbsetlname((x), (y), DBSETNATLANG)
1200 #define dbsetlnatlang(x,y) dbsetlname((x), (y), DBSETNATLANG)
1201 #if defined(DBLIB_UNIMPLEMENTED)
1202 # define DBSETNOSHORT 8
1203 # define DBSETLNOSHORT(x,y) dbsetlbool((x), (y), DBSETNOSHORT)
1204 # define DBSETHIER 9
1205 # define DBSETLHIER(x,y) dbsetlshort((x), (y), DBSETHIER)
1207 #define DBSETCHARSET 10
1208 #define DBSETLCHARSET(x,y) dbsetlname((x), (y), DBSETCHARSET)
1209 #define DBSETPACKET 11
1210 #define DBSETLPACKET(x,y) dbsetllong((x), (y), DBSETPACKET)
1211 #define dbsetlpacket(x,y) dbsetllong((x), (y), DBSETPACKET)
1212 #define DBSETENCRYPT 12
1213 #define DBSETLENCRYPT(x,y) dbsetlbool((x), (y), DBSETENCRYPT)
1214 #define DBSETLABELED 13
1215 #define DBSETLLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1216 #define BCP_SETLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1217 #define DBSETDBNAME 14
1218 #define DBSETLDBNAME(x,y) dbsetlname((x), (y), DBSETDBNAME)
1219 #define DBSETLVERSION(login, version) dbsetlversion((login), (version))
1221 RETCODE
bcp_init(
DBPROCESS * dbproc,
const char *tblname,
const char *hfile,
const char *errfile,
int direction);
1225 RETCODE
bcp_bind(
DBPROCESS * dbproc, BYTE * varaddr,
int prefixlen, DBINT varlen, BYTE * terminator,
int termlen,
int type,
1229 RETCODE
bcp_colfmt(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1230 const BYTE * host_term,
int host_termlen,
int colnum);
1231 RETCODE
bcp_colfmt_ps(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1232 BYTE * host_term,
int host_termlen,
int colnum,
DBTYPEINFO * typeinfo);
1235 int bcp_getbatchsize(
DBPROCESS * dbproc);
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
DBINT dbprcollen(DBPROCESS *dbproc, int column)
Get size of a result column needed to print column.
Definition: dblib.c:3054
DBBOOL dbwillconvert(int srctype, int desttype)
Test whether or not a datatype can be converted to another datatype.
Definition: dblib.c:2811
DBINT dbaltlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in compute column.
Definition: dblib.c:6902
RETCODE dbuse(DBPROCESS *dbproc, const char *name)
Change current database.
Definition: dblib.c:1431
int dbiordesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to read data coming from the server...
Definition: dblib.c:6996
RETCODE dbmnymaxneg(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum negative DBMONEY value supported.
Definition: dblib.c:5167
void dbsetuserdata(DBPROCESS *dbproc, BYTE *ptr)
Associate client-allocated (and defined) data with a DBPROCESS.
Definition: dblib.c:5719
RETCODE dbrows(DBPROCESS *dbproc)
Indicate whether a query returned rows.
Definition: dblib.c:3838
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition: dblib.c:4922
RETCODE dbmny4copy(DBPROCESS *dbprocess, DBMONEY4 *m1, DBMONEY4 *m2)
Copy a DBMONEY4 value.
Definition: dblib.c:5541
int dbtds(DBPROCESS *dbprocess)
Get the TDS version in use for dbproc.
Definition: dblib.c:6565
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:7065
RETCODE dbmnydec(DBPROCESS *dbproc, DBMONEY *mnyptr)
Subtract $0.0001 from a DBMONEY value.
Definition: dblib.c:5292
DBINT dbadlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in a compute column.
Definition: dblib.c:4113
RETCODE dbprrow(DBPROCESS *dbproc)
Print a result set to stdout.
Definition: dblib.c:3335
int dbstrlen(DBPROCESS *dbproc)
Get size of the command buffer, in bytes.
Definition: dblib.c:6055
const char * dbmonthname(DBPROCESS *dbproc, char *language, int monthnum, DBBOOL shortform)
Get name of a month, in some human language.
Definition: dblib.c:6722
RETCODE dbmorecmds(DBPROCESS *dbproc)
See if more commands are to be processed.
Definition: dblib.c:5999
DBINT dbspr1rowlen(DBPROCESS *dbproc)
Determine size buffer required to hold the results returned by dbsprhead(), dbsprline(), and dbspr1row().
Definition: dblib.c:3215
BYTE * dbadata(DBPROCESS *dbproc, int computeid, int column)
Get address of compute column data.
Definition: dblib.c:4226
BYTE * dbdata(DBPROCESS *dbproc, int column)
Get address of data in a regular result column.
Definition: dblib.c:3157
RETCODE dbgetrow(DBPROCESS *dbproc, DBINT row)
Read a row from the row buffer.
Definition: dblib.c:1898
int dbnumrets(DBPROCESS *dbproc)
Get count of output parameters filled by a stored procedure.
Definition: dblib.c:4489
DBPROCESS * dbopen(LOGINREC *login, const char *server)
Normally not used.
Definition: dbopen.c:35
int dbaltop(DBPROCESS *dbproc, int computeid, int column)
Get aggregation operator for a compute column.
Definition: dblib.c:4256
RETCODE dbsqlok(DBPROCESS *dbproc)
Wait for results of a query from the server.
Definition: dblib.c:4614
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Definition: dblib.c:6771
RETCODE bcp_exec(DBPROCESS *dbproc, DBINT *rows_copied)
Write a datafile to a table.
Definition: bcp.c:1554
int dbmny4cmp(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2)
Compare two DBMONEY4 values.
Definition: dblib.c:5513
DBINT dblastrow(DBPROCESS *dbproc)
Get number of the last row in the row buffer.
Definition: dblib.c:6972
DBINT dbcolutype(DBPROCESS *dbprocess, int column)
Get user-defined datatype of a regular result column.
Definition: dblib.c:2857
RETCODE dbmoretext(DBPROCESS *dbproc, DBINT size, const BYTE text[])
Send chunk of a text/image value to the server.
Definition: dblib.c:6496
DBINT dbaltutype(DBPROCESS *dbproc, int computeid, int column)
Get user-defined datatype of a compute column.
Definition: dblib.c:6878
int dbnumalts(DBPROCESS *dbproc, int computeid)
Get count of columns in a compute row.
Definition: dblib.c:4741
RETCODE dbsetllong(LOGINREC *login, long value, int which)
Set an integer value in a LOGINREC structure.
Definition: dblib.c:836
STATUS dbreadtext(DBPROCESS *dbproc, void *buf, DBINT bufsize)
Fetch part of a text or image value from the server.
Definition: dblib.c:6427
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition: bcp.c:536
DBINT dbfirstrow(DBPROCESS *dbproc)
See if a server response has arrived.
Definition: dblib.c:6957
void dbexit(void)
Close server connections and free all related structures.
Definition: dblib.c:1543
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition: dblib.c:721
DBTYPEINFO * dbcoltypeinfo(DBPROCESS *dbproc, int column)
Get precision and scale information for a regular result column.
Definition: dblib.c:2880
RETCODE dbmny4sub(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *diff)
Subtract two DBMONEY4 values.
Definition: dblib.c:5425
int dbretlen(DBPROCESS *dbproc, int retnum)
Get size of an output parameter filled by a stored procedure.
Definition: dblib.c:4579
DBBOOL dbhasretstat(DBPROCESS *dbproc)
Determine if query generated a return status number.
Definition: dblib.c:4447
RETCODE dbspr1row(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print a regular result row to a buffer.
Definition: dblib.c:3253
RETCODE dbsetlogintime(int seconds)
Set maximum seconds db-lib waits for a server response to a login attempt.
Definition: dblib.c:4041
int dbgettime(void)
Get maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4025
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition: dblib.c:2828
RETCODE dbsetopt(DBPROCESS *dbproc, int option, const char *char_param, int int_param)
Set db-lib or server option.
Definition: dblib.c:4284
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 dbmnymaxpos(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum positive DBMONEY value supported.
Definition: dblib.c:5146
DBBOOL dbisopt(DBPROCESS *dbproc, int option, const char param[])
Get value of an option.
Definition: dblib.c:5925
RETCODE dbsetnull(DBPROCESS *dbprocess, int bindtype, int bindlen, BYTE *bindval)
Define substitution values to be used when binding null values.
Definition: dblib.c:1930
DBINT dbvarylen(DBPROCESS *dbproc, int column)
Determine whether a column can vary in size.
Definition: dblib.c:3080
RETCODE dbmnyinc(DBPROCESS *dbproc, DBMONEY *mnyptr)
Add $0.0001 to a DBMONEY value.
Definition: dblib.c:5264
void dbclose(DBPROCESS *dbproc)
Close a connection to the server and free associated resources.
Definition: dblib.c:1474
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 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:6358
char * dbservcharset(DBPROCESS *dbprocess)
Get syscharset name of the server character set.
Definition: dblib.c:6787
void dbprhead(DBPROCESS *dbproc)
Print result set headings to stdout.
Definition: dblib.c:3763
char * dbchange(DBPROCESS *dbprocess)
See if a command caused the current database to change.
Definition: dblib.c:6751
int dbrettype(DBPROCESS *dbproc, int retnum)
Get datatype of a stored procedure's return parameter.
Definition: dblib.c:6030
RETCODE dbsqlsend(DBPROCESS *dbproc)
Transmit the command buffer to the server.
Definition: dblib.c:6807
STATUS dbsetrow(DBPROCESS *dbprocess, DBINT row)
Make a buffered row "current" without fetching it into bound variables.
Definition: dblib.c:2011
void dbfreebuf(DBPROCESS *dbproc)
Erase the command buffer, in case DBNOAUTOFREE was set with dbsetopt().
Definition: dblib.c:5839
int dbnumcols(DBPROCESS *dbproc)
Return number of regular columns in a result set.
Definition: dblib.c:1842
RETCODE dbbind(DBPROCESS *dbproc, int column, int vartype, DBINT varlen, BYTE *varaddr)
Tie a host variable to a resultset column.
Definition: dblib.c:2571
STATUS dbrowtype(DBPROCESS *dbprocess)
Get returned row's type.
Definition: dblib.c:5965
RETCODE dbmny4zero(DBPROCESS *dbproc, DBMONEY4 *dest)
Zero a DBMONEY4 value.
Definition: dblib.c:5371
DBINT bcp_done(DBPROCESS *dbproc)
Conclude the transfer of data from program variables.
Definition: bcp.c:1967
const char * dbprtype(int token)
Print a token value's name to a buffer.
Definition: dblib.c:6212
void dbrecftos(const char filename[])
Record to a file all SQL commands sent to the server.
Definition: dblib.c:6531
int dbmnycmp(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2)
Compare two DBMONEY values.
Definition: dblib.c:5067
RETCODE bcp_colptr(DBPROCESS *dbproc, BYTE *colptr, int table_column)
Override bcp_bind() by pointing to a different host variable.
Definition: bcp.c:658
RETCODE dbsprline(DBPROCESS *dbproc, char *buffer, DBINT buf_len, DBCHAR line_char)
Get formatted string for underlining dbsprhead() column names.
Definition: dblib.c:3642
int dbdatecmp(DBPROCESS *dbproc, DBDATETIME *d1, DBDATETIME *d2)
Compare DBDATETIME values, similar to strcmp(3).
Definition: dblib.c:5566
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:4180
DBINT dbdatlen(DBPROCESS *dbproc, int column)
Get size of current row's data in a regular result column.
Definition: dblib.c:3129
RETCODE dbcanquery(DBPROCESS *dbproc)
Cancel the query currently being retrieved, discarding all pending rows.
Definition: dblib.c:5809
int dbcurcmd(DBPROCESS *dbproc)
Get number of the row just returned.
Definition: dblib.c:5982
void dbsetavail(DBPROCESS *dbprocess)
Mark a DBPROCESS as "available".
Definition: dblib.c:7040
RETCODE dbcmdrow(DBPROCESS *dbproc)
See if the current command can return rows.
Definition: dblib.c:4062
RETCODE dbrpcsend(DBPROCESS *dbproc)
Execute the procedure and free associated memory.
Definition: rpc.c:277
DBINT dbcount(DBPROCESS *dbproc)
Get count of rows processed.
Definition: dblib.c:2761
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:2249
BOOL dbiscount(DBPROCESS *dbproc)
Indicates whether or not the count returned by dbcount is real (Microsoft-compatibility feature)...
Definition: dblib.c:2741
DBPROCESS * tdsdbopen(LOGINREC *login, const char *server, int msdblib)
Form a connection with the server.
Definition: dblib.c:1165
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
void dbclrbuf(DBPROCESS *dbproc, DBINT n)
Clear n rows from the row buffer.
Definition: dblib.c:2781
RETCODE dbmny4minus(DBPROCESS *dbproc, DBMONEY4 *src, DBMONEY4 *dest)
Negate a DBMONEY4 value.
Definition: dblib.c:5347
int dbnumcompute(DBPROCESS *dbprocess)
Get count of COMPUTE clauses for a result set.
Definition: dblib.c:4774
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:2909
RETCODE bcp_options(DBPROCESS *dbproc, int option, BYTE *value, int valuelen)
Set "hints" for uploading a file.
Definition: bcp.c:610
RETCODE dbanullbind(DBPROCESS *dbprocess, int computeid, int column, DBINT *indicator)
Tie a null-indicator to a compute result column.
Definition: dblib.c:2713
BYTE * dbgetuserdata(DBPROCESS *dbproc)
Get address of user-allocated data from a DBPROCESS.
Definition: dblib.c:5737
RETCODE dbsetmaxprocs(int maxprocs)
Set maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3903
RETCODE dbsetversion(DBINT version)
Specify a db-lib version level.
Definition: dblib.c:5755
DBINT dbretstatus(DBPROCESS *dbproc)
Fetch status value returned by query or remote procedure call.
Definition: dblib.c:4471
int dbiowdesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to write data coming to the server...
Definition: dblib.c:7012
DBBOOL dbdead(DBPROCESS *dbproc)
Check if dbproc is an ex-parrot.
Definition: dblib.c:4859
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition: dblib.c:1690
int dbalttype(DBPROCESS *dbproc, int computeid, int column)
Get datatype for a compute column.
Definition: dblib.c:4144
RETCODE dbnullbind(DBPROCESS *dbproc, int column, DBINT *indicator)
Tie a null-indicator to a regular result column.
Definition: dblib.c:2677
RETCODE dbmnyminus(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Negate a DBMONEY value.
Definition: dblib.c:5320
RETCODE dbcancel(DBPROCESS *dbproc)
Cancel the current command batch.
Definition: dblib.c:3190
DBINT dbconvert(DBPROCESS *dbproc, int srctype, const BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen)
cf.
Definition: dblib.c:2532
RETCODE dbsprhead(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print result set headings to a buffer.
Definition: dblib.c:3700
RETCODE dbsetlbool(LOGINREC *login, int value, int which)
Set a boolean value in a LOGINREC structure.
Definition: dblib.c:907
int dbgetmaxprocs(void)
get maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3977
DBBINARY * dbtxtimestamp(DBPROCESS *dbproc, int column)
Get text timestamp for a column in the current row.
Definition: dblib.c:6291
BYTE * dbretdata(DBPROCESS *dbproc, int retnum)
Get value of an output parameter filled by a stored procedure.
Definition: dblib.c:4550
RETCODE dbdatecrack(DBPROCESS *dbproc, DBDATEREC *di, DBDATETIME *dt)
Break a DBDATETIME value into useful pieces.
Definition: dblib.c:5611
DBINT dbcollen(DBPROCESS *dbproc, int column)
Get size of a regular result column.
Definition: dblib.c:3031
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
Definition: dblib.c:1353
RETCODE dbmny4add(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *sum)
Add two DBMONEY4 values.
Definition: dblib.c:5394
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
RETCODE bcp_sendrow(DBPROCESS *dbproc)
Write data in host variables to the table.
Definition: bcp.c:1327
DBBINARY * dbtxptr(DBPROCESS *dbproc, int column)
Get text pointer for a column in the current row.
Definition: dblib.c:6321
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:6151
RETCODE dbinit(void)
Initialize db-lib.
Definition: dblib.c:676
RETCODE dbfcmd(DBPROCESS *dbproc, const char *fmt,...)
printf-like way to form SQL to send to the server.
Definition: dblib.c:1314
RETCODE dbmnycopy(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Copy a DBMONEY value.
Definition: dblib.c:5788
char * dbcolsource(DBPROCESS *dbproc, int colnum)
Get base database column name for a result set column.
Definition: dblib.c:3006
DBINT dbcurrow(DBPROCESS *dbproc)
Get number of the row currently being read.
Definition: dblib.c:5948
RETCODE bcp_columns(DBPROCESS *dbproc, int host_colcount)
Indicate how many columns are to be found in the datafile.
Definition: bcp.c:299
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition: dblib.c:4941
int dbspid(DBPROCESS *dbproc)
Get server process ID for a DBPROCESS.
Definition: dblib.c:5693
void dbloginfree(LOGINREC *login)
free the LOGINREC
Definition: dblib.c:753
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
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition: dblib.c:1405
RETCODE dbstrcpy(DBPROCESS *dbproc, int start, int numbytes, char *dest)
Get a copy of a chunk of the command buffer.
Definition: dblib.c:6107
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
int dbaltcolid(DBPROCESS *dbproc, int computeid, int column)
Get column ID of a compute column.
Definition: dblib.c:4086
const char * dbversion(void)
See which version of db-lib is in use.
Definition: dblib.c:6604
RETCODE dbsetlversion(LOGINREC *login, BYTE version)
Set TDS version for future connections.
Definition: dblib.c:936
char * dbretname(DBPROCESS *dbproc, int retnum)
Get name of an output parameter filled by a stored procedure.
Definition: dblib.c:4521
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:4428
RETCODE bcp_readfmt(DBPROCESS *dbproc, const char filename[])
Read a format definition file.
Definition: bcp.c:1615
RETCODE dbsettime(int seconds)
Set maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:3998
BYTE * dbbylist(DBPROCESS *dbproc, int computeid, int *size)
Get bylist for a compute row.
Definition: dblib.c:4800
DBBOOL bcp_getl(LOGINREC *login)
See if BCP_SETL() was used to set the LOGINREC for BCP work.
Definition: bcp.c:694
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:6229
DBINT bcp_batch(DBPROCESS *dbproc)
Commit a set of rows to the table.
Definition: bcp.c:1940
Definition: dbpivot.c:757
RETCODE dbrpcinit(DBPROCESS *dbproc, const char rpcname[], DBSMALLINT options)
Initialize a remote procedure call.
Definition: rpc.c:72
RETCODE dbsetlname(LOGINREC *login, const char *value, int which)
Set the value of a string in a LOGINREC structure.
Definition: dblib.c:775
Definition: bsqlodbc.c:97
char * dbcolname(DBPROCESS *dbproc, int column)
Return name of a regular result column.
Definition: dblib.c:1866
RETCODE dbclropt(DBPROCESS *dbproc, int option, const char param[])
Reset an option.
Definition: dblib.c:5873
char * dbgetchar(DBPROCESS *dbprocess, int n)
Get address of a position in the command buffer.
Definition: dblib.c:6074
void dbsetifile(char *filename)
set name and location of the interfaces file FreeTDS should use to look up a servername.
Definition: dblib.c:2648
int dbgetpacket(DBPROCESS *dbproc)
Get TDS packet size for the connection.
Definition: dblib.c:3879
RETCODE dbmnyzero(DBPROCESS *dbproc, DBMONEY *dest)
Set a DBMONEY value to zero.
Definition: dblib.c:5125