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_72 6
79 #define DBVERSION_73 7
80 #define DBVERSION_74 8
83 #define DBVER42 DBVERSION_42
84 #define DBVER60 DBVERSION_70
90 #define DBTDS_UNKNOWN 0
112 #define BCPKEEPIDENTITY 8
123 typedef void DBCURSOR;
124 typedef void DBXLATE;
125 typedef void DBSORTORDER;
126 typedef void DBLOGINFO;
127 typedef void *DBVOIDPTR;
129 typedef unsigned short USHORT;
130 typedef int (*INTFUNCPTR) (
void *, ...);
131 typedef int (*DBWAITFUNC) (void);
132 typedef DBWAITFUNC(*DB_DBBUSY_FUNC) (
void *dbproc);
133 typedef void (*DB_DBIDLE_FUNC) (DBWAITFUNC dfunc,
void *dbproc);
134 typedef int (*DB_DBCHKINTR_FUNC) (
void *dbproc);
135 typedef int (*DB_DBHNDLINTR_FUNC) (
void *dbproc);
137 #ifndef __INCvxWorksh
149 #if !defined(_WINDEF_) && !defined(_WINDEF_H) && !defined(DOS32X)
160 #define SYBCHAR SYBCHAR
162 #define SYBVARCHAR SYBVARCHAR
164 #define SYBINTN SYBINTN
166 #define SYBINT1 SYBINT1
168 #define SYBINT2 SYBINT2
170 #define SYBINT4 SYBINT4
172 #define SYBINT8 SYBINT8
174 #define SYBFLT8 SYBFLT8
176 #define SYBDATETIME SYBDATETIME
178 #define SYBBIT SYBBIT
180 #define SYBBITN SYBBITN
182 #define SYBTEXT SYBTEXT
184 #define SYBNTEXT SYBNTEXT
186 #define SYBIMAGE SYBIMAGE
188 #define SYBMONEY4 SYBMONEY4
190 #define SYBMONEY SYBMONEY
192 #define SYBDATETIME4 SYBDATETIME4
194 #define SYBREAL SYBREAL
196 #define SYBBINARY SYBBINARY
198 #define SYBVOID SYBVOID
200 #define SYBVARBINARY SYBVARBINARY
202 #define SYBNUMERIC SYBNUMERIC
204 #define SYBDECIMAL SYBDECIMAL
206 #define SYBFLTN SYBFLTN
208 #define SYBMONEYN SYBMONEYN
210 #define SYBDATETIMN SYBDATETIMN
212 #define SYBNVARCHAR SYBNVARCHAR
215 #define SYBAOPCNT 0x4b
216 #define SYBAOPCNTU 0x4c
217 #define SYBAOPSUM 0x4d
218 #define SYBAOPSUMU 0x4e
219 #define SYBAOPAVG 0x4f
220 #define SYBAOPAVGU 0x50
221 #define SYBAOPMIN 0x51
222 #define SYBAOPMAX 0x52
225 #define SYBAOPCNT_BIG 0x09
226 #define SYBAOPSTDEV 0x30
227 #define SYBAOPSTDEVP 0x31
228 #define SYBAOPVAR 0x32
229 #define SYBAOPVARP 0x33
230 #define SYBAOPCHECKSUM_AGG 0x72
234 typedef unsigned char DBBOOL;
236 typedef unsigned char DBBIT;
237 typedef unsigned char DBTINYINT;
238 typedef tds_sysdep_int16_type DBSMALLINT;
239 typedef tds_sysdep_int32_type DBINT;
240 typedef tds_sysdep_int64_type DBBIGINT;
241 typedef unsigned char DBBINARY;
242 typedef tds_sysdep_real32_type DBREAL;
243 typedef tds_sysdep_real64_type DBFLT8;
244 typedef unsigned tds_sysdep_int16_type DBUSMALLINT;
255 unsigned char array[256];
260 unsigned char precision;
262 unsigned char array[33];
270 unsigned tds_sysdep_int32_type mnylow;
291 # define SQLCHAR SYBCHAR
302 typedef unsigned char BYTE;
321 { MAXCOLNAMELEN = 512 };
322 typedef enum { CI_REGULAR=1, CI_ALTERNATE=2, CI_CURSOR=3 } CI_TYPE;
327 DBCHAR Name[MAXCOLNAMELEN+2];
328 DBCHAR ActualName[MAXCOLNAMELEN+2];
329 DBCHAR TableName[MAXCOLNAMELEN+2];
346 DBCHAR Name[MAXCOLNAMELEN+2];
347 DBCHAR ActualName[MAXCOLNAMELEN+2];
348 DBCHAR TableName[MAXCOLNAMELEN+2];
360 DBINT ServerMaxLength;
361 DBCHAR ServerTypeDeclaration[256];
368 #define DBPARSEONLY 0
372 #define DBARITHIGNORE 4
374 #define DBARITHABORT 6
375 #define DBTEXTLIMIT 7
381 #define DBSTORPROCID 13
383 #define DBNOAUTOFREE 15
384 #define DBROWCOUNT 16
385 #define DBTEXTSIZE 17
387 #define DBDATEFORMAT 19
389 #define DBPRCOLSEP 21
390 #define DBPRLINELEN 22
391 #define DBPRLINESEP 23
392 #define DBLFCONVERT 24
393 #define DBDATEFIRST 25
394 #define DBCHAINXACTS 26
395 #define DBFIPSFLAG 27
396 #define DBISOLATION 28
398 #define DBIDENTITY 30
400 #define DBDATESHORT 32
401 #define DBCLIENTCURSORS 33
403 #define DBQUOTEDIDENT 35
405 #define DBNUMOPTIONS 36
413 #define NOSUCHOPTION 2
415 #define MAXOPTTEXT 32
465 typedef int (*EHANDLEFUNC) (
DBPROCESS * dbproc,
int severity,
int dberr,
int oserr,
char *dberrstr,
char *oserrstr);
467 typedef int (*MHANDLEFUNC) (
DBPROCESS * dbproc, DBINT msgno,
int msgstate,
int severity,
char *msgtext,
char *srvname,
468 char *proc,
int line);
472 #define DBNOTIFICATION 2
474 #define DBINTERRUPT 4
482 #define NTBSTRINGBIND 2
483 #define VARYCHARBIND 3
484 #define VARYBINBIND 4
490 #define DATETIMEBIND 11
491 #define SMALLDATETIMEBIND 12
493 #define SMALLMONEYBIND 14
494 #define BINARYBIND 15
496 #define NUMERICBIND 17
497 #define DECIMALBIND 18
498 #define SRCNUMERICBIND 19
499 #define SRCDECIMALBIND 20
500 #define BIGINTBIND 30
501 #define DATETIME2BIND 31
502 #define MAXBINDTYPES 32
504 #define DBPRCOLSEP 21
505 #define DBPRLINELEN 22
506 #define DBRPCRETURN 1
507 #define DBRPCDEFAULT 2
511 #define NO_MORE_ROWS -2
513 #define NO_MORE_RESULTS 2
519 #define DB_QUERYOUT 3
526 #define DBRPCRECOMPILE TDS_STATIC_CAST(DBSMALLINT, 0x0001)
527 #define DBRPCRESET TDS_STATIC_CAST(DBSMALLINT, 0x0002)
528 #define DBRPCCURSOR TDS_STATIC_CAST(DBSMALLINT, 0x0008)
530 #if defined(DBLIB_UNIMPLEMENTED)
531 DBBOOL db12hour(
DBPROCESS * dbprocess,
const char language[]);
533 DBBOOL dbcolbrowse(
DBPROCESS * dbprocess,
int colnum);
535 RETCODE dbcursor(DBCURSOR * hc, DBINT optype, DBINT bufno, BYTE * table, BYTE * values);
536 RETCODE dbcursorbind(DBCURSOR * hc,
int col,
int vartype, DBINT varlen, DBINT * poutlen, BYTE * pvaraddr,
DBTYPEINFO * typeinfo);
537 void dbcursorclose(DBCURSOR * hc);
538 RETCODE dbcursorcolinfo(DBCURSOR * hc, DBINT column, DBCHAR * colname, DBINT * coltype, DBINT * collen, DBINT * usertype);
539 RETCODE dbcursorfetch(DBCURSOR * hc, DBINT fetchtype, DBINT rownum);
540 RETCODE dbcursorinfo(DBCURSOR * hc, DBINT * ncols, DBINT * nrows);
541 DBCURSOR *dbcursoropen(
DBPROCESS * dbprocess, BYTE * stmt, SHORT scollopt, SHORT concuropt, USHORT nrows, DBINT * pstatus);
545 RETCODE dbdatechar(
DBPROCESS * dbprocess,
char *buf,
int datepart,
int value);
547 char *dateorder(
DBPROCESS * dbprocess,
char *language);
550 char *dbdayname(
DBPROCESS * dbprocess,
char *language,
int daynum);
552 int dbgetoff(
DBPROCESS * dbprocess, DBUSMALLINT offtype,
int startfrom);
554 char *dbqual(
DBPROCESS * dbprocess,
int tabnum,
char *tabname);
555 void dbfreequal(
char *qualptr);
557 DBSORTORDER *dbloadsort(
DBPROCESS * dbprocess);
558 RETCODE dbfreesort(
DBPROCESS * dbprocess, DBSORTORDER * sortorder);
560 RETCODE dbload_xlate(
DBPROCESS * dbprocess,
char *srv_charset,
char *clt_name, DBXLATE ** xlt_tosrv, DBXLATE ** xlt_todisp);
566 RETCODE dbmnydown(
DBPROCESS * dbproc,
DBMONEY * mnyptr,
int divisor,
int *remainder);
567 RETCODE dbmnyinit(
DBPROCESS * dbproc,
DBMONEY * mnyptr,
int trim, DBBOOL * negative);
568 RETCODE dbmnyndigit(
DBPROCESS * dbproc,
DBMONEY * mnyptr, DBCHAR * value, DBBOOL * zero);
570 RETCODE dbmnydigit(
DBPROCESS * dbprocess,
DBMONEY * m1, DBCHAR * value, DBBOOL * zero);
571 RETCODE dbmnyscale(
DBPROCESS * dbproc,
DBMONEY * dest,
int multiplier,
int addend);
574 RETCODE dbnpcreate(
DBPROCESS * dbprocess);
575 RETCODE dbnpdefine(
DBPROCESS * dbprocess, DBCHAR * procedure_name, DBSMALLINT namelen);
579 RETCODE dbpoll(
DBPROCESS * dbproc,
long milliseconds,
DBPROCESS ** ready_dbproc,
int *return_reason);
580 int dbordercol(
DBPROCESS * dbprocess,
int order);
582 RETCODE dbregdrop(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
583 RETCODE dbregexec(
DBPROCESS * dbproc, DBUSMALLINT options);
584 RETCODE dbreghandle(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, INTFUNCPTR handler);
585 RETCODE dbreginit(
DBPROCESS * dbproc, DBCHAR * procedure_name, DBSMALLINT namelen);
587 RETCODE dbregnowatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
588 RETCODE dbregparam(
DBPROCESS * dbproc,
char *param_name,
int type, DBINT datalen, BYTE * data);
589 RETCODE dbregwatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, DBUSMALLINT options);
590 RETCODE dbregwatchlist(
DBPROCESS * dbprocess);
593 RETCODE dbrpwset(
LOGINREC * login,
char *srvname,
char *password,
int pwlen);
595 DBINT dbreadpage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, BYTE * buf);
596 RETCODE dbwritepage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, DBINT size, BYTE * buf);
598 RETCODE dbsetdeflang(
char *language);
600 int dbstrcmp(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
601 int dbstrsort(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
603 DBBOOL dbtabbrowse(
DBPROCESS * dbprocess,
int tabnum);
605 char *dbtabname(
DBPROCESS * dbprocess,
int tabnum);
606 char *dbtabsource(
DBPROCESS * dbprocess,
int colnum,
int *tabnum);
608 RETCODE dbsetlshort(
LOGINREC * login,
int value,
int which);
610 RETCODE dbsendpassthru(
DBPROCESS * dbprocess, DBVOIDPTR bufp);
611 RETCODE dbrecvpassthru(
DBPROCESS * dbprocess, DBVOIDPTR * bufp);
613 RETCODE dbgetloginfo(
DBPROCESS * dbprocess, DBLOGINFO ** loginfo);
614 RETCODE dbsetloginfo(
LOGINREC * loginrec, DBLOGINFO * loginfo);
617 DBBINARY *dbtsnewval(
DBPROCESS * dbprocess);
618 RETCODE dbtsput(
DBPROCESS * dbprocess, DBBINARY * newts,
int newtslen,
int tabnum,
char *tabname);
620 RETCODE dbfree_xlate(
DBPROCESS * dbprocess, DBXLATE * xlt_tosrv, DBXLATE * clt_todisp);
621 int dbxlate(
DBPROCESS * dbprocess,
char *src,
int srclen,
char *dest,
int destlen, DBXLATE * xlt,
int *srcbytes_used,
622 DBBOOL srcend,
int status);
624 RETCODE bcp_moretext(
DBPROCESS * dbproc, DBINT size, BYTE * text);
625 RETCODE bcp_writefmt(
DBPROCESS * dbproc,
const char filename[]);
627 void build_xact_string(
char *xact_name,
char *service_name, DBINT commid,
char *result);
628 RETCODE remove_xact(
DBPROCESS * connect, DBINT commid,
int n);
629 RETCODE abort_xact(
DBPROCESS * connect, DBINT commid);
631 RETCODE commit_xact(
DBPROCESS * connect, DBINT commid);
633 RETCODE scan_xact(
DBPROCESS * connect, DBINT commid);
634 DBINT start_xact(
DBPROCESS * connect,
char *application_name,
char *xact_name,
int site_count);
635 DBINT stat_xact(
DBPROCESS * connect, DBINT commid);
641 RETCODE
dbaltbind(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
642 RETCODE dbaltbind_ps(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
650 RETCODE
dbbind(
DBPROCESS * dbproc,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
651 RETCODE dbbind_ps(
DBPROCESS * dbprocess,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
DBTYPEINFO * typeinfo);
657 DBBOOL dbcharsetconv(
DBPROCESS * dbprocess);
664 #define DBCMDROW(x) dbcmdrow((x))
673 DBINT
dbconvert(
DBPROCESS * dbproc,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen);
674 DBINT
dbconvert_ps(
DBPROCESS * dbprocess,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen,
679 #define DBCOUNT(x) dbcount((x))
682 #define DBCURCMD(x) dbcurcmd((x))
685 #define DBCURROW(x) dbcurrow((x))
692 #define DBDEAD(x) dbdead((x))
698 #define DBFIRSTROW(x) dbfirstrow((x))
701 char *dbgetcharset(
DBPROCESS * dbprocess);
702 int dbgetlusername(
LOGINREC * login, BYTE * name_buffer,
int buffer_len);
704 char *dbgetnatlanf(
DBPROCESS * dbprocess);
708 #define DBGETTIME dbgettime
714 #define DBIORDESC(x) dbiordesc((x))
717 #define DBIOWDESC(x) dbiowdesc((x))
720 #define DBISAVAIL(x) dbisavail((x))
724 #define DBLASTROW(x) dblastrow((x))
750 #define DBMORECMDS(x) dbmorecmds((x))
765 void dbpivot_count (
struct col_t *output,
const struct col_t *input);
766 void dbpivot_sum (
struct col_t *output,
const struct col_t *input);
767 void dbpivot_min (
struct col_t *output,
const struct col_t *input);
768 void dbpivot_max (
struct col_t *output,
const struct col_t *input);
771 typedef void (*DBPIVOT_FUNC)(
struct col_t *output,
const struct col_t *input);
774 RETCODE
dbpivot(
DBPROCESS *dbproc,
int nkeys,
int *keys,
int ncols,
int *cols, DBPIVOT_FUNC func,
int val);
776 DBPIVOT_FUNC dbpivot_lookup_name(
const char name[] );
779 #define dbopen(x,y) tdsdbopen((x),(y), 1)
781 #define dbopen(x,y) tdsdbopen((x),(y), 0)
785 #ifdef PHP_SYBASE_DBOPEN
786 #undef PHP_SYBASE_DBOPEN
787 #define PHP_SYBASE_DBOPEN dbopen
798 RETCODE dbresults_r(
DBPROCESS * dbproc,
int recursive);
806 #define DBROWS(x) dbrows((x))
809 #define DBROWTYPE(x) dbrowtype((x))
811 RETCODE
dbrpcparam(
DBPROCESS * dbproc,
const char paramname[], BYTE status,
int type, DBINT maxlen, DBINT datalen, BYTE * value);
813 RETCODE
dbsafestr(
DBPROCESS * dbproc,
const char *src, DBINT srclen,
char *dest, DBINT destlen,
int quotetype);
814 RETCODE *dbsechandle(DBINT type, INTFUNCPTR handler);
817 void dbsetbusy(
DBPROCESS * dbprocess, DB_DBBUSY_FUNC busyfunc);
818 RETCODE dbsetdefcharset(
char *charset);
819 void dbsetidle(
DBPROCESS * dbprocess, DB_DBIDLE_FUNC idlefunc);
825 RETCODE
dbsetopt(
DBPROCESS * dbproc,
int option,
const char *char_param,
int int_param);
839 int dbstrbuild(
DBPROCESS * dbproc,
char *charbuf,
int bufsize,
char *text,
char *formats, ...);
844 #define SYBEVERDOWN 100
845 #define SYBEICONVIU 2400
846 #define SYBEICONVAVAIL 2401
847 #define SYBEICONVO 2402
848 #define SYBEICONVI 2403
849 #define SYBEICONV2BIG 2404
852 #define SYBETDSVER 2410
853 #define SYBEPORT 2500
854 #define SYBESYNC 20001
855 #define SYBEFCON 20002
856 #define SYBETIME 20003
857 #define SYBEREAD 20004
858 #define SYBEBUFL 20005
859 #define SYBEWRIT 20006
860 #define SYBEVMS 20007
861 #define SYBESOCK 20008
862 #define SYBECONN 20009
863 #define SYBEMEM 20010
864 #define SYBEDBPS 20011
865 #define SYBEINTF 20012
866 #define SYBEUHST 20013
867 #define SYBEPWD 20014
868 #define SYBEOPIN 20015
869 #define SYBEINLN 20016
870 #define SYBESEOF 20017
871 #define SYBESMSG 20018
872 #define SYBERPND 20019
873 #define SYBEBTOK 20020
874 #define SYBEITIM 20021
875 #define SYBEOOB 20022
876 #define SYBEBTYP 20023
877 #define SYBEBNCR 20024
878 #define SYBEIICL 20025
879 #define SYBECNOR 20026
880 #define SYBENPRM 20027
881 #define SYBEUVDT 20028
882 #define SYBEUFDT 20029
883 #define SYBEWAID 20030
884 #define SYBECDNS 20031
885 #define SYBEABNC 20032
886 #define SYBEABMT 20033
887 #define SYBEABNP 20034
888 #define SYBEAAMT 20035
889 #define SYBENXID 20036
890 #define SYBERXID 20037
891 #define SYBEICN 20038
892 #define SYBENMOB 20039
893 #define SYBEAPUT 20040
894 #define SYBEASNL 20041
895 #define SYBENTLL 20042
896 #define SYBEASUL 20043
897 #define SYBERDNR 20044
898 #define SYBENSIP 20045
899 #define SYBEABNV 20046
900 #define SYBEDDNE 20047
901 #define SYBECUFL 20048
902 #define SYBECOFL 20049
903 #define SYBECSYN 20050
904 #define SYBECLPR 20051
905 #define SYBECNOV 20052
906 #define SYBERDCN 20053
907 #define SYBESFOV 20054
908 #define SYBEUNT 20055
909 #define SYBECLOS 20056
910 #define SYBEUAVE 20057
911 #define SYBEUSCT 20058
912 #define SYBEEQVA 20059
913 #define SYBEUDTY 20060
914 #define SYBETSIT 20061
915 #define SYBEAUTN 20062
916 #define SYBEBDIO 20063
917 #define SYBEBCNT 20064
918 #define SYBEIFNB 20065
919 #define SYBETTS 20066
920 #define SYBEKBCO 20067
921 #define SYBEBBCI 20068
922 #define SYBEKBCI 20069
923 #define SYBEBCRE 20070
924 #define SYBETPTN 20071
925 #define SYBEBCWE 20072
926 #define SYBEBCNN 20073
927 #define SYBEBCOR 20074
928 #define SYBEBCIS 20075
929 #define SYBEBCPI 20076
930 #define SYBEBCPN 20077
931 #define SYBEBCPB 20078
932 #define SYBEVDPT 20079
933 #define SYBEBIVI 20080
934 #define SYBEBCBC 20081
935 #define SYBEBCFO 20082
936 #define SYBEBCVH 20083
937 #define SYBEBCUO 20084
938 #define SYBEBCUC 20085
939 #define SYBEBUOE 20086
940 #define SYBEBUCE 20087
941 #define SYBEBWEF 20088
942 #define SYBEASTF 20089
943 #define SYBEUACS 20090
944 #define SYBEASEC 20091
945 #define SYBETMTD 20092
946 #define SYBENTTN 20093
947 #define SYBEDNTI 20094
948 #define SYBEBTMT 20095
949 #define SYBEORPF 20096
950 #define SYBEUVBF 20097
951 #define SYBEBUOF 20098
952 #define SYBEBUCF 20099
953 #define SYBEBRFF 20100
954 #define SYBEBWFF 20101
955 #define SYBEBUDF 20102
956 #define SYBEBIHC 20103
957 #define SYBEBEOF 20104
958 #define SYBEBCNL 20105
959 #define SYBEBCSI 20106
960 #define SYBEBCIT 20107
961 #define SYBEBCSA 20108
962 #define SYBENULL 20109
963 #define SYBEUNAM 20110
964 #define SYBEBCRO 20111
965 #define SYBEMPLL 20112
966 #define SYBERPIL 20113
967 #define SYBERPUL 20114
968 #define SYBEUNOP 20115
969 #define SYBECRNC 20116
970 #define SYBERTCC 20117
971 #define SYBERTSC 20118
972 #define SYBEUCRR 20119
973 #define SYBERPNA 20120
974 #define SYBEOPNA 20121
975 #define SYBEFGTL 20122
976 #define SYBECWLL 20123
977 #define SYBEUFDS 20124
978 #define SYBEUCPT 20125
979 #define SYBETMCF 20126
980 #define SYBEAICF 20127
981 #define SYBEADST 20128
982 #define SYBEALTT 20129
983 #define SYBEAPCT 20130
984 #define SYBEXOCI 20131
985 #define SYBEFSHD 20132
986 #define SYBEAOLF 20133
987 #define SYBEARDI 20134
988 #define SYBEURCI 20135
989 #define SYBEARDL 20136
990 #define SYBEURMI 20137
991 #define SYBEUREM 20138
992 #define SYBEURES 20139
993 #define SYBEUREI 20140
994 #define SYBEOREN 20141
995 #define SYBEISOI 20142
996 #define SYBEIDCL 20143
997 #define SYBEIMCL 20144
998 #define SYBEIFCL 20145
999 #define SYBEUTDS 20146
1000 #define SYBEBUFF 20147
1001 #define SYBEACNV 20148
1002 #define SYBEDPOR 20149
1003 #define SYBENDC 20150
1004 #define SYBEMVOR 20151
1005 #define SYBEDVOR 20152
1006 #define SYBENBVP 20153
1007 #define SYBESPID 20154
1008 #define SYBENDTP 20155
1009 #define SYBEXTN 20156
1010 #define SYBEXTDN 20157
1011 #define SYBEXTSN 20158
1012 #define SYBENUM 20159
1013 #define SYBETYPE 20160
1014 #define SYBEGENOS 20161
1015 #define SYBEPAGE 20162
1016 #define SYBEOPTNO 20163
1017 #define SYBEETD 20164
1018 #define SYBERTYPE 20165
1019 #define SYBERFILE 20166
1020 #define SYBEFMODE 20167
1021 #define SYBESLCT 20168
1022 #define SYBEZTXT 20169
1023 #define SYBENTST 20170
1024 #define SYBEOSSL 20171
1025 #define SYBEESSL 20172
1026 #define SYBENLNL 20173
1027 #define SYBENHAN 20174
1028 #define SYBENBUF 20175
1029 #define SYBENULP 20176
1030 #define SYBENOTI 20177
1031 #define SYBEEVOP 20178
1032 #define SYBENEHA 20179
1033 #define SYBETRAN 20180
1034 #define SYBEEVST 20181
1035 #define SYBEEINI 20182
1036 #define SYBEECRT 20183
1037 #define SYBEECAN 20184
1038 #define SYBEEUNR 20185
1039 #define SYBERPCS 20186
1040 #define SYBETPAR 20187
1041 #define SYBETEXS 20188
1042 #define SYBETRAC 20189
1043 #define SYBETRAS 20190
1044 #define SYBEPRTF 20191
1045 #define SYBETRSN 20192
1046 #define SYBEBPKS 20193
1047 #define SYBEIPV 20194
1048 #define SYBEMOV 20195
1049 #define SYBEDIVZ 20196
1050 #define SYBEASTL 20197
1051 #define SYBESEFA 20198
1052 #define SYBEPOLL 20199
1053 #define SYBENOEV 20200
1054 #define SYBEBADPK 20201
1055 #define SYBESECURE 20202
1056 #define SYBECAP 20203
1057 #define SYBEFUNC 20204
1058 #define SYBERESP 20205
1059 #define SYBEIVERS 20206
1060 #define SYBEONCE 20207
1061 #define SYBERPNULL 20208
1062 #define SYBERPTXTIM 20209
1063 #define SYBENEG 20210
1064 #define SYBELBLEN 20211
1065 #define SYBEUMSG 20212
1066 #define SYBECAPTYP 20213
1067 #define SYBEBNUM 20214
1068 #define SYBEBBL 20215
1069 #define SYBEBPREC 20216
1070 #define SYBEBSCALE 20217
1071 #define SYBECDOMAIN 20218
1072 #define SYBECINTERNAL 20219
1073 #define SYBEBTYPSRV 20220
1074 #define SYBEBCSET 20221
1075 #define SYBEFENC 20222
1076 #define SYBEFRES 20223
1077 #define SYBEISRVPREC 20224
1078 #define SYBEISRVSCL 20225
1079 #define SYBEINUMCL 20226
1080 #define SYBEIDECCL 20227
1081 #define SYBEBCMTXT 20228
1082 #define SYBEBCPREC 20229
1083 #define SYBEBCBNPR 20230
1084 #define SYBEBCBNTYP 20231
1085 #define SYBEBCSNTYP 20232
1086 #define SYBEBCPCTYP 20233
1087 #define SYBEBCVLEN 20234
1088 #define SYBEBCHLEN 20235
1089 #define SYBEBCBPREF 20236
1090 #define SYBEBCPREF 20237
1091 #define SYBEBCITBNM 20238
1092 #define SYBEBCITBLEN 20239
1093 #define SYBEBCSNDROW 20240
1094 #define SYBEBPROCOL 20241
1095 #define SYBEBPRODEF 20242
1096 #define SYBEBPRONUMDEF 20243
1097 #define SYBEBPRODEFID 20244
1098 #define SYBEBPRONODEF 20245
1099 #define SYBEBPRODEFTYP 20246
1100 #define SYBEBPROEXTDEF 20247
1101 #define SYBEBPROEXTRES 20248
1102 #define SYBEBPROBADDEF 20249
1103 #define SYBEBPROBADTYP 20250
1104 #define SYBEBPROBADLEN 20251
1105 #define SYBEBPROBADPREC 20252
1106 #define SYBEBPROBADSCL 20253
1107 #define SYBEBADTYPE 20254
1108 #define SYBECRSNORES 20255
1109 #define SYBECRSNOIND 20256
1110 #define SYBECRSVIEW 20257
1111 #define SYBECRSVIIND 20258
1112 #define SYBECRSORD 20259
1113 #define SYBECRSBUFR 20260
1114 #define SYBECRSNOFREE 20261
1115 #define SYBECRSDIS 20262
1116 #define SYBECRSAGR 20263
1117 #define SYBECRSFRAND 20264
1118 #define SYBECRSFLAST 20265
1119 #define SYBECRSBROL 20266
1120 #define SYBECRSFROWN 20267
1121 #define SYBECRSBSKEY 20268
1122 #define SYBECRSRO 20269
1123 #define SYBECRSNOCOUNT 20270
1124 #define SYBECRSTAB 20271
1125 #define SYBECRSUPDNB 20272
1126 #define SYBECRSNOWHERE 20273
1127 #define SYBECRSSET 20274
1128 #define SYBECRSUPDTAB 20275
1129 #define SYBECRSNOUPD 20276
1130 #define SYBECRSINV 20277
1131 #define SYBECRSNOKEYS 20278
1132 #define SYBECRSNOBIND 20279
1133 #define SYBECRSFTYPE 20280
1134 #define SYBECRSINVALID 20281
1135 #define SYBECRSMROWS 20282
1136 #define SYBECRSNROWS 20283
1137 #define SYBECRSNOLEN 20284
1138 #define SYBECRSNOPTCC 20285
1139 #define SYBECRSNORDER 20286
1140 #define SYBECRSNOTABLE 20287
1141 #define SYBECRSNUNIQUE 20288
1142 #define SYBECRSVAR 20289
1143 #define SYBENOVALUE 20290
1144 #define SYBEVOIDRET 20291
1145 #define SYBECLOSEIN 20292
1146 #define SYBEBOOL 20293
1147 #define SYBEBCPOPT 20294
1148 #define SYBEERRLABEL 20295
1149 #define SYBEATTNACK 20296
1150 #define SYBEBBFL 20297
1151 #define SYBEDCL 20298
1152 #define SYBECS 20299
1153 #define SYBEBULKINSERT 20599
1154 #define SYBECOLSIZE 22000
1158 #define DBTDS(a) dbtds(a)
1159 DBINT dbtextsize(
DBPROCESS * dbprocess);
1162 DBBINARY *dbtxtsnewval(
DBPROCESS * dbprocess);
1163 RETCODE dbtxtsput(
DBPROCESS * dbprocess, DBBINARY newtxts,
int colnum);
1167 RETCODE
dbwritetext(
DBPROCESS * dbproc,
char *objname, DBBINARY * textptr, DBTINYINT textptrlen, DBBINARY * timestamp,
1168 DBBOOL log, DBINT size, BYTE * text);
1177 #define DBSETLHOST(x,y) dbsetlname((x), (y), DBSETHOST)
1178 #define dbsetlhost(x,y) dbsetlname((x), (y), DBSETHOST)
1180 #define DBSETLUSER(x,y) dbsetlname((x), (y), DBSETUSER)
1181 #define dbsetluser(x,y) dbsetlname((x), (y), DBSETUSER)
1183 #define DBSETLPWD(x,y) dbsetlname((x), (y), DBSETPWD)
1184 #define dbsetlpwd(x,y) dbsetlname((x), (y), DBSETPWD)
1185 #if defined(DBLIB_UNIMPLEMENTED)
1187 # define DBSETLHID(x,y) dbsetlname((x), (y), DBSETHID)
1190 #define DBSETLAPP(x,y) dbsetlname((x), (y), DBSETAPP)
1191 #define dbsetlapp(x,y) dbsetlname((x), (y), DBSETAPP)
1193 #define BCP_SETL(x,y) dbsetlbool((x), (y), DBSETBCP)
1194 #define DBSETLSECURE(x) dbsetlbool((x), (1), DBSETBCP)
1195 #define DBSETNATLANG 7
1196 #define DBSETLNATLANG(x,y) dbsetlname((x), (y), DBSETNATLANG)
1197 #define dbsetlnatlang(x,y) dbsetlname((x), (y), DBSETNATLANG)
1198 #if defined(DBLIB_UNIMPLEMENTED)
1199 # define DBSETNOSHORT 8
1200 # define DBSETLNOSHORT(x,y) dbsetlbool((x), (y), DBSETNOSHORT)
1201 # define DBSETHIER 9
1202 # define DBSETLHIER(x,y) dbsetlshort((x), (y), DBSETHIER)
1204 #define DBSETCHARSET 10
1205 #define DBSETLCHARSET(x,y) dbsetlname((x), (y), DBSETCHARSET)
1206 #define DBSETPACKET 11
1207 #define DBSETLPACKET(x,y) dbsetllong((x), (y), DBSETPACKET)
1208 #define dbsetlpacket(x,y) dbsetllong((x), (y), DBSETPACKET)
1209 #define DBSETENCRYPT 12
1210 #define DBSETLENCRYPT(x,y) dbsetlbool((x), (y), DBSETENCRYPT)
1211 #define DBSETLABELED 13
1212 #define DBSETLLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1213 #define BCP_SETLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1214 #define DBSETDBNAME 14
1215 #define DBSETLDBNAME(x,y) dbsetlname((x), (y), DBSETDBNAME)
1216 #define DBSETLVERSION(login, version) dbsetlversion((login), (version))
1218 RETCODE
bcp_init(
DBPROCESS * dbproc,
const char *tblname,
const char *hfile,
const char *errfile,
int direction);
1222 RETCODE
bcp_bind(
DBPROCESS * dbproc, BYTE * varaddr,
int prefixlen, DBINT varlen, BYTE * terminator,
int termlen,
int type,
1226 RETCODE
bcp_colfmt(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1227 const BYTE * host_term,
int host_termlen,
int colnum);
1228 RETCODE
bcp_colfmt_ps(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1229 BYTE * host_term,
int host_termlen,
int colnum,
DBTYPEINFO * typeinfo);
1232 int bcp_getbatchsize(
DBPROCESS * dbproc);
DBINT bcp_batch(DBPROCESS *dbproc)
Commit a set of rows to the table.
Definition: bcp.c:1939
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition: bcp.c:535
int dbtds(DBPROCESS *dbprocess)
Get the TDS version in use for dbproc.
Definition: dblib.c:6578
void dbsetifile(char *filename)
set name and location of the interfaces file FreeTDS should use to look up a servername.
Definition: dblib.c:2665
RETCODE dbcmdrow(DBPROCESS *dbproc)
See if the current command can return rows.
Definition: dblib.c:4075
DBINT dbfirstrow(DBPROCESS *dbproc)
See if a server response has arrived.
Definition: dblib.c:6970
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:7078
int dbmnycmp(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2)
Compare two DBMONEY values.
Definition: dblib.c:5080
RETCODE dbsetopt(DBPROCESS *dbproc, int option, const char *char_param, int int_param)
Set db-lib or server option.
Definition: dblib.c:4297
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:4441
DBINT dbcolutype(DBPROCESS *dbprocess, int column)
Get user-defined datatype of a regular result column.
Definition: dblib.c:2874
DBINT dbretstatus(DBPROCESS *dbproc)
Fetch status value returned by query or remote procedure call.
Definition: dblib.c:4484
DBINT dbprcollen(DBPROCESS *dbproc, int column)
Get size of a result column needed to print column.
Definition: dblib.c:3071
RETCODE dbrpcsend(DBPROCESS *dbproc)
Execute the procedure and free associated memory.
Definition: rpc.c:278
int dbaltop(DBPROCESS *dbproc, int computeid, int column)
Get aggregation operator for a compute column.
Definition: dblib.c:4269
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition: dblib.c:1680
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:2231
RETCODE dbnullbind(DBPROCESS *dbproc, int column, DBINT *indicator)
Tie a null-indicator to a regular result column.
Definition: dblib.c:2694
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition: dblib.c:1394
RETCODE dbsqlok(DBPROCESS *dbproc)
Wait for results of a query from the server.
Definition: dblib.c:4627
RETCODE dbclropt(DBPROCESS *dbproc, int option, const char param[])
Reset an option.
Definition: dblib.c:5886
RETCODE dbstrcpy(DBPROCESS *dbproc, int start, int numbytes, char *dest)
Get a copy of a chunk of the command buffer.
Definition: dblib.c:6120
char * dbservcharset(DBPROCESS *dbprocess)
Get syscharset name of the server character set.
Definition: dblib.c:6800
const char * dbversion(void)
See which version of db-lib is in use.
Definition: dblib.c:6617
int dbnumcompute(DBPROCESS *dbprocess)
Get count of COMPUTE clauses for a result set.
Definition: dblib.c:4787
DBBOOL dbdead(DBPROCESS *dbproc)
Check if dbproc is an ex-parrot.
Definition: dblib.c:4872
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
BYTE * dbgetuserdata(DBPROCESS *dbproc)
Get address of user-allocated data from a DBPROCESS.
Definition: dblib.c:5750
DBINT dblastrow(DBPROCESS *dbproc)
Get number of the last row in the row buffer.
Definition: dblib.c:6985
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:6242
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:4193
DBINT dbcurrow(DBPROCESS *dbproc)
Get number of the row currently being read.
Definition: dblib.c:5961
RETCODE dbmorecmds(DBPROCESS *dbproc)
See if more commands are to be processed.
Definition: dblib.c:6012
int dbdatecmp(DBPROCESS *dbproc, DBDATETIME *d1, DBDATETIME *d2)
Compare DBDATETIME values, similar to strcmp(3).
Definition: dblib.c:5579
int dbcurcmd(DBPROCESS *dbproc)
Get number of the row just returned.
Definition: dblib.c:5995
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:6371
char * dbcolname(DBPROCESS *dbproc, int column)
Return name of a regular result column.
Definition: dblib.c:1856
RETCODE dbrows(DBPROCESS *dbproc)
Indicate whether a query returned rows.
Definition: dblib.c:3851
int dbgettime(void)
Get maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4038
BYTE * dbretdata(DBPROCESS *dbproc, int retnum)
Get value of an output parameter filled by a stored procedure.
Definition: dblib.c:4563
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 dbsetlversion(LOGINREC *login, BYTE version)
Set TDS version for future connections.
Definition: dblib.c:929
char * dbcolsource(DBPROCESS *dbproc, int colnum)
Get base database column name for a result set column.
Definition: dblib.c:3023
RETCODE dbspr1row(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print a regular result row to a buffer.
Definition: dblib.c:3270
RETCODE dbsprline(DBPROCESS *dbproc, char *buffer, DBINT buf_len, DBCHAR line_char)
Get formatted string for underlining dbsprhead() column names.
Definition: dblib.c:3655
int dbspid(DBPROCESS *dbproc)
Get server process ID for a DBPROCESS.
Definition: dblib.c:5706
RETCODE dbsqlsend(DBPROCESS *dbproc)
Transmit the command buffer to the server.
Definition: dblib.c:6820
RETCODE dbmoretext(DBPROCESS *dbproc, DBINT size, const BYTE text[])
Send chunk of a text/image value to the server.
Definition: dblib.c:6509
BYTE * dbbylist(DBPROCESS *dbproc, int computeid, int *size)
Get bylist for a compute row.
Definition: dblib.c:4813
RETCODE dbmny4add(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *sum)
Add two DBMONEY4 values.
Definition: dblib.c:5407
void dbsetuserdata(DBPROCESS *dbproc, BYTE *ptr)
Associate client-allocated (and defined) data with a DBPROCESS.
Definition: dblib.c:5732
DBBOOL dbisopt(DBPROCESS *dbproc, int option, const char param[])
Get value of an option.
Definition: dblib.c:5938
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition: dblib.c:4935
RETCODE dbcanquery(DBPROCESS *dbproc)
Cancel the query currently being retrieved, discarding all pending rows.
Definition: dblib.c:5822
int dbalttype(DBPROCESS *dbproc, int computeid, int column)
Get datatype for a compute column.
Definition: dblib.c:4157
const char * dbprtype(int token)
Print a token value's name to a buffer.
Definition: dblib.c:6225
RETCODE dbprrow(DBPROCESS *dbproc)
Print a result set to stdout.
Definition: dblib.c:3352
RETCODE dbmnydec(DBPROCESS *dbproc, DBMONEY *mnyptr)
Subtract $0.0001 from a DBMONEY value.
Definition: dblib.c:5305
DBTYPEINFO * dbcoltypeinfo(DBPROCESS *dbproc, int column)
Get precision and scale information for a regular result column.
Definition: dblib.c:2897
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:2730
int dbaltcolid(DBPROCESS *dbproc, int computeid, int column)
Get column ID of a compute column.
Definition: dblib.c:4099
char * dbretname(DBPROCESS *dbproc, int retnum)
Get name of an output parameter filled by a stored procedure.
Definition: dblib.c:4534
DBINT dbdatlen(DBPROCESS *dbproc, int column)
Get size of current row's data in a regular result column.
Definition: dblib.c:3146
RETCODE dbbind(DBPROCESS *dbproc, int column, int vartype, DBINT varlen, BYTE *varaddr)
Tie a host variable to a resultset column.
Definition: dblib.c:2588
STATUS dbsetrow(DBPROCESS *dbprocess, DBINT row)
Make a buffered row "current" without fetching it into bound variables.
Definition: dblib.c:1999
DBINT dbspr1rowlen(DBPROCESS *dbproc)
Determine size buffer required to hold the results returned by dbsprhead(), dbsprline(), and dbspr1row().
Definition: dblib.c:3232
RETCODE dbuse(DBPROCESS *dbproc, const char *name)
Change current database.
Definition: dblib.c:1420
DBINT dbvarylen(DBPROCESS *dbproc, int column)
Determine whether a column can vary in size.
Definition: dblib.c:3097
RETCODE dbcancel(DBPROCESS *dbproc)
Cancel the current command batch.
Definition: dblib.c:3207
void dbclrbuf(DBPROCESS *dbproc, DBINT n)
Clear n rows from the row buffer.
Definition: dblib.c:2798
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
char * dbchange(DBPROCESS *dbprocess)
See if a command caused the current database to change.
Definition: dblib.c:6764
RETCODE dbmnyzero(DBPROCESS *dbproc, DBMONEY *dest)
Set a DBMONEY value to zero.
Definition: dblib.c:5138
DBBINARY * dbtxtimestamp(DBPROCESS *dbproc, int column)
Get text timestamp for a column in the current row.
Definition: dblib.c:6304
RETCODE dbmnymaxneg(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum negative DBMONEY value supported.
Definition: dblib.c:5180
DBBINARY * dbtxptr(DBPROCESS *dbproc, int column)
Get text pointer for a column in the current row.
Definition: dblib.c:6334
RETCODE dbrpcinit(DBPROCESS *dbproc, const char rpcname[], DBSMALLINT options)
Initialize a remote procedure call.
Definition: rpc.c:74
RETCODE bcp_exec(DBPROCESS *dbproc, DBINT *rows_copied)
Write a datafile to a table.
Definition: bcp.c:1553
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 dbmny4sub(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *diff)
Subtract two DBMONEY4 values.
Definition: dblib.c:5438
int dbgetpacket(DBPROCESS *dbproc)
Get TDS packet size for the connection.
Definition: dblib.c:3892
DBPROCESS * tdsdbopen(LOGINREC *login, const char *server, int msdblib)
Form a connection with the server.
Definition: dblib.c:1158
void dbfreebuf(DBPROCESS *dbproc)
Erase the command buffer, in case DBNOAUTOFREE was set with dbsetopt().
Definition: dblib.c:5852
int dbnumalts(DBPROCESS *dbproc, int computeid)
Get count of columns in a compute row.
Definition: dblib.c:4754
RETCODE dbmnymaxpos(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum positive DBMONEY value supported.
Definition: dblib.c:5159
DBBOOL bcp_getl(LOGINREC *login)
See if BCP_SETL() was used to set the LOGINREC for BCP work.
Definition: bcp.c:693
void dbclose(DBPROCESS *dbproc)
Close a connection to the server and free associated resources.
Definition: dblib.c:1463
BOOL dbiscount(DBPROCESS *dbproc)
Indicates whether or not the count returned by dbcount is real (Microsoft-compatibility feature)...
Definition: dblib.c:2758
RETCODE dbsprhead(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print result set headings to a buffer.
Definition: dblib.c:3713
RETCODE bcp_readfmt(DBPROCESS *dbproc, const char filename[])
Read a format definition file.
Definition: bcp.c:1614
void dbexit(void)
Close server connections and free all related structures.
Definition: dblib.c:1533
RETCODE dbsetlname(LOGINREC *login, const char *value, int which)
Set the value of a string in a LOGINREC structure.
Definition: dblib.c:766
RETCODE dbinit(void)
Initialize db-lib.
Definition: dblib.c:671
DBINT dbadlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in a compute column.
Definition: dblib.c:4126
STATUS dbrowtype(DBPROCESS *dbprocess)
Get returned row's type.
Definition: dblib.c:5978
RETCODE dbsetmaxprocs(int maxprocs)
Set maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3916
void dbsetavail(DBPROCESS *dbprocess)
Mark a DBPROCESS as "available".
Definition: dblib.c:7053
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition: dblib.c:2845
DBINT dbcollen(DBPROCESS *dbproc, int column)
Get size of a regular result column.
Definition: dblib.c:3048
DBBOOL dbwillconvert(int srctype, int desttype)
Test whether or not a datatype can be converted to another datatype.
Definition: dblib.c:2828
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
Definition: dblib.c:1342
int dbiowdesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to write data coming to the server...
Definition: dblib.c:7025
int dbnumrets(DBPROCESS *dbproc)
Get count of output parameters filled by a stored procedure.
Definition: dblib.c:4502
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:2926
DBINT dbconvert(DBPROCESS *dbproc, int srctype, const BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen)
cf.
Definition: dblib.c:2549
RETCODE dbsetlbool(LOGINREC *login, int value, int which)
Set a boolean value in a LOGINREC structure.
Definition: dblib.c:900
const char * dbmonthname(DBPROCESS *dbproc, char *language, int monthnum, DBBOOL shortform)
Get name of a month, in some human language.
Definition: dblib.c:6735
RETCODE dbfcmd(DBPROCESS *dbproc, const char *fmt,...)
printf-like way to form SQL to send to the server.
Definition: dblib.c:1303
int dbretlen(DBPROCESS *dbproc, int retnum)
Get size of an output parameter filled by a stored procedure.
Definition: dblib.c:4592
RETCODE dbdatecrack(DBPROCESS *dbproc, DBDATEREC *di, DBDATETIME *dt)
Break a DBDATETIME value into useful pieces.
Definition: dblib.c:5624
RETCODE dbmny4minus(DBPROCESS *dbproc, DBMONEY4 *src, DBMONEY4 *dest)
Negate a DBMONEY4 value.
Definition: dblib.c:5360
RETCODE dbsetllong(LOGINREC *login, long value, int which)
Set an integer value in a LOGINREC structure.
Definition: dblib.c:829
int dbmny4cmp(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2)
Compare two DBMONEY4 values.
Definition: dblib.c:5526
RETCODE dbsetlogintime(int seconds)
Set maximum seconds db-lib waits for a server response to a login attempt.
Definition: dblib.c:4054
RETCODE dbsetversion(DBINT version)
Specify a db-lib version level.
Definition: dblib.c:5768
RETCODE bcp_colptr(DBPROCESS *dbproc, BYTE *colptr, int table_column)
Override bcp_bind() by pointing to a different host variable.
Definition: bcp.c:657
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition: dblib.c:4954
BYTE * dbadata(DBPROCESS *dbproc, int computeid, int column)
Get address of compute column data.
Definition: dblib.c:4239
int dbnumcols(DBPROCESS *dbproc)
Return number of regular columns in a result set.
Definition: dblib.c:1832
int dbiordesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to read data coming from the server...
Definition: dblib.c:7009
RETCODE dbmnyinc(DBPROCESS *dbproc, DBMONEY *mnyptr)
Add $0.0001 to a DBMONEY value.
Definition: dblib.c:5277
RETCODE dbmnyminus(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Negate a DBMONEY value.
Definition: dblib.c:5333
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Definition: dblib.c:6784
char * dbgetchar(DBPROCESS *dbprocess, int n)
Get address of a position in the command buffer.
Definition: dblib.c:6087
void dbprhead(DBPROCESS *dbproc)
Print result set headings to stdout.
Definition: dblib.c:3776
DBBOOL dbhasretstat(DBPROCESS *dbproc)
Determine if query generated a return status number.
Definition: dblib.c:4460
int dbgetmaxprocs(void)
get maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3990
int dbrettype(DBPROCESS *dbproc, int retnum)
Get datatype of a stored procedure's return parameter.
Definition: dblib.c:6043
int dbstrlen(DBPROCESS *dbproc)
Get size of the command buffer, in bytes.
Definition: dblib.c:6068
DBINT bcp_done(DBPROCESS *dbproc)
Conclude the transfer of data from program variables.
Definition: bcp.c:1966
DBPROCESS * dbopen(LOGINREC *login, const char *server)
Normally not used.
Definition: dbopen.c:37
RETCODE dbsettime(int seconds)
Set maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4011
DBINT dbaltlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in compute column.
Definition: dblib.c:6915
BYTE * dbdata(DBPROCESS *dbproc, int column)
Get address of data in a regular result column.
Definition: dblib.c:3174
STATUS dbreadtext(DBPROCESS *dbproc, void *buf, DBINT bufsize)
Fetch part of a text or image value from the server.
Definition: dblib.c:6440
void dbloginfree(LOGINREC *login)
free the LOGINREC
Definition: dblib.c:744
DBINT dbcount(DBPROCESS *dbproc)
Get count of rows processed.
Definition: dblib.c:2778
RETCODE dbmny4copy(DBPROCESS *dbprocess, DBMONEY4 *m1, DBMONEY4 *m2)
Copy a DBMONEY4 value.
Definition: dblib.c:5554
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
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition: dblib.c:716
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:6164
RETCODE bcp_columns(DBPROCESS *dbproc, int host_colcount)
Indicate how many columns are to be found in the datafile.
Definition: bcp.c:298
void dbrecftos(const char filename[])
Record to a file all SQL commands sent to the server.
Definition: dblib.c:6544
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
RETCODE dbmnycopy(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Copy a DBMONEY value.
Definition: dblib.c:5801
Definition: dbpivot.c:761
RETCODE bcp_sendrow(DBPROCESS *dbproc)
Write data in host variables to the table.
Definition: bcp.c:1326
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
DBINT dbaltutype(DBPROCESS *dbproc, int computeid, int column)
Get user-defined datatype of a compute column.
Definition: dblib.c:6891
Definition: bsqlodbc.c:97
RETCODE dbsetnull(DBPROCESS *dbprocess, int bindtype, int bindlen, BYTE *bindval)
Define substitution values to be used when binding null values.
Definition: dblib.c:1920
RETCODE dbmny4zero(DBPROCESS *dbproc, DBMONEY4 *dest)
Zero a DBMONEY4 value.
Definition: dblib.c:5384
RETCODE dbgetrow(DBPROCESS *dbproc, DBINT row)
Read a row from the row buffer.
Definition: dblib.c:1888