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
213 #define SYBMSDATE SYBMSDATE
215 #define SYBMSTIME SYBMSTIME
217 #define SYBMSDATETIME2 SYBMSDATETIME2
218 SYBMSDATETIMEOFFSET = 43,
219 #define SYBMSDATETIMEOFFSET SYBMSDATETIMEOFFSET
222 #define SYBAOPCNT 0x4b
223 #define SYBAOPCNTU 0x4c
224 #define SYBAOPSUM 0x4d
225 #define SYBAOPSUMU 0x4e
226 #define SYBAOPAVG 0x4f
227 #define SYBAOPAVGU 0x50
228 #define SYBAOPMIN 0x51
229 #define SYBAOPMAX 0x52
232 #define SYBAOPCNT_BIG 0x09
233 #define SYBAOPSTDEV 0x30
234 #define SYBAOPSTDEVP 0x31
235 #define SYBAOPVAR 0x32
236 #define SYBAOPVARP 0x33
237 #define SYBAOPCHECKSUM_AGG 0x72
241 typedef unsigned char DBBOOL;
243 typedef unsigned char DBBIT;
244 typedef unsigned char DBTINYINT;
245 typedef tds_sysdep_int16_type DBSMALLINT;
246 typedef tds_sysdep_int32_type DBINT;
247 typedef tds_sysdep_int64_type DBBIGINT;
248 typedef unsigned char DBBINARY;
249 typedef tds_sysdep_real32_type DBREAL;
250 typedef tds_sysdep_real64_type DBFLT8;
251 typedef unsigned tds_sysdep_int16_type DBUSMALLINT;
252 typedef unsigned tds_sysdep_int32_type DBUINT;
253 typedef unsigned tds_sysdep_int64_type DBUBIGINT;
264 unsigned char array[256];
269 unsigned char precision;
271 unsigned char array[33];
279 unsigned tds_sysdep_int32_type mnylow;
304 DBUSMALLINT time_prec:3;
306 DBUSMALLINT has_time:1;
307 DBUSMALLINT has_date:1;
308 DBUSMALLINT has_offset:1;
312 # define SQLCHAR SYBCHAR
323 typedef unsigned char BYTE;
342 { MAXCOLNAMELEN = 512 };
343 typedef enum { CI_REGULAR=1, CI_ALTERNATE=2, CI_CURSOR=3 } CI_TYPE;
348 DBCHAR Name[MAXCOLNAMELEN+2];
349 DBCHAR ActualName[MAXCOLNAMELEN+2];
350 DBCHAR TableName[MAXCOLNAMELEN+2];
367 DBCHAR Name[MAXCOLNAMELEN+2];
368 DBCHAR ActualName[MAXCOLNAMELEN+2];
369 DBCHAR TableName[MAXCOLNAMELEN+2];
381 DBINT ServerMaxLength;
382 DBCHAR ServerTypeDeclaration[256];
389 #define DBPARSEONLY 0
393 #define DBARITHIGNORE 4
395 #define DBARITHABORT 6
396 #define DBTEXTLIMIT 7
402 #define DBSTORPROCID 13
404 #define DBNOAUTOFREE 15
405 #define DBROWCOUNT 16
406 #define DBTEXTSIZE 17
408 #define DBDATEFORMAT 19
410 #define DBPRCOLSEP 21
411 #define DBPRLINELEN 22
412 #define DBPRLINESEP 23
413 #define DBLFCONVERT 24
414 #define DBDATEFIRST 25
415 #define DBCHAINXACTS 26
416 #define DBFIPSFLAG 27
417 #define DBISOLATION 28
419 #define DBIDENTITY 30
421 #define DBDATESHORT 32
422 #define DBCLIENTCURSORS 33
424 #define DBQUOTEDIDENT 35
426 #define DBNUMOPTIONS 36
434 #define NOSUCHOPTION 2
436 #define MAXOPTTEXT 32
521 typedef int (*EHANDLEFUNC) (
DBPROCESS * dbproc,
int severity,
int dberr,
int oserr,
char *dberrstr,
char *oserrstr);
523 typedef int (*MHANDLEFUNC) (
DBPROCESS * dbproc, DBINT msgno,
int msgstate,
int severity,
char *msgtext,
char *srvname,
524 char *proc,
int line);
528 #define DBNOTIFICATION 2
530 #define DBINTERRUPT 4
538 #define NTBSTRINGBIND 2
539 #define VARYCHARBIND 3
540 #define VARYBINBIND 4
546 #define DATETIMEBIND 11
547 #define SMALLDATETIMEBIND 12
549 #define SMALLMONEYBIND 14
550 #define BINARYBIND 15
552 #define NUMERICBIND 17
553 #define DECIMALBIND 18
554 #define SRCNUMERICBIND 19
555 #define SRCDECIMALBIND 20
556 #define BIGINTBIND 30
557 #define DATETIME2BIND 31
558 #define MAXBINDTYPES 32
560 #define DBPRCOLSEP 21
561 #define DBPRLINELEN 22
562 #define DBRPCRETURN 1
563 #define DBRPCDEFAULT 2
567 #define NO_MORE_ROWS -2
569 #define NO_MORE_RESULTS 2
575 #define DB_QUERYOUT 3
582 #define DBRPCRECOMPILE TDS_STATIC_CAST(DBSMALLINT, 0x0001)
583 #define DBRPCRESET TDS_STATIC_CAST(DBSMALLINT, 0x0002)
584 #define DBRPCCURSOR TDS_STATIC_CAST(DBSMALLINT, 0x0008)
586 #if defined(DBLIB_UNIMPLEMENTED)
587 DBBOOL db12hour(
DBPROCESS * dbprocess,
const char language[]);
589 DBBOOL dbcolbrowse(
DBPROCESS * dbprocess,
int colnum);
591 RETCODE dbcursor(DBCURSOR * hc, DBINT optype, DBINT bufno, BYTE * table, BYTE * values);
592 RETCODE dbcursorbind(DBCURSOR * hc,
int col,
int vartype, DBINT varlen, DBINT * poutlen, BYTE * pvaraddr,
DBTYPEINFO * typeinfo);
593 void dbcursorclose(DBCURSOR * hc);
594 RETCODE dbcursorcolinfo(DBCURSOR * hc, DBINT column, DBCHAR * colname, DBINT * coltype, DBINT * collen, DBINT * usertype);
595 RETCODE dbcursorfetch(DBCURSOR * hc, DBINT fetchtype, DBINT rownum);
596 RETCODE dbcursorinfo(DBCURSOR * hc, DBINT * ncols, DBINT * nrows);
597 DBCURSOR *dbcursoropen(
DBPROCESS * dbprocess, BYTE * stmt, SHORT scollopt, SHORT concuropt, USHORT nrows, DBINT * pstatus);
601 RETCODE dbdatechar(
DBPROCESS * dbprocess,
char *buf,
int datepart,
int value);
603 char *dateorder(
DBPROCESS * dbprocess,
char *language);
606 char *dbdayname(
DBPROCESS * dbprocess,
char *language,
int daynum);
608 int dbgetoff(
DBPROCESS * dbprocess, DBUSMALLINT offtype,
int startfrom);
610 char *dbqual(
DBPROCESS * dbprocess,
int tabnum,
char *tabname);
611 void dbfreequal(
char *qualptr);
613 DBSORTORDER *dbloadsort(
DBPROCESS * dbprocess);
614 RETCODE dbfreesort(
DBPROCESS * dbprocess, DBSORTORDER * sortorder);
616 RETCODE dbload_xlate(
DBPROCESS * dbprocess,
char *srv_charset,
char *clt_name, DBXLATE ** xlt_tosrv, DBXLATE ** xlt_todisp);
622 RETCODE dbmnydown(
DBPROCESS * dbproc,
DBMONEY * mnyptr,
int divisor,
int *remainder);
623 RETCODE dbmnyinit(
DBPROCESS * dbproc,
DBMONEY * mnyptr,
int trim, DBBOOL * negative);
624 RETCODE dbmnyndigit(
DBPROCESS * dbproc,
DBMONEY * mnyptr, DBCHAR * value, DBBOOL * zero);
626 RETCODE dbmnydigit(
DBPROCESS * dbprocess,
DBMONEY * m1, DBCHAR * value, DBBOOL * zero);
627 RETCODE dbmnyscale(
DBPROCESS * dbproc,
DBMONEY * dest,
int multiplier,
int addend);
630 RETCODE dbnpcreate(
DBPROCESS * dbprocess);
631 RETCODE dbnpdefine(
DBPROCESS * dbprocess, DBCHAR * procedure_name, DBSMALLINT namelen);
635 RETCODE dbpoll(
DBPROCESS * dbproc,
long milliseconds,
DBPROCESS ** ready_dbproc,
int *return_reason);
636 int dbordercol(
DBPROCESS * dbprocess,
int order);
638 RETCODE dbregdrop(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
639 RETCODE dbregexec(
DBPROCESS * dbproc, DBUSMALLINT options);
640 RETCODE dbreghandle(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, INTFUNCPTR handler);
641 RETCODE dbreginit(
DBPROCESS * dbproc, DBCHAR * procedure_name, DBSMALLINT namelen);
643 RETCODE dbregnowatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
644 RETCODE dbregparam(
DBPROCESS * dbproc,
char *param_name,
int type, DBINT datalen, BYTE * data);
645 RETCODE dbregwatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, DBUSMALLINT options);
646 RETCODE dbregwatchlist(
DBPROCESS * dbprocess);
649 RETCODE dbrpwset(
LOGINREC * login,
char *srvname,
char *password,
int pwlen);
651 DBINT dbreadpage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, BYTE * buf);
652 RETCODE dbwritepage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, DBINT size, BYTE * buf);
654 RETCODE dbsetdeflang(
char *language);
656 int dbstrcmp(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
657 int dbstrsort(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
659 DBBOOL dbtabbrowse(
DBPROCESS * dbprocess,
int tabnum);
661 char *dbtabname(
DBPROCESS * dbprocess,
int tabnum);
662 char *dbtabsource(
DBPROCESS * dbprocess,
int colnum,
int *tabnum);
664 RETCODE dbsetlshort(
LOGINREC * login,
int value,
int which);
666 RETCODE dbsendpassthru(
DBPROCESS * dbprocess, DBVOIDPTR bufp);
667 RETCODE dbrecvpassthru(
DBPROCESS * dbprocess, DBVOIDPTR * bufp);
669 RETCODE dbgetloginfo(
DBPROCESS * dbprocess, DBLOGINFO ** loginfo);
670 RETCODE dbsetloginfo(
LOGINREC * loginrec, DBLOGINFO * loginfo);
673 DBBINARY *dbtsnewval(
DBPROCESS * dbprocess);
674 RETCODE dbtsput(
DBPROCESS * dbprocess, DBBINARY * newts,
int newtslen,
int tabnum,
char *tabname);
676 RETCODE dbfree_xlate(
DBPROCESS * dbprocess, DBXLATE * xlt_tosrv, DBXLATE * clt_todisp);
677 int dbxlate(
DBPROCESS * dbprocess,
char *src,
int srclen,
char *dest,
int destlen, DBXLATE * xlt,
int *srcbytes_used,
678 DBBOOL srcend,
int status);
680 RETCODE bcp_moretext(
DBPROCESS * dbproc, DBINT size, BYTE * text);
681 RETCODE bcp_writefmt(
DBPROCESS * dbproc,
const char filename[]);
683 void build_xact_string(
char *xact_name,
char *service_name, DBINT commid,
char *result);
684 RETCODE remove_xact(
DBPROCESS * connect, DBINT commid,
int n);
685 RETCODE abort_xact(
DBPROCESS * connect, DBINT commid);
687 RETCODE commit_xact(
DBPROCESS * connect, DBINT commid);
689 RETCODE scan_xact(
DBPROCESS * connect, DBINT commid);
690 DBINT start_xact(
DBPROCESS * connect,
char *application_name,
char *xact_name,
int site_count);
691 DBINT stat_xact(
DBPROCESS * connect, DBINT commid);
697 RETCODE
dbaltbind(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
698 RETCODE dbaltbind_ps(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
706 RETCODE
dbbind(
DBPROCESS * dbproc,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
707 RETCODE dbbind_ps(
DBPROCESS * dbprocess,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
DBTYPEINFO * typeinfo);
713 DBBOOL dbcharsetconv(
DBPROCESS * dbprocess);
720 #define DBCMDROW(x) dbcmdrow((x))
729 DBINT
dbconvert(
DBPROCESS * dbproc,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen);
730 DBINT
dbconvert_ps(
DBPROCESS * dbprocess,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen,
735 #define DBCOUNT(x) dbcount((x))
738 #define DBCURCMD(x) dbcurcmd((x))
741 #define DBCURROW(x) dbcurrow((x))
749 #define DBDEAD(x) dbdead((x))
755 #define DBFIRSTROW(x) dbfirstrow((x))
758 char *dbgetcharset(
DBPROCESS * dbprocess);
759 int dbgetlusername(
LOGINREC * login, BYTE * name_buffer,
int buffer_len);
761 char *dbgetnatlanf(
DBPROCESS * dbprocess);
765 #define DBGETTIME dbgettime
771 #define DBIORDESC(x) dbiordesc((x))
774 #define DBIOWDESC(x) dbiowdesc((x))
777 #define DBISAVAIL(x) dbisavail((x))
781 #define DBLASTROW(x) dblastrow((x))
807 #define DBMORECMDS(x) dbmorecmds((x))
822 void dbpivot_count (
struct col_t *output,
const struct col_t *input);
823 void dbpivot_sum (
struct col_t *output,
const struct col_t *input);
824 void dbpivot_min (
struct col_t *output,
const struct col_t *input);
825 void dbpivot_max (
struct col_t *output,
const struct col_t *input);
828 typedef void (*DBPIVOT_FUNC)(
struct col_t *output,
const struct col_t *input);
831 RETCODE
dbpivot(
DBPROCESS *dbproc,
int nkeys,
int *keys,
int ncols,
int *cols, DBPIVOT_FUNC func,
int val);
833 DBPIVOT_FUNC dbpivot_lookup_name(
const char name[] );
836 #define dbopen(x,y) tdsdbopen((x),(y), 1)
838 #define dbopen(x,y) tdsdbopen((x),(y), 0)
842 #ifdef PHP_SYBASE_DBOPEN
843 #undef PHP_SYBASE_DBOPEN
844 #define PHP_SYBASE_DBOPEN dbopen
855 RETCODE dbresults_r(
DBPROCESS * dbproc,
int recursive);
863 #define DBROWS(x) dbrows((x))
866 #define DBROWTYPE(x) dbrowtype((x))
868 RETCODE
dbrpcparam(
DBPROCESS * dbproc,
const char paramname[], BYTE status,
int type, DBINT maxlen, DBINT datalen, BYTE * value);
870 RETCODE
dbsafestr(
DBPROCESS * dbproc,
const char *src, DBINT srclen,
char *dest, DBINT destlen,
int quotetype);
871 RETCODE *dbsechandle(DBINT type, INTFUNCPTR handler);
874 void dbsetbusy(
DBPROCESS * dbprocess, DB_DBBUSY_FUNC busyfunc);
875 RETCODE dbsetdefcharset(
char *charset);
876 void dbsetidle(
DBPROCESS * dbprocess, DB_DBIDLE_FUNC idlefunc);
882 RETCODE
dbsetopt(
DBPROCESS * dbproc,
int option,
const char *char_param,
int int_param);
896 int dbstrbuild(
DBPROCESS * dbproc,
char *charbuf,
int bufsize,
char *text,
char *formats, ...);
901 #define SYBEVERDOWN 100
902 #define SYBEICONVIU 2400
903 #define SYBEICONVAVAIL 2401
904 #define SYBEICONVO 2402
905 #define SYBEICONVI 2403
906 #define SYBEICONV2BIG 2404
909 #define SYBETDSVER 2410
910 #define SYBEPORT 2500
911 #define SYBESYNC 20001
912 #define SYBEFCON 20002
913 #define SYBETIME 20003
914 #define SYBEREAD 20004
915 #define SYBEBUFL 20005
916 #define SYBEWRIT 20006
917 #define SYBEVMS 20007
918 #define SYBESOCK 20008
919 #define SYBECONN 20009
920 #define SYBEMEM 20010
921 #define SYBEDBPS 20011
922 #define SYBEINTF 20012
923 #define SYBEUHST 20013
924 #define SYBEPWD 20014
925 #define SYBEOPIN 20015
926 #define SYBEINLN 20016
927 #define SYBESEOF 20017
928 #define SYBESMSG 20018
929 #define SYBERPND 20019
930 #define SYBEBTOK 20020
931 #define SYBEITIM 20021
932 #define SYBEOOB 20022
933 #define SYBEBTYP 20023
934 #define SYBEBNCR 20024
935 #define SYBEIICL 20025
936 #define SYBECNOR 20026
937 #define SYBENPRM 20027
938 #define SYBEUVDT 20028
939 #define SYBEUFDT 20029
940 #define SYBEWAID 20030
941 #define SYBECDNS 20031
942 #define SYBEABNC 20032
943 #define SYBEABMT 20033
944 #define SYBEABNP 20034
945 #define SYBEAAMT 20035
946 #define SYBENXID 20036
947 #define SYBERXID 20037
948 #define SYBEICN 20038
949 #define SYBENMOB 20039
950 #define SYBEAPUT 20040
951 #define SYBEASNL 20041
952 #define SYBENTLL 20042
953 #define SYBEASUL 20043
954 #define SYBERDNR 20044
955 #define SYBENSIP 20045
956 #define SYBEABNV 20046
957 #define SYBEDDNE 20047
958 #define SYBECUFL 20048
959 #define SYBECOFL 20049
960 #define SYBECSYN 20050
961 #define SYBECLPR 20051
962 #define SYBECNOV 20052
963 #define SYBERDCN 20053
964 #define SYBESFOV 20054
965 #define SYBEUNT 20055
966 #define SYBECLOS 20056
967 #define SYBEUAVE 20057
968 #define SYBEUSCT 20058
969 #define SYBEEQVA 20059
970 #define SYBEUDTY 20060
971 #define SYBETSIT 20061
972 #define SYBEAUTN 20062
973 #define SYBEBDIO 20063
974 #define SYBEBCNT 20064
975 #define SYBEIFNB 20065
976 #define SYBETTS 20066
977 #define SYBEKBCO 20067
978 #define SYBEBBCI 20068
979 #define SYBEKBCI 20069
980 #define SYBEBCRE 20070
981 #define SYBETPTN 20071
982 #define SYBEBCWE 20072
983 #define SYBEBCNN 20073
984 #define SYBEBCOR 20074
985 #define SYBEBCIS 20075
986 #define SYBEBCPI 20076
987 #define SYBEBCPN 20077
988 #define SYBEBCPB 20078
989 #define SYBEVDPT 20079
990 #define SYBEBIVI 20080
991 #define SYBEBCBC 20081
992 #define SYBEBCFO 20082
993 #define SYBEBCVH 20083
994 #define SYBEBCUO 20084
995 #define SYBEBCUC 20085
996 #define SYBEBUOE 20086
997 #define SYBEBUCE 20087
998 #define SYBEBWEF 20088
999 #define SYBEASTF 20089
1000 #define SYBEUACS 20090
1001 #define SYBEASEC 20091
1002 #define SYBETMTD 20092
1003 #define SYBENTTN 20093
1004 #define SYBEDNTI 20094
1005 #define SYBEBTMT 20095
1006 #define SYBEORPF 20096
1007 #define SYBEUVBF 20097
1008 #define SYBEBUOF 20098
1009 #define SYBEBUCF 20099
1010 #define SYBEBRFF 20100
1011 #define SYBEBWFF 20101
1012 #define SYBEBUDF 20102
1013 #define SYBEBIHC 20103
1014 #define SYBEBEOF 20104
1015 #define SYBEBCNL 20105
1016 #define SYBEBCSI 20106
1017 #define SYBEBCIT 20107
1018 #define SYBEBCSA 20108
1019 #define SYBENULL 20109
1020 #define SYBEUNAM 20110
1021 #define SYBEBCRO 20111
1022 #define SYBEMPLL 20112
1023 #define SYBERPIL 20113
1024 #define SYBERPUL 20114
1025 #define SYBEUNOP 20115
1026 #define SYBECRNC 20116
1027 #define SYBERTCC 20117
1028 #define SYBERTSC 20118
1029 #define SYBEUCRR 20119
1030 #define SYBERPNA 20120
1031 #define SYBEOPNA 20121
1032 #define SYBEFGTL 20122
1033 #define SYBECWLL 20123
1034 #define SYBEUFDS 20124
1035 #define SYBEUCPT 20125
1036 #define SYBETMCF 20126
1037 #define SYBEAICF 20127
1038 #define SYBEADST 20128
1039 #define SYBEALTT 20129
1040 #define SYBEAPCT 20130
1041 #define SYBEXOCI 20131
1042 #define SYBEFSHD 20132
1043 #define SYBEAOLF 20133
1044 #define SYBEARDI 20134
1045 #define SYBEURCI 20135
1046 #define SYBEARDL 20136
1047 #define SYBEURMI 20137
1048 #define SYBEUREM 20138
1049 #define SYBEURES 20139
1050 #define SYBEUREI 20140
1051 #define SYBEOREN 20141
1052 #define SYBEISOI 20142
1053 #define SYBEIDCL 20143
1054 #define SYBEIMCL 20144
1055 #define SYBEIFCL 20145
1056 #define SYBEUTDS 20146
1057 #define SYBEBUFF 20147
1058 #define SYBEACNV 20148
1059 #define SYBEDPOR 20149
1060 #define SYBENDC 20150
1061 #define SYBEMVOR 20151
1062 #define SYBEDVOR 20152
1063 #define SYBENBVP 20153
1064 #define SYBESPID 20154
1065 #define SYBENDTP 20155
1066 #define SYBEXTN 20156
1067 #define SYBEXTDN 20157
1068 #define SYBEXTSN 20158
1069 #define SYBENUM 20159
1070 #define SYBETYPE 20160
1071 #define SYBEGENOS 20161
1072 #define SYBEPAGE 20162
1073 #define SYBEOPTNO 20163
1074 #define SYBEETD 20164
1075 #define SYBERTYPE 20165
1076 #define SYBERFILE 20166
1077 #define SYBEFMODE 20167
1078 #define SYBESLCT 20168
1079 #define SYBEZTXT 20169
1080 #define SYBENTST 20170
1081 #define SYBEOSSL 20171
1082 #define SYBEESSL 20172
1083 #define SYBENLNL 20173
1084 #define SYBENHAN 20174
1085 #define SYBENBUF 20175
1086 #define SYBENULP 20176
1087 #define SYBENOTI 20177
1088 #define SYBEEVOP 20178
1089 #define SYBENEHA 20179
1090 #define SYBETRAN 20180
1091 #define SYBEEVST 20181
1092 #define SYBEEINI 20182
1093 #define SYBEECRT 20183
1094 #define SYBEECAN 20184
1095 #define SYBEEUNR 20185
1096 #define SYBERPCS 20186
1097 #define SYBETPAR 20187
1098 #define SYBETEXS 20188
1099 #define SYBETRAC 20189
1100 #define SYBETRAS 20190
1101 #define SYBEPRTF 20191
1102 #define SYBETRSN 20192
1103 #define SYBEBPKS 20193
1104 #define SYBEIPV 20194
1105 #define SYBEMOV 20195
1106 #define SYBEDIVZ 20196
1107 #define SYBEASTL 20197
1108 #define SYBESEFA 20198
1109 #define SYBEPOLL 20199
1110 #define SYBENOEV 20200
1111 #define SYBEBADPK 20201
1112 #define SYBESECURE 20202
1113 #define SYBECAP 20203
1114 #define SYBEFUNC 20204
1115 #define SYBERESP 20205
1116 #define SYBEIVERS 20206
1117 #define SYBEONCE 20207
1118 #define SYBERPNULL 20208
1119 #define SYBERPTXTIM 20209
1120 #define SYBENEG 20210
1121 #define SYBELBLEN 20211
1122 #define SYBEUMSG 20212
1123 #define SYBECAPTYP 20213
1124 #define SYBEBNUM 20214
1125 #define SYBEBBL 20215
1126 #define SYBEBPREC 20216
1127 #define SYBEBSCALE 20217
1128 #define SYBECDOMAIN 20218
1129 #define SYBECINTERNAL 20219
1130 #define SYBEBTYPSRV 20220
1131 #define SYBEBCSET 20221
1132 #define SYBEFENC 20222
1133 #define SYBEFRES 20223
1134 #define SYBEISRVPREC 20224
1135 #define SYBEISRVSCL 20225
1136 #define SYBEINUMCL 20226
1137 #define SYBEIDECCL 20227
1138 #define SYBEBCMTXT 20228
1139 #define SYBEBCPREC 20229
1140 #define SYBEBCBNPR 20230
1141 #define SYBEBCBNTYP 20231
1142 #define SYBEBCSNTYP 20232
1143 #define SYBEBCPCTYP 20233
1144 #define SYBEBCVLEN 20234
1145 #define SYBEBCHLEN 20235
1146 #define SYBEBCBPREF 20236
1147 #define SYBEBCPREF 20237
1148 #define SYBEBCITBNM 20238
1149 #define SYBEBCITBLEN 20239
1150 #define SYBEBCSNDROW 20240
1151 #define SYBEBPROCOL 20241
1152 #define SYBEBPRODEF 20242
1153 #define SYBEBPRONUMDEF 20243
1154 #define SYBEBPRODEFID 20244
1155 #define SYBEBPRONODEF 20245
1156 #define SYBEBPRODEFTYP 20246
1157 #define SYBEBPROEXTDEF 20247
1158 #define SYBEBPROEXTRES 20248
1159 #define SYBEBPROBADDEF 20249
1160 #define SYBEBPROBADTYP 20250
1161 #define SYBEBPROBADLEN 20251
1162 #define SYBEBPROBADPREC 20252
1163 #define SYBEBPROBADSCL 20253
1164 #define SYBEBADTYPE 20254
1165 #define SYBECRSNORES 20255
1166 #define SYBECRSNOIND 20256
1167 #define SYBECRSVIEW 20257
1168 #define SYBECRSVIIND 20258
1169 #define SYBECRSORD 20259
1170 #define SYBECRSBUFR 20260
1171 #define SYBECRSNOFREE 20261
1172 #define SYBECRSDIS 20262
1173 #define SYBECRSAGR 20263
1174 #define SYBECRSFRAND 20264
1175 #define SYBECRSFLAST 20265
1176 #define SYBECRSBROL 20266
1177 #define SYBECRSFROWN 20267
1178 #define SYBECRSBSKEY 20268
1179 #define SYBECRSRO 20269
1180 #define SYBECRSNOCOUNT 20270
1181 #define SYBECRSTAB 20271
1182 #define SYBECRSUPDNB 20272
1183 #define SYBECRSNOWHERE 20273
1184 #define SYBECRSSET 20274
1185 #define SYBECRSUPDTAB 20275
1186 #define SYBECRSNOUPD 20276
1187 #define SYBECRSINV 20277
1188 #define SYBECRSNOKEYS 20278
1189 #define SYBECRSNOBIND 20279
1190 #define SYBECRSFTYPE 20280
1191 #define SYBECRSINVALID 20281
1192 #define SYBECRSMROWS 20282
1193 #define SYBECRSNROWS 20283
1194 #define SYBECRSNOLEN 20284
1195 #define SYBECRSNOPTCC 20285
1196 #define SYBECRSNORDER 20286
1197 #define SYBECRSNOTABLE 20287
1198 #define SYBECRSNUNIQUE 20288
1199 #define SYBECRSVAR 20289
1200 #define SYBENOVALUE 20290
1201 #define SYBEVOIDRET 20291
1202 #define SYBECLOSEIN 20292
1203 #define SYBEBOOL 20293
1204 #define SYBEBCPOPT 20294
1205 #define SYBEERRLABEL 20295
1206 #define SYBEATTNACK 20296
1207 #define SYBEBBFL 20297
1208 #define SYBEDCL 20298
1209 #define SYBECS 20299
1210 #define SYBEBULKINSERT 20599
1211 #define SYBECOLSIZE 22000
1215 #define DBTDS(a) dbtds(a)
1216 DBINT dbtextsize(
DBPROCESS * dbprocess);
1219 DBBINARY *dbtxtsnewval(
DBPROCESS * dbprocess);
1220 RETCODE dbtxtsput(
DBPROCESS * dbprocess, DBBINARY newtxts,
int colnum);
1224 RETCODE
dbwritetext(
DBPROCESS * dbproc,
char *objname, DBBINARY * textptr, DBTINYINT textptrlen, DBBINARY * timestamp,
1225 DBBOOL log, DBINT size, BYTE * text);
1234 #define DBSETLHOST(x,y) dbsetlname((x), (y), DBSETHOST)
1235 #define dbsetlhost(x,y) dbsetlname((x), (y), DBSETHOST)
1237 #define DBSETLUSER(x,y) dbsetlname((x), (y), DBSETUSER)
1238 #define dbsetluser(x,y) dbsetlname((x), (y), DBSETUSER)
1240 #define DBSETLPWD(x,y) dbsetlname((x), (y), DBSETPWD)
1241 #define dbsetlpwd(x,y) dbsetlname((x), (y), DBSETPWD)
1242 #if defined(DBLIB_UNIMPLEMENTED)
1244 # define DBSETLHID(x,y) dbsetlname((x), (y), DBSETHID)
1247 #define DBSETLAPP(x,y) dbsetlname((x), (y), DBSETAPP)
1248 #define dbsetlapp(x,y) dbsetlname((x), (y), DBSETAPP)
1250 #define BCP_SETL(x,y) dbsetlbool((x), (y), DBSETBCP)
1251 #define DBSETLSECURE(x) dbsetlbool((x), (1), DBSETBCP)
1252 #define DBSETNATLANG 7
1253 #define DBSETLNATLANG(x,y) dbsetlname((x), (y), DBSETNATLANG)
1254 #define dbsetlnatlang(x,y) dbsetlname((x), (y), DBSETNATLANG)
1255 #if defined(DBLIB_UNIMPLEMENTED)
1256 # define DBSETNOSHORT 8
1257 # define DBSETLNOSHORT(x,y) dbsetlbool((x), (y), DBSETNOSHORT)
1258 # define DBSETHIER 9
1259 # define DBSETLHIER(x,y) dbsetlshort((x), (y), DBSETHIER)
1261 #define DBSETCHARSET 10
1262 #define DBSETLCHARSET(x,y) dbsetlname((x), (y), DBSETCHARSET)
1263 #define DBSETPACKET 11
1264 #define DBSETLPACKET(x,y) dbsetllong((x), (y), DBSETPACKET)
1265 #define dbsetlpacket(x,y) dbsetllong((x), (y), DBSETPACKET)
1266 #define DBSETENCRYPT 12
1267 #define DBSETLENCRYPT(x,y) dbsetlbool((x), (y), DBSETENCRYPT)
1268 #define DBSETLABELED 13
1269 #define DBSETLLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1270 #define BCP_SETLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1271 #define DBSETDBNAME 14
1272 #define DBSETLDBNAME(x,y) dbsetlname((x), (y), DBSETDBNAME)
1273 #define DBSETLVERSION(login, version) dbsetlversion((login), (version))
1275 RETCODE
bcp_init(
DBPROCESS * dbproc,
const char *tblname,
const char *hfile,
const char *errfile,
int direction);
1279 RETCODE
bcp_bind(
DBPROCESS * dbproc, BYTE * varaddr,
int prefixlen, DBINT varlen, BYTE * terminator,
int termlen,
int type,
1283 RETCODE
bcp_colfmt(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1284 const BYTE * host_term,
int host_termlen,
int colnum);
1285 RETCODE
bcp_colfmt_ps(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1286 BYTE * host_term,
int host_termlen,
int colnum,
DBTYPEINFO * typeinfo);
1289 int bcp_getbatchsize(
DBPROCESS * dbproc);
RETCODE dbsetlbool(LOGINREC *login, int value, int which)
Set a boolean value in a LOGINREC structure.
Definition: dblib.c:897
RETCODE dbsetlogintime(int seconds)
Set maximum seconds db-lib waits for a server response to a login attempt.
Definition: dblib.c:4046
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition: dblib.c:4945
RETCODE dbanullbind(DBPROCESS *dbprocess, int computeid, int column, DBINT *indicator)
Tie a null-indicator to a compute result column.
Definition: dblib.c:2722
RETCODE dbmnycopy(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Copy a DBMONEY value.
Definition: dblib.c:5820
void dbsetifile(char *filename)
set name and location of the interfaces file FreeTDS should use to look up a servername.
Definition: dblib.c:2657
BYTE * dbgetuserdata(DBPROCESS *dbproc)
Get address of user-allocated data from a DBPROCESS.
Definition: dblib.c:5769
RETCODE bcp_columns(DBPROCESS *dbproc, int host_colcount)
Indicate how many columns are to be found in the datafile.
Definition: bcp.c:298
BYTE * dbadata(DBPROCESS *dbproc, int computeid, int column)
Get address of compute column data.
Definition: dblib.c:4231
RETCODE dbmny4zero(DBPROCESS *dbproc, DBMONEY4 *dest)
Zero a DBMONEY4 value.
Definition: dblib.c:5375
int dbdatecmp(DBPROCESS *dbproc, DBDATETIME *d1, DBDATETIME *d2)
Compare DBDATETIME values, similar to strcmp(3).
Definition: dblib.c:5570
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
char * dbservcharset(DBPROCESS *dbprocess)
Get syscharset name of the server character set.
Definition: dblib.c:6817
RETCODE bcp_sendrow(DBPROCESS *dbproc)
Write data in host variables to the table.
Definition: bcp.c:1326
DBBOOL dbisopt(DBPROCESS *dbproc, int option, const char param[])
Get value of an option.
Definition: dblib.c:5957
RETCODE dbbind(DBPROCESS *dbproc, int column, int vartype, DBINT varlen, BYTE *varaddr)
Tie a host variable to a resultset column.
Definition: dblib.c:2580
void dbclose(DBPROCESS *dbproc)
Close a connection to the server and free associated resources.
Definition: dblib.c:1457
void dbclrbuf(DBPROCESS *dbproc, DBINT n)
Clear n rows from the row buffer.
Definition: dblib.c:2790
RETCODE dbstrcpy(DBPROCESS *dbproc, int start, int numbytes, char *dest)
Get a copy of a chunk of the command buffer.
Definition: dblib.c:6139
const char * dbprtype(int token)
Print a token value's name to a buffer.
Definition: dblib.c:6244
int dbmnycmp(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2)
Compare two DBMONEY values.
Definition: dblib.c:5071
BYTE * dbretdata(DBPROCESS *dbproc, int retnum)
Get value of an output parameter filled by a stored procedure.
Definition: dblib.c:4555
DBPROCESS * dbopen(LOGINREC *login, const char *server)
Normally not used.
Definition: dbopen.c:38
RETCODE dbsetnull(DBPROCESS *dbprocess, int bindtype, int bindlen, BYTE *bindval)
Define substitution values to be used when binding null values.
Definition: dblib.c:1913
DBINT dbcurrow(DBPROCESS *dbproc)
Get number of the row currently being read.
Definition: dblib.c:5980
RETCODE dbmorecmds(DBPROCESS *dbproc)
See if more commands are to be processed.
Definition: dblib.c:6031
DBINT dbcount(DBPROCESS *dbproc)
Get count of rows processed.
Definition: dblib.c:2770
STATUS dbreadtext(DBPROCESS *dbproc, void *buf, DBINT bufsize)
Fetch part of a text or image value from the server.
Definition: dblib.c:6459
DBINT bcp_done(DBPROCESS *dbproc)
Conclude the transfer of data from program variables.
Definition: bcp.c:1966
void dbsetavail(DBPROCESS *dbprocess)
Mark a DBPROCESS as "available".
Definition: dblib.c:7070
DBINT bcp_batch(DBPROCESS *dbproc)
Commit a set of rows to the table.
Definition: bcp.c:1939
DBBINARY * dbtxtimestamp(DBPROCESS *dbproc, int column)
Get text timestamp for a column in the current row.
Definition: dblib.c:6323
DBBINARY * dbtxptr(DBPROCESS *dbproc, int column)
Get text pointer for a column in the current row.
Definition: dblib.c:6353
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition: dblib.c:2837
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:6183
DBINT dbvarylen(DBPROCESS *dbproc, int column)
Determine whether a column can vary in size.
Definition: dblib.c:3089
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 bcp_options(DBPROCESS *dbproc, int option, BYTE *value, int valuelen)
Set "hints" for uploading a file.
Definition: bcp.c:609
RETCODE dbsprline(DBPROCESS *dbproc, char *buffer, DBINT buf_len, DBCHAR line_char)
Get formatted string for underlining dbsprhead() column names.
Definition: dblib.c:3647
int dbspid(DBPROCESS *dbproc)
Get server process ID for a DBPROCESS.
Definition: dblib.c:5725
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 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
void dbsetuserdata(DBPROCESS *dbproc, BYTE *ptr)
Associate client-allocated (and defined) data with a DBPROCESS.
Definition: dblib.c:5751
int dbiowdesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to write data coming to the server...
Definition: dblib.c:7042
DBINT dbspr1rowlen(DBPROCESS *dbproc)
Determine size buffer required to hold the results returned by dbsprhead(), dbsprline(), and dbspr1row().
Definition: dblib.c:3224
RETCODE dbcmdrow(DBPROCESS *dbproc)
See if the current command can return rows.
Definition: dblib.c:4067
RETCODE dbgetrow(DBPROCESS *dbproc, DBINT row)
Read a row from the row buffer.
Definition: dblib.c:1881
int dbgetpacket(DBPROCESS *dbproc)
Get TDS packet size for the connection.
Definition: dblib.c:3884
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:7095
DBPROCESS * tdsdbopen(LOGINREC *login, const char *server, int msdblib)
Form a connection with the server.
Definition: dblib.c:1152
RETCODE dbsetlname(LOGINREC *login, const char *value, int which)
Set the value of a string in a LOGINREC structure.
Definition: dblib.c:763
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 * dbcolsource(DBPROCESS *dbproc, int colnum)
Get base database column name for a result set column.
Definition: dblib.c:3015
RETCODE dbmnyzero(DBPROCESS *dbproc, DBMONEY *dest)
Set a DBMONEY value to zero.
Definition: dblib.c:5129
DBBOOL dbdead(DBPROCESS *dbproc)
Check if dbproc is an ex-parrot.
Definition: dblib.c:4863
RETCODE dbmny4add(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *sum)
Add two DBMONEY4 values.
Definition: dblib.c:5398
RETCODE dbsetmaxprocs(int maxprocs)
Set maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3908
Definition: dbpivot.c:761
int dbiordesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to read data coming from the server...
Definition: dblib.c:7026
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition: dblib.c:713
RETCODE dbmnymaxneg(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum negative DBMONEY value supported.
Definition: dblib.c:5171
Definition: bsqlodbc.c:97
BYTE * dbdata(DBPROCESS *dbproc, int column)
Get address of data in a regular result column.
Definition: dblib.c:3166
char * dbchange(DBPROCESS *dbprocess)
See if a command caused the current database to change.
Definition: dblib.c:6781
RETCODE dbmnydec(DBPROCESS *dbproc, DBMONEY *mnyptr)
Subtract $0.0001 from a DBMONEY value.
Definition: dblib.c:5296
int dbaltcolid(DBPROCESS *dbproc, int computeid, int column)
Get column ID of a compute column.
Definition: dblib.c:4091
char * dbretname(DBPROCESS *dbproc, int retnum)
Get name of an output parameter filled by a stored procedure.
Definition: dblib.c:4526
DBINT dbdatlen(DBPROCESS *dbproc, int column)
Get size of current row's data in a regular result column.
Definition: dblib.c:3138
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
void dbrecftos(const char filename[])
Record to a file all SQL commands sent to the server.
Definition: dblib.c:6563
RETCODE dbsetlversion(LOGINREC *login, BYTE version)
Set TDS version for future connections.
Definition: dblib.c:926
RETCODE dbdatecrack(DBPROCESS *dbproc, DBDATEREC *di, DBDATETIME *dt)
Break a DBDATETIME value into useful pieces.
Definition: dblib.c:5652
RETCODE dbmoretext(DBPROCESS *dbproc, DBINT size, const BYTE text[])
Send chunk of a text/image value to the server.
Definition: dblib.c:6528
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
void dbprhead(DBPROCESS *dbproc)
Print result set headings to stdout.
Definition: dblib.c:3768
DBINT dbcolutype(DBPROCESS *dbprocess, int column)
Get user-defined datatype of a regular result column.
Definition: dblib.c:2866
DBINT dbadlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in a compute column.
Definition: dblib.c:4118
BYTE * dbbylist(DBPROCESS *dbproc, int computeid, int *size)
Get bylist for a compute row.
Definition: dblib.c:4804
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition: dblib.c:1388
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition: dblib.c:4926
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
DBUBIGINT time
time, 7 digit precision
Definition: sybdb.h:301
int dbgetmaxprocs(void)
get maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3982
int dbnumcompute(DBPROCESS *dbprocess)
Get count of COMPUTE clauses for a result set.
Definition: dblib.c:4778
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
int dbnumrets(DBPROCESS *dbproc)
Get count of output parameters filled by a stored procedure.
Definition: dblib.c:4494
RETCODE dbrpcinit(DBPROCESS *dbproc, const char rpcname[], DBSMALLINT options)
Initialize a remote procedure call.
Definition: rpc.c:74
RETCODE dbprrow(DBPROCESS *dbproc)
Print a result set to stdout.
Definition: dblib.c:3344
int dbnumcols(DBPROCESS *dbproc)
Return number of regular columns in a result set.
Definition: dblib.c:1825
const char * dbmonthname(DBPROCESS *dbproc, char *language, int monthnum, DBBOOL shortform)
Get name of a month, in some human language.
Definition: dblib.c:6752
RETCODE dbsetopt(DBPROCESS *dbproc, int option, const char *char_param, int int_param)
Set db-lib or server option.
Definition: dblib.c:4289
DBSMALLINT offset
time offset
Definition: sybdb.h:303
DBINT dbfirstrow(DBPROCESS *dbproc)
See if a server response has arrived.
Definition: dblib.c:6987
RETCODE dbsprhead(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print result set headings to a buffer.
Definition: dblib.c:3705
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition: dblib.c:1676
RETCODE dbfcmd(DBPROCESS *dbproc, const char *fmt,...)
printf-like way to form SQL to send to the server.
Definition: dblib.c:1297
RETCODE dbnullbind(DBPROCESS *dbproc, int column, DBINT *indicator)
Tie a null-indicator to a regular result column.
Definition: dblib.c:2686
DBINT dbprcollen(DBPROCESS *dbproc, int column)
Get size of a result column needed to print column.
Definition: dblib.c:3063
RETCODE dbmny4sub(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *diff)
Subtract two DBMONEY4 values.
Definition: dblib.c:5429
int dbretlen(DBPROCESS *dbproc, int retnum)
Get size of an output parameter filled by a stored procedure.
Definition: dblib.c:4584
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
RETCODE bcp_readfmt(DBPROCESS *dbproc, const char filename[])
Read a format definition file.
Definition: bcp.c:1614
const char * dbversion(void)
See which version of db-lib is in use.
Definition: dblib.c:6634
int dbstrlen(DBPROCESS *dbproc)
Get size of the command buffer, in bytes.
Definition: dblib.c:6087
DBBOOL bcp_getl(LOGINREC *login)
See if BCP_SETL() was used to set the LOGINREC for BCP work.
Definition: bcp.c:693
int dbnumalts(DBPROCESS *dbproc, int computeid)
Get count of columns in a compute row.
Definition: dblib.c:4745
RETCODE dbmnymaxpos(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum positive DBMONEY value supported.
Definition: dblib.c:5150
STATUS dbrowtype(DBPROCESS *dbprocess)
Get returned row's type.
Definition: dblib.c:5997
char * dbcolname(DBPROCESS *dbproc, int column)
Return name of a regular result column.
Definition: dblib.c:1849
int dbgettime(void)
Get maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4030
RETCODE dbrows(DBPROCESS *dbproc)
Indicate whether a query returned rows.
Definition: dblib.c:3843
RETCODE dbmnyinc(DBPROCESS *dbproc, DBMONEY *mnyptr)
Add $0.0001 to a DBMONEY value.
Definition: dblib.c:5268
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:6261
int dbtds(DBPROCESS *dbprocess)
Get the TDS version in use for dbproc.
Definition: dblib.c:6597
DBINT date
date, 0 = 1900-01-01
Definition: sybdb.h:302
RETCODE dbsetversion(DBINT version)
Specify a db-lib version level.
Definition: dblib.c:5787
RETCODE dbsqlsend(DBPROCESS *dbproc)
Transmit the command buffer to the server.
Definition: dblib.c:6837
int dbalttype(DBPROCESS *dbproc, int computeid, int column)
Get datatype for a compute column.
Definition: dblib.c:4149
DBINT dbcollen(DBPROCESS *dbproc, int column)
Get size of a regular result column.
Definition: dblib.c:3040
RETCODE dbcanquery(DBPROCESS *dbproc)
Cancel the query currently being retrieved, discarding all pending rows.
Definition: dblib.c:5841
BOOL dbiscount(DBPROCESS *dbproc)
Indicates whether or not the count returned by dbcount is real (Microsoft-compatibility feature)...
Definition: dblib.c:2750
RETCODE dbspr1row(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print a regular result row to a buffer.
Definition: dblib.c:3262
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
Definition: dblib.c:1336
DBINT dbaltutype(DBPROCESS *dbproc, int computeid, int column)
Get user-defined datatype of a compute column.
Definition: dblib.c:6908
int dbcurcmd(DBPROCESS *dbproc)
Get number of the row just returned.
Definition: dblib.c:6014
RETCODE dbmny4copy(DBPROCESS *dbprocess, DBMONEY4 *m1, DBMONEY4 *m2)
Copy a DBMONEY4 value.
Definition: dblib.c:5545
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
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
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Definition: dblib.c:6801
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 dblastrow(DBPROCESS *dbproc)
Get number of the last row in the row buffer.
Definition: dblib.c:7002
RETCODE dbsqlok(DBPROCESS *dbproc)
Wait for results of a query from the server.
Definition: dblib.c:4619
RETCODE dbanydatecrack(DBPROCESS *dbproc, DBDATEREC2 *di, int type, const void *data)
Break any kind of date or time value into useful pieces.
Definition: dblib.c:5673
DBTYPEINFO * dbcoltypeinfo(DBPROCESS *dbproc, int column)
Get precision and scale information for a regular result column.
Definition: dblib.c:2889
void dbloginfree(LOGINREC *login)
free the LOGINREC
Definition: dblib.c:741
void dbfreebuf(DBPROCESS *dbproc)
Erase the command buffer, in case DBNOAUTOFREE was set with dbsetopt().
Definition: dblib.c:5871
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 dbsettime(int seconds)
Set maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4003
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition: bcp.c:535
STATUS dbsetrow(DBPROCESS *dbprocess, DBINT row)
Make a buffered row "current" without fetching it into bound variables.
Definition: dblib.c:1992
RETCODE dbmnyminus(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Negate a DBMONEY value.
Definition: dblib.c:5324
RETCODE dbuse(DBPROCESS *dbproc, const char *name)
Change current database.
Definition: dblib.c:1414
char * dbgetchar(DBPROCESS *dbprocess, int n)
Get address of a position in the command buffer.
Definition: dblib.c:6106
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:6390
RETCODE dbclropt(DBPROCESS *dbproc, int option, const char param[])
Reset an option.
Definition: dblib.c:5905
RETCODE dbinit(void)
Initialize db-lib.
Definition: dblib.c:668
DBBOOL dbhasretstat(DBPROCESS *dbproc)
Determine if query generated a return status number.
Definition: dblib.c:4452
int dbrettype(DBPROCESS *dbproc, int retnum)
Get datatype of a stored procedure's return parameter.
Definition: dblib.c:6062
DBBOOL dbwillconvert(int srctype, int desttype)
Test whether or not a datatype can be converted to another datatype.
Definition: dblib.c:2820
DBINT dbaltlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in compute column.
Definition: dblib.c:6932
DBINT dbretstatus(DBPROCESS *dbproc)
Fetch status value returned by query or remote procedure call.
Definition: dblib.c:4476
RETCODE dbsetllong(LOGINREC *login, long value, int which)
Set an integer value in a LOGINREC structure.
Definition: dblib.c:826
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 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:4261