31 #include "tds_sysdep_public.h"
33 #undef TDS_STATIC_CAST
35 #define TDS_STATIC_CAST(type, a) static_cast<type>(a)
42 #define TDS_STATIC_CAST(type, a) ((type)(a))
45 static const char rcsid_sybdb_h[] =
"$Id: sybdb.h,v 1.106 2011-12-05 02:26:31 jklowden Exp $";
46 static const void *
const no_unused_sybdb_h_warn[] = { rcsid_sybdb_h, no_unused_sybdb_h_warn };
62 #define INT_CONTINUE 1
66 #define DBMAXNUMLEN 33
72 #define DBVERSION_UNKNOWN 0
73 #define DBVERSION_46 1
74 #define DBVERSION_100 2
75 #define DBVERSION_42 3
76 #define DBVERSION_70 4
77 #define DBVERSION_71 5
78 #define DBVERSION_80 DBVERSION_71
79 #define DBVERSION_72 6
80 #define DBVERSION_73 7
83 #define DBVER42 DBVERSION_42
84 #define DBVER60 DBVERSION_70
90 #define DBTDS_UNKNOWN 0
111 #define BCPKEEPIDENTITY 8
122 typedef void DBCURSOR;
123 typedef void DBXLATE;
124 typedef void DBSORTORDER;
125 typedef void DBLOGINFO;
126 typedef void *DBVOIDPTR;
128 typedef unsigned short USHORT;
129 typedef int (*INTFUNCPTR) (
void *, ...);
130 typedef int (*DBWAITFUNC) (void);
131 typedef DBWAITFUNC(*DB_DBBUSY_FUNC) (
void *dbproc);
132 typedef void (*DB_DBIDLE_FUNC) (DBWAITFUNC dfunc,
void *dbproc);
133 typedef int (*DB_DBCHKINTR_FUNC) (
void *dbproc);
134 typedef int (*DB_DBHNDLINTR_FUNC) (
void *dbproc);
136 #ifndef __INCvxWorksh
148 #if !defined(_WINDEF_) && !defined(_WINDEF_H) && !defined(DOS32X)
159 #define SYBCHAR SYBCHAR
161 #define SYBVARCHAR SYBVARCHAR
163 #define SYBINTN SYBINTN
165 #define SYBINT1 SYBINT1
167 #define SYBINT2 SYBINT2
169 #define SYBINT4 SYBINT4
171 #define SYBINT8 SYBINT8
173 #define SYBFLT8 SYBFLT8
175 #define SYBDATETIME SYBDATETIME
177 #define SYBBIT SYBBIT
179 #define SYBBITN SYBBITN
181 #define SYBTEXT SYBTEXT
183 #define SYBNTEXT SYBNTEXT
185 #define SYBIMAGE SYBIMAGE
187 #define SYBMONEY4 SYBMONEY4
189 #define SYBMONEY SYBMONEY
191 #define SYBDATETIME4 SYBDATETIME4
193 #define SYBREAL SYBREAL
195 #define SYBBINARY SYBBINARY
197 #define SYBVOID SYBVOID
199 #define SYBVARBINARY SYBVARBINARY
201 #define SYBNUMERIC SYBNUMERIC
203 #define SYBDECIMAL SYBDECIMAL
205 #define SYBFLTN SYBFLTN
207 #define SYBMONEYN SYBMONEYN
209 #define SYBDATETIMN SYBDATETIMN
211 #define SYBNVARCHAR SYBNVARCHAR
214 #define SYBAOPCNT 0x4b
215 #define SYBAOPCNTU 0x4c
216 #define SYBAOPSUM 0x4d
217 #define SYBAOPSUMU 0x4e
218 #define SYBAOPAVG 0x4f
219 #define SYBAOPAVGU 0x50
220 #define SYBAOPMIN 0x51
221 #define SYBAOPMAX 0x52
224 #define SYBAOPCNT_BIG 0x09
225 #define SYBAOPSTDEV 0x30
226 #define SYBAOPSTDEVP 0x31
227 #define SYBAOPVAR 0x32
228 #define SYBAOPVARP 0x33
229 #define SYBAOPCHECKSUM_AGG 0x72
233 typedef unsigned char DBBOOL;
235 typedef unsigned char DBBIT;
236 typedef unsigned char DBTINYINT;
237 typedef tds_sysdep_int16_type DBSMALLINT;
238 typedef tds_sysdep_int32_type DBINT;
239 typedef tds_sysdep_int64_type DBBIGINT;
240 typedef unsigned char DBBINARY;
241 typedef tds_sysdep_real32_type DBREAL;
242 typedef tds_sysdep_real64_type DBFLT8;
243 typedef unsigned tds_sysdep_int16_type DBUSMALLINT;
254 unsigned char array[256];
259 unsigned char precision;
261 unsigned char array[33];
269 unsigned tds_sysdep_int32_type mnylow;
290 # define SQLCHAR SYBCHAR
301 typedef unsigned char BYTE;
320 { MAXCOLNAMELEN = 512 };
321 typedef enum { CI_REGULAR=1, CI_ALTERNATE=2, CI_CURSOR=3 } CI_TYPE;
326 DBCHAR Name[MAXCOLNAMELEN+2];
327 DBCHAR ActualName[MAXCOLNAMELEN+2];
328 DBCHAR TableName[MAXCOLNAMELEN+2];
345 DBCHAR Name[MAXCOLNAMELEN+2];
346 DBCHAR ActualName[MAXCOLNAMELEN+2];
347 DBCHAR TableName[MAXCOLNAMELEN+2];
359 DBINT ServerMaxLength;
360 DBCHAR ServerTypeDeclaration[256];
367 #define DBPARSEONLY 0
371 #define DBARITHIGNORE 4
373 #define DBARITHABORT 6
374 #define DBTEXTLIMIT 7
380 #define DBSTORPROCID 13
382 #define DBNOAUTOFREE 15
383 #define DBROWCOUNT 16
384 #define DBTEXTSIZE 17
386 #define DBDATEFORMAT 19
388 #define DBPRCOLSEP 21
389 #define DBPRLINELEN 22
390 #define DBPRLINESEP 23
391 #define DBLFCONVERT 24
392 #define DBDATEFIRST 25
393 #define DBCHAINXACTS 26
394 #define DBFIPSFLAG 27
395 #define DBISOLATION 28
397 #define DBIDENTITY 30
399 #define DBDATESHORT 32
400 #define DBCLIENTCURSORS 33
402 #define DBQUOTEDIDENT 35
404 #define DBNUMOPTIONS 36
412 #define NOSUCHOPTION 2
414 #define MAXOPTTEXT 32
464 typedef int (*EHANDLEFUNC) (
DBPROCESS * dbproc,
int severity,
int dberr,
int oserr,
char *dberrstr,
char *oserrstr);
466 typedef int (*MHANDLEFUNC) (
DBPROCESS * dbproc, DBINT msgno,
int msgstate,
int severity,
char *msgtext,
char *srvname,
467 char *proc,
int line);
471 #define DBNOTIFICATION 2
473 #define DBINTERRUPT 4
481 #define NTBSTRINGBIND 2
482 #define VARYCHARBIND 3
483 #define VARYBINBIND 4
489 #define DATETIMEBIND 11
490 #define SMALLDATETIMEBIND 12
492 #define SMALLMONEYBIND 14
493 #define BINARYBIND 15
495 #define NUMERICBIND 17
496 #define DECIMALBIND 18
497 #define SRCNUMERICBIND 19
498 #define SRCDECIMALBIND 20
499 #define BIGINTBIND 30
500 #define DATETIME2BIND 31
501 #define MAXBINDTYPES 32
503 #define DBPRCOLSEP 21
504 #define DBPRLINELEN 22
505 #define DBRPCRETURN 1
506 #define DBRPCDEFAULT 2
510 #define NO_MORE_ROWS -2
512 #define NO_MORE_RESULTS 2
518 #define DB_QUERYOUT 3
525 #define DBRPCRECOMPILE TDS_STATIC_CAST(DBSMALLINT, 0x0001)
526 #define DBRPCRESET TDS_STATIC_CAST(DBSMALLINT, 0x0002)
527 #define DBRPCCURSOR TDS_STATIC_CAST(DBSMALLINT, 0x0008)
529 #if defined(DBLIB_UNIMPLEMENTED)
530 DBBOOL db12hour(
DBPROCESS * dbprocess,
const char language[]);
532 DBBOOL dbcolbrowse(
DBPROCESS * dbprocess,
int colnum);
534 RETCODE dbcursor(DBCURSOR * hc, DBINT optype, DBINT bufno, BYTE * table, BYTE * values);
535 RETCODE dbcursorbind(DBCURSOR * hc,
int col,
int vartype, DBINT varlen, DBINT * poutlen, BYTE * pvaraddr,
DBTYPEINFO * typeinfo);
536 void dbcursorclose(DBCURSOR * hc);
537 RETCODE dbcursorcolinfo(DBCURSOR * hc, DBINT column, DBCHAR * colname, DBINT * coltype, DBINT * collen, DBINT * usertype);
538 RETCODE dbcursorfetch(DBCURSOR * hc, DBINT fetchtype, DBINT rownum);
539 RETCODE dbcursorinfo(DBCURSOR * hc, DBINT * ncols, DBINT * nrows);
540 DBCURSOR *dbcursoropen(
DBPROCESS * dbprocess, BYTE * stmt, SHORT scollopt, SHORT concuropt, USHORT nrows, DBINT * pstatus);
544 RETCODE dbdatechar(
DBPROCESS * dbprocess,
char *buf,
int datepart,
int value);
546 char *dateorder(
DBPROCESS * dbprocess,
char *language);
549 char *dbdayname(
DBPROCESS * dbprocess,
char *language,
int daynum);
551 int dbgetoff(
DBPROCESS * dbprocess, DBUSMALLINT offtype,
int startfrom);
553 char *dbqual(
DBPROCESS * dbprocess,
int tabnum,
char *tabname);
554 void dbfreequal(
char *qualptr);
556 DBSORTORDER *dbloadsort(
DBPROCESS * dbprocess);
557 RETCODE dbfreesort(
DBPROCESS * dbprocess, DBSORTORDER * sortorder);
559 RETCODE dbload_xlate(
DBPROCESS * dbprocess,
char *srv_charset,
char *clt_name, DBXLATE ** xlt_tosrv, DBXLATE ** xlt_todisp);
565 RETCODE dbmnydown(
DBPROCESS * dbproc,
DBMONEY * mnyptr,
int divisor,
int *remainder);
566 RETCODE dbmnyinit(
DBPROCESS * dbproc,
DBMONEY * mnyptr,
int trim, DBBOOL * negative);
567 RETCODE dbmnyndigit(
DBPROCESS * dbproc,
DBMONEY * mnyptr, DBCHAR * value, DBBOOL * zero);
569 RETCODE dbmnydigit(
DBPROCESS * dbprocess,
DBMONEY * m1, DBCHAR * value, DBBOOL * zero);
570 RETCODE dbmnyscale(
DBPROCESS * dbproc,
DBMONEY * dest,
int multiplier,
int addend);
573 RETCODE dbnpcreate(
DBPROCESS * dbprocess);
574 RETCODE dbnpdefine(
DBPROCESS * dbprocess, DBCHAR * procedure_name, DBSMALLINT namelen);
578 RETCODE dbpoll(
DBPROCESS * dbproc,
long milliseconds,
DBPROCESS ** ready_dbproc,
int *return_reason);
579 int dbordercol(
DBPROCESS * dbprocess,
int order);
581 RETCODE dbregdrop(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
582 RETCODE dbregexec(
DBPROCESS * dbproc, DBUSMALLINT options);
583 RETCODE dbreghandle(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, INTFUNCPTR handler);
584 RETCODE dbreginit(
DBPROCESS * dbproc, DBCHAR * procedure_name, DBSMALLINT namelen);
586 RETCODE dbregnowatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
587 RETCODE dbregparam(
DBPROCESS * dbproc,
char *param_name,
int type, DBINT datalen, BYTE * data);
588 RETCODE dbregwatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, DBUSMALLINT options);
589 RETCODE dbregwatchlist(
DBPROCESS * dbprocess);
592 RETCODE dbrpwset(
LOGINREC * login,
char *srvname,
char *password,
int pwlen);
594 DBINT dbreadpage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, BYTE * buf);
595 RETCODE dbwritepage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, DBINT size, BYTE * buf);
597 RETCODE dbsetdeflang(
char *language);
599 int dbstrcmp(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
600 int dbstrsort(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
602 DBBOOL dbtabbrowse(
DBPROCESS * dbprocess,
int tabnum);
604 char *dbtabname(
DBPROCESS * dbprocess,
int tabnum);
605 char *dbtabsource(
DBPROCESS * dbprocess,
int colnum,
int *tabnum);
607 RETCODE dbsetlshort(
LOGINREC * login,
int value,
int which);
609 RETCODE dbsendpassthru(
DBPROCESS * dbprocess, DBVOIDPTR bufp);
610 RETCODE dbrecvpassthru(
DBPROCESS * dbprocess, DBVOIDPTR * bufp);
612 RETCODE dbgetloginfo(
DBPROCESS * dbprocess, DBLOGINFO ** loginfo);
613 RETCODE dbsetloginfo(
LOGINREC * loginrec, DBLOGINFO * loginfo);
616 DBBINARY *dbtsnewval(
DBPROCESS * dbprocess);
617 RETCODE dbtsput(
DBPROCESS * dbprocess, DBBINARY * newts,
int newtslen,
int tabnum,
char *tabname);
619 RETCODE dbfree_xlate(
DBPROCESS * dbprocess, DBXLATE * xlt_tosrv, DBXLATE * clt_todisp);
620 int dbxlate(
DBPROCESS * dbprocess,
char *src,
int srclen,
char *dest,
int destlen, DBXLATE * xlt,
int *srcbytes_used,
621 DBBOOL srcend,
int status);
623 RETCODE bcp_moretext(
DBPROCESS * dbproc, DBINT size, BYTE * text);
624 RETCODE bcp_writefmt(
DBPROCESS * dbproc,
const char filename[]);
626 void build_xact_string(
char *xact_name,
char *service_name, DBINT commid,
char *result);
627 RETCODE remove_xact(
DBPROCESS * connect, DBINT commid,
int n);
628 RETCODE abort_xact(
DBPROCESS * connect, DBINT commid);
630 RETCODE commit_xact(
DBPROCESS * connect, DBINT commid);
632 RETCODE scan_xact(
DBPROCESS * connect, DBINT commid);
633 DBINT start_xact(
DBPROCESS * connect,
char *application_name,
char *xact_name,
int site_count);
634 DBINT stat_xact(
DBPROCESS * connect, DBINT commid);
640 RETCODE
dbaltbind(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
641 RETCODE dbaltbind_ps(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
649 RETCODE
dbbind(
DBPROCESS * dbproc,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
650 RETCODE dbbind_ps(
DBPROCESS * dbprocess,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
DBTYPEINFO * typeinfo);
656 DBBOOL dbcharsetconv(
DBPROCESS * dbprocess);
663 #define DBCMDROW(x) dbcmdrow((x))
672 DBINT
dbconvert(
DBPROCESS * dbproc,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen);
673 DBINT
dbconvert_ps(
DBPROCESS * dbprocess,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen,
678 #define DBCOUNT(x) dbcount((x))
681 #define DBCURCMD(x) dbcurcmd((x))
684 #define DBCURROW(x) dbcurrow((x))
691 #define DBDEAD(x) dbdead((x))
697 #define DBFIRSTROW(x) dbfirstrow((x))
700 char *dbgetcharset(
DBPROCESS * dbprocess);
701 int dbgetlusername(
LOGINREC * login, BYTE * name_buffer,
int buffer_len);
703 char *dbgetnatlanf(
DBPROCESS * dbprocess);
707 #define DBGETTIME dbgettime
713 #define DBIORDESC(x) dbiordesc((x))
716 #define DBIOWDESC(x) dbiowdesc((x))
719 #define DBISAVAIL(x) dbisavail((x))
723 #define DBLASTROW(x) dblastrow((x))
749 #define DBMORECMDS(x) dbmorecmds((x))
764 void dbpivot_count (
struct col_t *output,
const struct col_t *input);
765 void dbpivot_sum (
struct col_t *output,
const struct col_t *input);
766 void dbpivot_min (
struct col_t *output,
const struct col_t *input);
767 void dbpivot_max (
struct col_t *output,
const struct col_t *input);
770 typedef void (*DBPIVOT_FUNC)(
struct col_t *output,
const struct col_t *input);
773 RETCODE
dbpivot(
DBPROCESS *dbproc,
int nkeys,
int *keys,
int ncols,
int *cols, DBPIVOT_FUNC func,
int val);
775 DBPIVOT_FUNC dbpivot_lookup_name(
const char name[] );
778 #define dbopen(x,y) tdsdbopen((x),(y), 1)
780 #define dbopen(x,y) tdsdbopen((x),(y), 0)
784 #ifdef PHP_SYBASE_DBOPEN
785 #undef PHP_SYBASE_DBOPEN
786 #define PHP_SYBASE_DBOPEN dbopen
797 RETCODE dbresults_r(
DBPROCESS * dbproc,
int recursive);
805 #define DBROWS(x) dbrows((x))
808 #define DBROWTYPE(x) dbrowtype((x))
810 RETCODE
dbrpcparam(
DBPROCESS * dbproc,
const char paramname[], BYTE status,
int type, DBINT maxlen, DBINT datalen, BYTE * value);
812 RETCODE
dbsafestr(
DBPROCESS * dbproc,
const char *src, DBINT srclen,
char *dest, DBINT destlen,
int quotetype);
813 RETCODE *dbsechandle(DBINT type, INTFUNCPTR handler);
816 void dbsetbusy(
DBPROCESS * dbprocess, DB_DBBUSY_FUNC busyfunc);
817 RETCODE dbsetdefcharset(
char *charset);
818 void dbsetidle(
DBPROCESS * dbprocess, DB_DBIDLE_FUNC idlefunc);
824 RETCODE
dbsetopt(
DBPROCESS * dbproc,
int option,
const char *char_param,
int int_param);
838 int dbstrbuild(
DBPROCESS * dbproc,
char *charbuf,
int bufsize,
char *text,
char *formats, ...);
843 #define SYBEVERDOWN 100
844 #define SYBEICONVIU 2400
845 #define SYBEICONVAVAIL 2401
846 #define SYBEICONVO 2402
847 #define SYBEICONVI 2403
848 #define SYBEICONV2BIG 2404
851 #define SYBETDSVER 2410
852 #define SYBEPORT 2500
853 #define SYBESYNC 20001
854 #define SYBEFCON 20002
855 #define SYBETIME 20003
856 #define SYBEREAD 20004
857 #define SYBEBUFL 20005
858 #define SYBEWRIT 20006
859 #define SYBEVMS 20007
860 #define SYBESOCK 20008
861 #define SYBECONN 20009
862 #define SYBEMEM 20010
863 #define SYBEDBPS 20011
864 #define SYBEINTF 20012
865 #define SYBEUHST 20013
866 #define SYBEPWD 20014
867 #define SYBEOPIN 20015
868 #define SYBEINLN 20016
869 #define SYBESEOF 20017
870 #define SYBESMSG 20018
871 #define SYBERPND 20019
872 #define SYBEBTOK 20020
873 #define SYBEITIM 20021
874 #define SYBEOOB 20022
875 #define SYBEBTYP 20023
876 #define SYBEBNCR 20024
877 #define SYBEIICL 20025
878 #define SYBECNOR 20026
879 #define SYBENPRM 20027
880 #define SYBEUVDT 20028
881 #define SYBEUFDT 20029
882 #define SYBEWAID 20030
883 #define SYBECDNS 20031
884 #define SYBEABNC 20032
885 #define SYBEABMT 20033
886 #define SYBEABNP 20034
887 #define SYBEAAMT 20035
888 #define SYBENXID 20036
889 #define SYBERXID 20037
890 #define SYBEICN 20038
891 #define SYBENMOB 20039
892 #define SYBEAPUT 20040
893 #define SYBEASNL 20041
894 #define SYBENTLL 20042
895 #define SYBEASUL 20043
896 #define SYBERDNR 20044
897 #define SYBENSIP 20045
898 #define SYBEABNV 20046
899 #define SYBEDDNE 20047
900 #define SYBECUFL 20048
901 #define SYBECOFL 20049
902 #define SYBECSYN 20050
903 #define SYBECLPR 20051
904 #define SYBECNOV 20052
905 #define SYBERDCN 20053
906 #define SYBESFOV 20054
907 #define SYBEUNT 20055
908 #define SYBECLOS 20056
909 #define SYBEUAVE 20057
910 #define SYBEUSCT 20058
911 #define SYBEEQVA 20059
912 #define SYBEUDTY 20060
913 #define SYBETSIT 20061
914 #define SYBEAUTN 20062
915 #define SYBEBDIO 20063
916 #define SYBEBCNT 20064
917 #define SYBEIFNB 20065
918 #define SYBETTS 20066
919 #define SYBEKBCO 20067
920 #define SYBEBBCI 20068
921 #define SYBEKBCI 20069
922 #define SYBEBCRE 20070
923 #define SYBETPTN 20071
924 #define SYBEBCWE 20072
925 #define SYBEBCNN 20073
926 #define SYBEBCOR 20074
927 #define SYBEBCIS 20075
928 #define SYBEBCPI 20076
929 #define SYBEBCPN 20077
930 #define SYBEBCPB 20078
931 #define SYBEVDPT 20079
932 #define SYBEBIVI 20080
933 #define SYBEBCBC 20081
934 #define SYBEBCFO 20082
935 #define SYBEBCVH 20083
936 #define SYBEBCUO 20084
937 #define SYBEBCUC 20085
938 #define SYBEBUOE 20086
939 #define SYBEBUCE 20087
940 #define SYBEBWEF 20088
941 #define SYBEASTF 20089
942 #define SYBEUACS 20090
943 #define SYBEASEC 20091
944 #define SYBETMTD 20092
945 #define SYBENTTN 20093
946 #define SYBEDNTI 20094
947 #define SYBEBTMT 20095
948 #define SYBEORPF 20096
949 #define SYBEUVBF 20097
950 #define SYBEBUOF 20098
951 #define SYBEBUCF 20099
952 #define SYBEBRFF 20100
953 #define SYBEBWFF 20101
954 #define SYBEBUDF 20102
955 #define SYBEBIHC 20103
956 #define SYBEBEOF 20104
957 #define SYBEBCNL 20105
958 #define SYBEBCSI 20106
959 #define SYBEBCIT 20107
960 #define SYBEBCSA 20108
961 #define SYBENULL 20109
962 #define SYBEUNAM 20110
963 #define SYBEBCRO 20111
964 #define SYBEMPLL 20112
965 #define SYBERPIL 20113
966 #define SYBERPUL 20114
967 #define SYBEUNOP 20115
968 #define SYBECRNC 20116
969 #define SYBERTCC 20117
970 #define SYBERTSC 20118
971 #define SYBEUCRR 20119
972 #define SYBERPNA 20120
973 #define SYBEOPNA 20121
974 #define SYBEFGTL 20122
975 #define SYBECWLL 20123
976 #define SYBEUFDS 20124
977 #define SYBEUCPT 20125
978 #define SYBETMCF 20126
979 #define SYBEAICF 20127
980 #define SYBEADST 20128
981 #define SYBEALTT 20129
982 #define SYBEAPCT 20130
983 #define SYBEXOCI 20131
984 #define SYBEFSHD 20132
985 #define SYBEAOLF 20133
986 #define SYBEARDI 20134
987 #define SYBEURCI 20135
988 #define SYBEARDL 20136
989 #define SYBEURMI 20137
990 #define SYBEUREM 20138
991 #define SYBEURES 20139
992 #define SYBEUREI 20140
993 #define SYBEOREN 20141
994 #define SYBEISOI 20142
995 #define SYBEIDCL 20143
996 #define SYBEIMCL 20144
997 #define SYBEIFCL 20145
998 #define SYBEUTDS 20146
999 #define SYBEBUFF 20147
1000 #define SYBEACNV 20148
1001 #define SYBEDPOR 20149
1002 #define SYBENDC 20150
1003 #define SYBEMVOR 20151
1004 #define SYBEDVOR 20152
1005 #define SYBENBVP 20153
1006 #define SYBESPID 20154
1007 #define SYBENDTP 20155
1008 #define SYBEXTN 20156
1009 #define SYBEXTDN 20157
1010 #define SYBEXTSN 20158
1011 #define SYBENUM 20159
1012 #define SYBETYPE 20160
1013 #define SYBEGENOS 20161
1014 #define SYBEPAGE 20162
1015 #define SYBEOPTNO 20163
1016 #define SYBEETD 20164
1017 #define SYBERTYPE 20165
1018 #define SYBERFILE 20166
1019 #define SYBEFMODE 20167
1020 #define SYBESLCT 20168
1021 #define SYBEZTXT 20169
1022 #define SYBENTST 20170
1023 #define SYBEOSSL 20171
1024 #define SYBEESSL 20172
1025 #define SYBENLNL 20173
1026 #define SYBENHAN 20174
1027 #define SYBENBUF 20175
1028 #define SYBENULP 20176
1029 #define SYBENOTI 20177
1030 #define SYBEEVOP 20178
1031 #define SYBENEHA 20179
1032 #define SYBETRAN 20180
1033 #define SYBEEVST 20181
1034 #define SYBEEINI 20182
1035 #define SYBEECRT 20183
1036 #define SYBEECAN 20184
1037 #define SYBEEUNR 20185
1038 #define SYBERPCS 20186
1039 #define SYBETPAR 20187
1040 #define SYBETEXS 20188
1041 #define SYBETRAC 20189
1042 #define SYBETRAS 20190
1043 #define SYBEPRTF 20191
1044 #define SYBETRSN 20192
1045 #define SYBEBPKS 20193
1046 #define SYBEIPV 20194
1047 #define SYBEMOV 20195
1048 #define SYBEDIVZ 20196
1049 #define SYBEASTL 20197
1050 #define SYBESEFA 20198
1051 #define SYBEPOLL 20199
1052 #define SYBENOEV 20200
1053 #define SYBEBADPK 20201
1054 #define SYBESECURE 20202
1055 #define SYBECAP 20203
1056 #define SYBEFUNC 20204
1057 #define SYBERESP 20205
1058 #define SYBEIVERS 20206
1059 #define SYBEONCE 20207
1060 #define SYBERPNULL 20208
1061 #define SYBERPTXTIM 20209
1062 #define SYBENEG 20210
1063 #define SYBELBLEN 20211
1064 #define SYBEUMSG 20212
1065 #define SYBECAPTYP 20213
1066 #define SYBEBNUM 20214
1067 #define SYBEBBL 20215
1068 #define SYBEBPREC 20216
1069 #define SYBEBSCALE 20217
1070 #define SYBECDOMAIN 20218
1071 #define SYBECINTERNAL 20219
1072 #define SYBEBTYPSRV 20220
1073 #define SYBEBCSET 20221
1074 #define SYBEFENC 20222
1075 #define SYBEFRES 20223
1076 #define SYBEISRVPREC 20224
1077 #define SYBEISRVSCL 20225
1078 #define SYBEINUMCL 20226
1079 #define SYBEIDECCL 20227
1080 #define SYBEBCMTXT 20228
1081 #define SYBEBCPREC 20229
1082 #define SYBEBCBNPR 20230
1083 #define SYBEBCBNTYP 20231
1084 #define SYBEBCSNTYP 20232
1085 #define SYBEBCPCTYP 20233
1086 #define SYBEBCVLEN 20234
1087 #define SYBEBCHLEN 20235
1088 #define SYBEBCBPREF 20236
1089 #define SYBEBCPREF 20237
1090 #define SYBEBCITBNM 20238
1091 #define SYBEBCITBLEN 20239
1092 #define SYBEBCSNDROW 20240
1093 #define SYBEBPROCOL 20241
1094 #define SYBEBPRODEF 20242
1095 #define SYBEBPRONUMDEF 20243
1096 #define SYBEBPRODEFID 20244
1097 #define SYBEBPRONODEF 20245
1098 #define SYBEBPRODEFTYP 20246
1099 #define SYBEBPROEXTDEF 20247
1100 #define SYBEBPROEXTRES 20248
1101 #define SYBEBPROBADDEF 20249
1102 #define SYBEBPROBADTYP 20250
1103 #define SYBEBPROBADLEN 20251
1104 #define SYBEBPROBADPREC 20252
1105 #define SYBEBPROBADSCL 20253
1106 #define SYBEBADTYPE 20254
1107 #define SYBECRSNORES 20255
1108 #define SYBECRSNOIND 20256
1109 #define SYBECRSVIEW 20257
1110 #define SYBECRSVIIND 20258
1111 #define SYBECRSORD 20259
1112 #define SYBECRSBUFR 20260
1113 #define SYBECRSNOFREE 20261
1114 #define SYBECRSDIS 20262
1115 #define SYBECRSAGR 20263
1116 #define SYBECRSFRAND 20264
1117 #define SYBECRSFLAST 20265
1118 #define SYBECRSBROL 20266
1119 #define SYBECRSFROWN 20267
1120 #define SYBECRSBSKEY 20268
1121 #define SYBECRSRO 20269
1122 #define SYBECRSNOCOUNT 20270
1123 #define SYBECRSTAB 20271
1124 #define SYBECRSUPDNB 20272
1125 #define SYBECRSNOWHERE 20273
1126 #define SYBECRSSET 20274
1127 #define SYBECRSUPDTAB 20275
1128 #define SYBECRSNOUPD 20276
1129 #define SYBECRSINV 20277
1130 #define SYBECRSNOKEYS 20278
1131 #define SYBECRSNOBIND 20279
1132 #define SYBECRSFTYPE 20280
1133 #define SYBECRSINVALID 20281
1134 #define SYBECRSMROWS 20282
1135 #define SYBECRSNROWS 20283
1136 #define SYBECRSNOLEN 20284
1137 #define SYBECRSNOPTCC 20285
1138 #define SYBECRSNORDER 20286
1139 #define SYBECRSNOTABLE 20287
1140 #define SYBECRSNUNIQUE 20288
1141 #define SYBECRSVAR 20289
1142 #define SYBENOVALUE 20290
1143 #define SYBEVOIDRET 20291
1144 #define SYBECLOSEIN 20292
1145 #define SYBEBOOL 20293
1146 #define SYBEBCPOPT 20294
1147 #define SYBEERRLABEL 20295
1148 #define SYBEATTNACK 20296
1149 #define SYBEBBFL 20297
1150 #define SYBEDCL 20298
1151 #define SYBECS 20299
1152 #define SYBEBULKINSERT 20599
1153 #define SYBECOLSIZE 22000
1157 #define DBTDS(a) dbtds(a)
1158 DBINT dbtextsize(
DBPROCESS * dbprocess);
1161 DBBINARY *dbtxtsnewval(
DBPROCESS * dbprocess);
1162 RETCODE dbtxtsput(
DBPROCESS * dbprocess, DBBINARY newtxts,
int colnum);
1166 RETCODE
dbwritetext(
DBPROCESS * dbproc,
char *objname, DBBINARY * textptr, DBTINYINT textptrlen, DBBINARY * timestamp,
1167 DBBOOL log, DBINT size, BYTE * text);
1176 #define DBSETLHOST(x,y) dbsetlname((x), (y), DBSETHOST)
1177 #define dbsetlhost(x,y) dbsetlname((x), (y), DBSETHOST)
1179 #define DBSETLUSER(x,y) dbsetlname((x), (y), DBSETUSER)
1180 #define dbsetluser(x,y) dbsetlname((x), (y), DBSETUSER)
1182 #define DBSETLPWD(x,y) dbsetlname((x), (y), DBSETPWD)
1183 #define dbsetlpwd(x,y) dbsetlname((x), (y), DBSETPWD)
1184 #if defined(DBLIB_UNIMPLEMENTED)
1186 # define DBSETLHID(x,y) dbsetlname((x), (y), DBSETHID)
1189 #define DBSETLAPP(x,y) dbsetlname((x), (y), DBSETAPP)
1190 #define dbsetlapp(x,y) dbsetlname((x), (y), DBSETAPP)
1192 #define BCP_SETL(x,y) dbsetlbool((x), (y), DBSETBCP)
1193 #define DBSETLSECURE(x) dbsetlbool((x), (1), DBSETBCP)
1194 #define DBSETNATLANG 7
1195 #define DBSETLNATLANG(x,y) dbsetlname((x), (y), DBSETNATLANG)
1196 #define dbsetlnatlang(x,y) dbsetlname((x), (y), DBSETNATLANG)
1197 #if defined(DBLIB_UNIMPLEMENTED)
1198 # define DBSETNOSHORT 8
1199 # define DBSETLNOSHORT(x,y) dbsetlbool((x), (y), DBSETNOSHORT)
1200 # define DBSETHIER 9
1201 # define DBSETLHIER(x,y) dbsetlshort((x), (y), DBSETHIER)
1203 #define DBSETCHARSET 10
1204 #define DBSETLCHARSET(x,y) dbsetlname((x), (y), DBSETCHARSET)
1205 #define DBSETPACKET 11
1206 #define DBSETLPACKET(x,y) dbsetllong((x), (y), DBSETPACKET)
1207 #define dbsetlpacket(x,y) dbsetllong((x), (y), DBSETPACKET)
1208 #define DBSETENCRYPT 12
1209 #define DBSETLENCRYPT(x,y) dbsetlbool((x), (y), DBSETENCRYPT)
1210 #define DBSETLABELED 13
1211 #define DBSETLLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1212 #define BCP_SETLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1213 #define DBSETDBNAME 14
1214 #define DBSETLDBNAME(x,y) dbsetlname((x), (y), DBSETDBNAME)
1215 #define DBSETLVERSION(login, version) dbsetlversion((login), (version))
1217 RETCODE
bcp_init(
DBPROCESS * dbproc,
const char *tblname,
const char *hfile,
const char *errfile,
int direction);
1221 RETCODE
bcp_bind(
DBPROCESS * dbproc, BYTE * varaddr,
int prefixlen, DBINT varlen, BYTE * terminator,
int termlen,
int type,
1225 RETCODE
bcp_colfmt(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1226 const BYTE * host_term,
int host_termlen,
int colnum);
1227 RETCODE
bcp_colfmt_ps(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1228 BYTE * host_term,
int host_termlen,
int colnum,
DBTYPEINFO * typeinfo);
1231 int bcp_getbatchsize(
DBPROCESS * dbproc);
RETCODE dbbind(DBPROCESS *dbproc, int column, int vartype, DBINT varlen, BYTE *varaddr)
Tie a host variable to a resultset column.
Definition: dblib.c:2580
DBINT dbretstatus(DBPROCESS *dbproc)
Fetch status value returned by query or remote procedure call.
Definition: dblib.c:4476
int dbnumalts(DBPROCESS *dbproc, int computeid)
Get count of columns in a compute row.
Definition: dblib.c:4745
RETCODE dbcancel(DBPROCESS *dbproc)
Cancel the current command batch.
Definition: dblib.c:3199
void dbexit(void)
Close server connections and free all related structures.
Definition: dblib.c:1527
RETCODE dbmny4sub(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *diff)
Subtract two DBMONEY4 values.
Definition: dblib.c:5429
DBBOOL dbhasretstat(DBPROCESS *dbproc)
Determine if query generated a return status number.
Definition: dblib.c:4452
RETCODE dbsetlogintime(int seconds)
Set maximum seconds db-lib waits for a server response to a login attempt.
Definition: dblib.c:4046
DBBINARY * dbtxtimestamp(DBPROCESS *dbproc, int column)
Get text timestamp for a column in the current row.
Definition: dblib.c:6295
RETCODE bcp_readfmt(DBPROCESS *dbproc, const char filename[])
Read a format definition file.
Definition: bcp.c:1614
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition: dblib.c:2837
DBINT dbcollen(DBPROCESS *dbproc, int column)
Get size of a regular result column.
Definition: dblib.c:3040
DBBOOL bcp_getl(LOGINREC *login)
See if BCP_SETL() was used to set the LOGINREC for BCP work.
Definition: bcp.c:693
RETCODE dbrpcsend(DBPROCESS *dbproc)
Execute the procedure and free associated memory.
Definition: rpc.c:278
RETCODE dbmnymaxpos(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum positive DBMONEY value supported.
Definition: dblib.c:5150
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
Definition: dblib.c:1336
BOOL dbiscount(DBPROCESS *dbproc)
Indicates whether or not the count returned by dbcount is real (Microsoft-compatibility feature)...
Definition: dblib.c:2750
RETCODE dbmnyinc(DBPROCESS *dbproc, DBMONEY *mnyptr)
Add $0.0001 to a DBMONEY value.
Definition: dblib.c:5268
char * dbgetchar(DBPROCESS *dbprocess, int n)
Get address of a position in the command buffer.
Definition: dblib.c:6078
RETCODE dbsetlname(LOGINREC *login, const char *value, int which)
Set the value of a string in a LOGINREC structure.
Definition: dblib.c:763
void dbprhead(DBPROCESS *dbproc)
Print result set headings to stdout.
Definition: dblib.c:3768
RETCODE dbcmdrow(DBPROCESS *dbproc)
See if the current command can return rows.
Definition: dblib.c:4067
RETCODE dbinit(void)
Initialize db-lib.
Definition: dblib.c:668
int dbgetpacket(DBPROCESS *dbproc)
Get TDS packet size for the connection.
Definition: dblib.c:3884
RETCODE dbsetmaxprocs(int maxprocs)
Set maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3908
RETCODE dbsetversion(DBINT version)
Specify a db-lib version level.
Definition: dblib.c:5759
DBBOOL dbwillconvert(int srctype, int desttype)
Test whether or not a datatype can be converted to another datatype.
Definition: dblib.c:2820
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition: dblib.c:4945
DBINT dbaltlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in compute column.
Definition: dblib.c:6904
void dbfreebuf(DBPROCESS *dbproc)
Erase the command buffer, in case DBNOAUTOFREE was set with dbsetopt().
Definition: dblib.c:5843
int dbnumcols(DBPROCESS *dbproc)
Return number of regular columns in a result set.
Definition: dblib.c:1825
void dbloginfree(LOGINREC *login)
free the LOGINREC
Definition: dblib.c:741
DBINT dbconvert(DBPROCESS *dbproc, int srctype, const BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen)
Convert one datatype to another.
Definition: dblib.c:2229
RETCODE dbsprhead(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print result set headings to a buffer.
Definition: dblib.c:3705
RETCODE dbmny4copy(DBPROCESS *dbprocess, DBMONEY4 *m1, DBMONEY4 *m2)
Copy a DBMONEY4 value.
Definition: dblib.c:5545
BYTE * dbretdata(DBPROCESS *dbproc, int retnum)
Get value of an output parameter filled by a stored procedure.
Definition: dblib.c:4555
RETCODE dbdatecrack(DBPROCESS *dbproc, DBDATEREC *di, DBDATETIME *dt)
Break a DBDATETIME value into useful pieces.
Definition: dblib.c:5615
void dbrecftos(const char filename[])
Record to a file all SQL commands sent to the server.
Definition: dblib.c:6535
DBINT dbadlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in a compute column.
Definition: dblib.c:4118
int dbstrlen(DBPROCESS *dbproc)
Get size of the command buffer, in bytes.
Definition: dblib.c:6059
STATUS dbrowtype(DBPROCESS *dbprocess)
Get returned row's type.
Definition: dblib.c:5969
DBBOOL dbdead(DBPROCESS *dbproc)
Check if dbproc is an ex-parrot.
Definition: dblib.c:4863
BYTE * dbadata(DBPROCESS *dbproc, int computeid, int column)
Get address of compute column data.
Definition: dblib.c:4231
BYTE * dbdata(DBPROCESS *dbproc, int column)
Get address of data in a regular result column.
Definition: dblib.c:3166
int dbiordesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to read data coming from the server...
Definition: dblib.c:6998
DBINT dbcount(DBPROCESS *dbproc)
Get count of rows processed.
Definition: dblib.c:2770
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Definition: dblib.c:6773
RETCODE dbfcmd(DBPROCESS *dbproc, const char *fmt,...)
printf-like way to form SQL to send to the server.
Definition: dblib.c:1297
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:263
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:905
RETCODE dbmny4minus(DBPROCESS *dbproc, DBMONEY4 *src, DBMONEY4 *dest)
Negate a DBMONEY4 value.
Definition: dblib.c:5351
RETCODE bcp_exec(DBPROCESS *dbproc, DBINT *rows_copied)
Write a datafile to a table.
Definition: bcp.c:1553
int dbmny4cmp(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2)
Compare two DBMONEY4 values.
Definition: dblib.c:5517
DBINT dbaltutype(DBPROCESS *dbproc, int computeid, int column)
Get user-defined datatype of a compute column.
Definition: dblib.c:6880
DBINT dbprcollen(DBPROCESS *dbproc, int column)
Get size of a result column needed to print column.
Definition: dblib.c:3063
STATUS dbreadtext(DBPROCESS *dbproc, void *buf, DBINT bufsize)
Fetch part of a text or image value from the server.
Definition: dblib.c:6431
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition: bcp.c:535
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition: dblib.c:1676
RETCODE dbsetlbool(LOGINREC *login, int value, int which)
Set a boolean value in a LOGINREC structure.
Definition: dblib.c:897
RETCODE dbnullbind(DBPROCESS *dbproc, int column, DBINT *indicator)
Tie a null-indicator to a regular result column.
Definition: dblib.c:2686
RETCODE dbmnyminus(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Negate a DBMONEY value.
Definition: dblib.c:5324
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition: dblib.c:713
int dbtds(DBPROCESS *dbprocess)
Get the TDS version in use for dbproc.
Definition: dblib.c:6569
const char * dbversion(void)
See which version of db-lib is in use.
Definition: dblib.c:6606
int dbgetmaxprocs(void)
get maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3982
RETCODE dbrows(DBPROCESS *dbproc)
Indicate whether a query returned rows.
Definition: dblib.c:3843
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:7067
RETCODE dbsettime(int seconds)
Set maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4003
RETCODE dbsetopt(DBPROCESS *dbproc, int option, const char *char_param, int int_param)
Set db-lib or server option.
Definition: dblib.c:4289
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:6233
RETCODE dbsetnull(DBPROCESS *dbprocess, int bindtype, int bindlen, BYTE *bindval)
Define substitution values to be used when binding null values.
Definition: dblib.c:1913
RETCODE dbmorecmds(DBPROCESS *dbproc)
See if more commands are to be processed.
Definition: dblib.c:6003
RETCODE dbrpcinit(DBPROCESS *dbproc, const char rpcname[], DBSMALLINT options)
Initialize a remote procedure call.
Definition: rpc.c:74
RETCODE dbgetrow(DBPROCESS *dbproc, DBINT row)
Read a row from the row buffer.
Definition: dblib.c:1881
int dbnumrets(DBPROCESS *dbproc)
Get count of output parameters filled by a stored procedure.
Definition: dblib.c:4494
RETCODE dbclropt(DBPROCESS *dbproc, int option, const char param[])
Reset an option.
Definition: dblib.c:5877
RETCODE bcp_sendrow(DBPROCESS *dbproc)
Write data in host variables to the table.
Definition: bcp.c:1326
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:6362
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:6155
char * dbservcharset(DBPROCESS *dbprocess)
Get syscharset name of the server character set.
Definition: dblib.c:6789
void dbsetifile(char *filename)
set name and location of the interfaces file FreeTDS should use to look up a servername.
Definition: dblib.c:2657
DBINT dbfirstrow(DBPROCESS *dbproc)
See if a server response has arrived.
Definition: dblib.c:6959
int dbrettype(DBPROCESS *dbproc, int retnum)
Get datatype of a stored procedure's return parameter.
Definition: dblib.c:6034
RETCODE dbmnycopy(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Copy a DBMONEY value.
Definition: dblib.c:5792
char * dbcolsource(DBPROCESS *dbproc, int colnum)
Get base database column name for a result set column.
Definition: dblib.c:3015
DBINT dblastrow(DBPROCESS *dbproc)
Get number of the last row in the row buffer.
Definition: dblib.c:6974
RETCODE bcp_columns(DBPROCESS *dbproc, int host_colcount)
Indicate how many columns are to be found in the datafile.
Definition: bcp.c:298
DBINT dbcolutype(DBPROCESS *dbprocess, int column)
Get user-defined datatype of a regular result column.
Definition: dblib.c:2866
int dbspid(DBPROCESS *dbproc)
Get server process ID for a DBPROCESS.
Definition: dblib.c:5697
RETCODE dbmoretext(DBPROCESS *dbproc, DBINT size, const BYTE text[])
Send chunk of a text/image value to the server.
Definition: dblib.c:6500
RETCODE dbmny4zero(DBPROCESS *dbproc, DBMONEY4 *dest)
Zero a DBMONEY4 value.
Definition: dblib.c:5375
DBPROCESS * dbopen(LOGINREC *login, const char *server)
Normally not used.
Definition: dbopen.c:37
DBINT bcp_done(DBPROCESS *dbproc)
Conclude the transfer of data from program variables.
Definition: bcp.c:1966
void dbsetuserdata(DBPROCESS *dbproc, BYTE *ptr)
Associate client-allocated (and defined) data with a DBPROCESS.
Definition: dblib.c:5723
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition: dblib.c:4926
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:500
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition: dblib.c:1388
RETCODE dbstrcpy(DBPROCESS *dbproc, int start, int numbytes, char *dest)
Get a copy of a chunk of the command buffer.
Definition: dblib.c:6111
const char * dbprtype(int token)
Print a token value's name to a buffer.
Definition: dblib.c:6216
RETCODE dbprrow(DBPROCESS *dbproc)
Print a result set to stdout.
Definition: dblib.c:3344
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:163
DBTYPEINFO * dbcoltypeinfo(DBPROCESS *dbproc, int column)
Get precision and scale information for a regular result column.
Definition: dblib.c:2889
int dbmnycmp(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2)
Compare two DBMONEY values.
Definition: dblib.c:5071
int dbaltcolid(DBPROCESS *dbproc, int computeid, int column)
Get column ID of a compute column.
Definition: dblib.c:4091
RETCODE dbsetlversion(LOGINREC *login, BYTE version)
Set TDS version for future connections.
Definition: dblib.c:926
RETCODE bcp_colptr(DBPROCESS *dbproc, BYTE *colptr, int table_column)
Override bcp_bind() by pointing to a different host variable.
Definition: bcp.c:657
RETCODE dbspr1row(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print a regular result row to a buffer.
Definition: dblib.c:3262
char * dbretname(DBPROCESS *dbproc, int retnum)
Get name of an output parameter filled by a stored procedure.
Definition: dblib.c:4526
RETCODE dbsprline(DBPROCESS *dbproc, char *buffer, DBINT buf_len, DBCHAR line_char)
Get formatted string for underlining dbsprhead() column names.
Definition: dblib.c:3647
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:4433
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:4185
DBINT dbdatlen(DBPROCESS *dbproc, int column)
Get size of current row's data in a regular result column.
Definition: dblib.c:3138
DBPROCESS * tdsdbopen(LOGINREC *login, const char *server, int msdblib)
Form a connection with the server.
Definition: dblib.c:1152
DBINT dbcurrow(DBPROCESS *dbproc)
Get number of the row currently being read.
Definition: dblib.c:5952
BYTE * dbbylist(DBPROCESS *dbproc, int computeid, int *size)
Get bylist for a compute row.
Definition: dblib.c:4804
Definition: dbpivot.c:761
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:2918
DBBOOL dbisopt(DBPROCESS *dbproc, int option, const char param[])
Get value of an option.
Definition: dblib.c:5929
DBINT bcp_batch(DBPROCESS *dbproc)
Commit a set of rows to the table.
Definition: bcp.c:1939
int dbaltop(DBPROCESS *dbproc, int computeid, int column)
Get aggregation operator for a compute column.
Definition: dblib.c:4261
DBINT dbconvert_ps(DBPROCESS *dbprocess, int srctype, const BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen, DBTYPEINFO *typeinfo)
cf.
Definition: dblib.c:2539
Definition: bsqlodbc.c:97
RETCODE dbsqlok(DBPROCESS *dbproc)
Wait for results of a query from the server.
Definition: dblib.c:4619
DBINT dbvarylen(DBPROCESS *dbproc, int column)
Determine whether a column can vary in size.
Definition: dblib.c:3089
char * dbcolname(DBPROCESS *dbproc, int column)
Return name of a regular result column.
Definition: dblib.c:1849
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:157
void dbclrbuf(DBPROCESS *dbproc, DBINT n)
Clear n rows from the row buffer.
Definition: dblib.c:2790
int dbnumcompute(DBPROCESS *dbprocess)
Get count of COMPUTE clauses for a result set.
Definition: dblib.c:4778
RETCODE bcp_options(DBPROCESS *dbproc, int option, BYTE *value, int valuelen)
Set "hints" for uploading a file.
Definition: bcp.c:609
RETCODE dbanullbind(DBPROCESS *dbprocess, int computeid, int column, DBINT *indicator)
Tie a null-indicator to a compute result column.
Definition: dblib.c:2722
char * dbchange(DBPROCESS *dbprocess)
See if a command caused the current database to change.
Definition: dblib.c:6753
BYTE * dbgetuserdata(DBPROCESS *dbproc)
Get address of user-allocated data from a DBPROCESS.
Definition: dblib.c:5741
RETCODE dbmnyzero(DBPROCESS *dbproc, DBMONEY *dest)
Set a DBMONEY value to zero.
Definition: dblib.c:5129
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:374
RETCODE dbsqlsend(DBPROCESS *dbproc)
Transmit the command buffer to the server.
Definition: dblib.c:6809
STATUS dbsetrow(DBPROCESS *dbprocess, DBINT row)
Make a buffered row "current" without fetching it into bound variables.
Definition: dblib.c:1992
RETCODE dbuse(DBPROCESS *dbproc, const char *name)
Change current database.
Definition: dblib.c:1414
RETCODE dbmnymaxneg(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum negative DBMONEY value supported.
Definition: dblib.c:5171
int dbalttype(DBPROCESS *dbproc, int computeid, int column)
Get datatype for a compute column.
Definition: dblib.c:4149
int dbcurcmd(DBPROCESS *dbproc)
Get number of the row just returned.
Definition: dblib.c:5986
int dbretlen(DBPROCESS *dbproc, int retnum)
Get size of an output parameter filled by a stored procedure.
Definition: dblib.c:4584
RETCODE dbmnydec(DBPROCESS *dbproc, DBMONEY *mnyptr)
Subtract $0.0001 from a DBMONEY value.
Definition: dblib.c:5296
int dbgettime(void)
Get maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4030
RETCODE dbsetllong(LOGINREC *login, long value, int which)
Set an integer value in a LOGINREC structure.
Definition: dblib.c:826
void dbsetavail(DBPROCESS *dbprocess)
Mark a DBPROCESS as "available".
Definition: dblib.c:7042
RETCODE dbmny4add(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *sum)
Add two DBMONEY4 values.
Definition: dblib.c:5398
DBINT dbspr1rowlen(DBPROCESS *dbproc)
Determine size buffer required to hold the results returned by dbsprhead(), dbsprline(), and dbspr1row().
Definition: dblib.c:3224
int dbdatecmp(DBPROCESS *dbproc, DBDATETIME *d1, DBDATETIME *d2)
Compare DBDATETIME values, similar to strcmp(3).
Definition: dblib.c:5570
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:2008
RETCODE dbcanquery(DBPROCESS *dbproc)
Cancel the query currently being retrieved, discarding all pending rows.
Definition: dblib.c:5813
int dbiowdesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to write data coming to the server...
Definition: dblib.c:7014
void dbclose(DBPROCESS *dbproc)
Close a connection to the server and free associated resources.
Definition: dblib.c:1457
DBBINARY * dbtxptr(DBPROCESS *dbproc, int column)
Get text pointer for a column in the current row.
Definition: dblib.c:6325
const char * dbmonthname(DBPROCESS *dbproc, char *language, int monthnum, DBBOOL shortform)
Get name of a month, in some human language.
Definition: dblib.c:6724