31#include "tds_sysdep_public.h"
35#define TDS_STATIC_CAST(type, a) static_cast<type>(a)
42#define TDS_STATIC_CAST(type, a) ((type)(a))
70#define DBVERSION_UNKNOWN 0
72#define DBVERSION_100 2
81#define DBVER42 DBVERSION_42
82#define DBVER60 DBVERSION_70
88#define DBTDS_UNKNOWN 0
97#define DBTDS_8_0 ("Use DBTDS_7_1 instead"*x)
98#define DBTDS_9_0 ("Use DBTDS_7_2 instead"*x)
111#define BCPKEEPIDENTITY 8
117#define BCPDRYRUN 1001
125typedef void DBCURSOR;
127typedef void DBSORTORDER;
128typedef void DBLOGINFO;
129typedef void *DBVOIDPTR;
131typedef unsigned short USHORT;
132typedef int (*INTFUNCPTR) (
void *, ...);
133typedef int (*DBWAITFUNC) (void);
134typedef DBWAITFUNC(*DB_DBBUSY_FUNC) (
void *dbproc);
135typedef void (*DB_DBIDLE_FUNC) (DBWAITFUNC dfunc,
void *dbproc);
136typedef int (*DB_DBCHKINTR_FUNC) (
void *dbproc);
137typedef int (*DB_DBHNDLINTR_FUNC) (
void *dbproc);
151#if !defined(_WINDEF_) && !defined(_WINDEF_H) && !defined(DOS32X)
156#ifndef _tdsguard_hfOrWb5znoUCWdBPoNQvqN_
162#define SYBCHAR SYBCHAR
164#define SYBVARCHAR SYBVARCHAR
166#define SYBINTN SYBINTN
168#define SYBINT1 SYBINT1
170#define SYBINT2 SYBINT2
172#define SYBINT4 SYBINT4
174#define SYBINT8 SYBINT8
176#define SYBFLT8 SYBFLT8
178#define SYBDATETIME SYBDATETIME
182#define SYBBITN SYBBITN
184#define SYBTEXT SYBTEXT
186#define SYBNTEXT SYBNTEXT
188#define SYBIMAGE SYBIMAGE
190#define SYBMONEY4 SYBMONEY4
192#define SYBMONEY SYBMONEY
194#define SYBDATETIME4 SYBDATETIME4
196#define SYBREAL SYBREAL
198#define SYBBINARY SYBBINARY
200#define SYBVOID SYBVOID
202#define SYBVARBINARY SYBVARBINARY
204#define SYBNUMERIC SYBNUMERIC
206#define SYBDECIMAL SYBDECIMAL
208#define SYBFLTN SYBFLTN
210#define SYBMONEYN SYBMONEYN
212#define SYBDATETIMN SYBDATETIMN
214#define SYBNVARCHAR SYBNVARCHAR
216#define SYBDATE SYBDATE
218#define SYBTIME SYBTIME
219 SYBBIGDATETIME = 187,
220#define SYBBIGDATETIME SYBBIGDATETIME
222#define SYBBIGTIME SYBBIGTIME
224#define SYBMSDATE SYBMSDATE
226#define SYBMSTIME SYBMSTIME
228#define SYBMSDATETIME2 SYBMSDATETIME2
229 SYBMSDATETIMEOFFSET = 43,
230#define SYBMSDATETIMEOFFSET SYBMSDATETIMEOFFSET
233#define SYBAOPCNT 0x4b
234#define SYBAOPCNTU 0x4c
235#define SYBAOPSUM 0x4d
236#define SYBAOPSUMU 0x4e
237#define SYBAOPAVG 0x4f
238#define SYBAOPAVGU 0x50
239#define SYBAOPMIN 0x51
240#define SYBAOPMAX 0x52
243#define SYBAOPCNT_BIG 0x09
244#define SYBAOPSTDEV 0x30
245#define SYBAOPSTDEVP 0x31
246#define SYBAOPVAR 0x32
247#define SYBAOPVARP 0x33
248#define SYBAOPCHECKSUM_AGG 0x72
252typedef unsigned char DBBOOL;
254typedef unsigned char DBBIT;
255typedef unsigned char DBTINYINT;
256typedef int16_t DBSMALLINT;
257typedef int32_t DBINT;
258typedef int64_t DBBIGINT;
259typedef unsigned char DBBINARY;
260typedef tds_sysdep_real32_type DBREAL;
261typedef tds_sysdep_real64_type DBFLT8;
262typedef uint16_t DBUSMALLINT;
263typedef uint32_t DBUINT;
264typedef uint64_t DBUBIGINT;
275 unsigned char array[256];
280 unsigned char precision;
282 unsigned char array[33];
315 DBUSMALLINT time_prec:3;
319 DBUSMALLINT has_time:1;
320 DBUSMALLINT has_date:1;
321 DBUSMALLINT has_offset:1;
325# define SQLCHAR SYBCHAR
336typedef unsigned char BYTE;
355{ MAXCOLNAMELEN = 512 };
356typedef enum { CI_REGULAR=1, CI_ALTERNATE=2, CI_CURSOR=3 } CI_TYPE;
361 DBCHAR Name[MAXCOLNAMELEN+2];
362 DBCHAR ActualName[MAXCOLNAMELEN+2];
363 DBCHAR TableName[MAXCOLNAMELEN+2];
380 DBCHAR Name[MAXCOLNAMELEN+2];
381 DBCHAR ActualName[MAXCOLNAMELEN+2];
382 DBCHAR TableName[MAXCOLNAMELEN+2];
394 DBINT ServerMaxLength;
395 DBCHAR ServerTypeDeclaration[256];
406#define DBARITHIGNORE 4
408#define DBARITHABORT 6
415#define DBSTORPROCID 13
417#define DBNOAUTOFREE 15
421#define DBDATEFORMAT 19
424#define DBPRLINELEN 22
425#define DBPRLINESEP 23
426#define DBLFCONVERT 24
427#define DBDATEFIRST 25
428#define DBCHAINXACTS 26
430#define DBISOLATION 28
434#define DBDATESHORT 32
435#define DBCLIENTCURSORS 33
437#define DBQUOTEDIDENT 35
439#define DBNUMOPTIONS 36
447#define NOSUCHOPTION 2
534typedef int (*EHANDLEFUNC) (DBPROCESS * dbproc,
int severity,
int dberr,
int oserr,
char *dberrstr,
char *oserrstr);
536typedef int (*MHANDLEFUNC) (DBPROCESS * dbproc, DBINT msgno,
int msgstate,
int severity,
char *msgtext,
char *srvname,
537 char *proc,
int line);
541#define DBNOTIFICATION 2
551#define NTBSTRINGBIND 2
552#define VARYCHARBIND 3
559#define DATETIMEBIND 11
560#define SMALLDATETIMEBIND 12
562#define SMALLMONEYBIND 14
565#define NUMERICBIND 17
566#define DECIMALBIND 18
567#define SRCNUMERICBIND 19
568#define SRCDECIMALBIND 20
571#define BIGDATETIMEBIND 23
572#define BIGTIMEBIND 24
574#define DATETIME2BIND 31
575#define MAXBINDTYPES 32
578#define DBPRLINELEN 22
579#define DBRPCNORETURN 0
581#define DBRPCDEFAULT 2
585#define NO_MORE_ROWS -2
587#define NO_MORE_RESULTS 2
600#define DBRPCRECOMPILE TDS_STATIC_CAST(DBSMALLINT, 0x0001)
601#define DBRPCRESET TDS_STATIC_CAST(DBSMALLINT, 0x0002)
602#define DBRPCCURSOR TDS_STATIC_CAST(DBSMALLINT, 0x0008)
604#if defined(DBLIB_UNIMPLEMENTED)
605DBBOOL db12hour(DBPROCESS * dbprocess,
const char language[]);
607DBBOOL dbcolbrowse(DBPROCESS * dbprocess,
int colnum);
609RETCODE dbcursor(DBCURSOR * hc, DBINT optype, DBINT bufno, BYTE * table, BYTE * values);
610RETCODE dbcursorbind(DBCURSOR * hc,
int col,
int vartype, DBINT varlen, DBINT * poutlen, BYTE * pvaraddr, DBTYPEINFO * typeinfo);
611void dbcursorclose(DBCURSOR * hc);
612RETCODE dbcursorcolinfo(DBCURSOR * hc, DBINT column, DBCHAR * colname, DBINT * coltype, DBINT * collen, DBINT * usertype);
613RETCODE dbcursorfetch(DBCURSOR * hc, DBINT fetchtype, DBINT rownum);
614RETCODE dbcursorinfo(DBCURSOR * hc, DBINT * ncols, DBINT * nrows);
615DBCURSOR *dbcursoropen(DBPROCESS * dbprocess, BYTE * stmt, SHORT scollopt, SHORT concuropt, USHORT nrows, DBINT * pstatus);
618RETCODE dbdate4zero(DBPROCESS * dbprocess,
DBDATETIME4 * d1);
619RETCODE dbdatechar(DBPROCESS * dbprocess,
char *buf,
int datepart,
int value);
620int dbdatename(DBPROCESS * dbprocess,
char *buf,
int date,
DBDATETIME * datetime);
621char *dateorder(DBPROCESS * dbprocess,
char *language);
622DBINT dbdatepart(DBPROCESS * dbprocess,
int datepart,
DBDATETIME * datetime);
623RETCODE dbdatezero(DBPROCESS * dbprocess,
DBDATETIME * d1);
624char *dbdayname(DBPROCESS * dbprocess,
char *language,
int daynum);
626int dbgetoff(DBPROCESS * dbprocess, DBUSMALLINT offtype,
int startfrom);
628char *dbqual(DBPROCESS * dbprocess,
int tabnum,
char *tabname);
629void dbfreequal(
char *qualptr);
631DBSORTORDER *dbloadsort(DBPROCESS * dbprocess);
632RETCODE dbfreesort(DBPROCESS * dbprocess, DBSORTORDER * sortorder);
634RETCODE dbload_xlate(DBPROCESS * dbprocess,
char *srv_charset,
char *clt_name, DBXLATE ** xlt_tosrv, DBXLATE ** xlt_todisp);
640RETCODE dbmnydown(DBPROCESS * dbproc,
DBMONEY * mnyptr,
int divisor,
int *remainder);
641RETCODE dbmnyinit(DBPROCESS * dbproc,
DBMONEY * mnyptr,
int trim, DBBOOL * negative);
642RETCODE dbmnyndigit(DBPROCESS * dbproc,
DBMONEY * mnyptr, DBCHAR * value, DBBOOL * zero);
644RETCODE dbmnydigit(DBPROCESS * dbprocess,
DBMONEY * m1, DBCHAR * value, DBBOOL * zero);
645RETCODE dbmnyscale(DBPROCESS * dbproc,
DBMONEY * dest,
int multiplier,
int addend);
648RETCODE dbnpcreate(DBPROCESS * dbprocess);
649RETCODE dbnpdefine(DBPROCESS * dbprocess, DBCHAR * procedure_name, DBSMALLINT namelen);
651int DBNUMORDERS(DBPROCESS * dbprocess);
653RETCODE dbpoll(DBPROCESS * dbproc,
long milliseconds, DBPROCESS ** ready_dbproc,
int *return_reason);
654int dbordercol(DBPROCESS * dbprocess,
int order);
656RETCODE dbregdrop(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
657RETCODE dbregexec(DBPROCESS * dbproc, DBUSMALLINT options);
658RETCODE dbreghandle(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, INTFUNCPTR handler);
659RETCODE dbreginit(DBPROCESS * dbproc, DBCHAR * procedure_name, DBSMALLINT namelen);
660RETCODE dbreglist(DBPROCESS * dbproc);
661RETCODE dbregnowatch(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
662RETCODE dbregparam(DBPROCESS * dbproc,
char *param_name,
int type, DBINT datalen, BYTE * data);
663RETCODE dbregwatch(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, DBUSMALLINT options);
664RETCODE dbregwatchlist(DBPROCESS * dbprocess);
667RETCODE dbrpwset(
LOGINREC * login,
char *srvname,
char *password,
int pwlen);
669DBINT dbreadpage(DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, BYTE * buf);
670RETCODE dbwritepage(DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, DBINT size, BYTE * buf);
672RETCODE dbsetdeflang(
char *language);
674int dbstrcmp(DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
675int dbstrsort(DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
677DBBOOL dbtabbrowse(DBPROCESS * dbprocess,
int tabnum);
678int dbtabcount(DBPROCESS * dbprocess);
679char *dbtabname(DBPROCESS * dbprocess,
int tabnum);
680char *dbtabsource(DBPROCESS * dbprocess,
int colnum,
int *tabnum);
682RETCODE dbsendpassthru(DBPROCESS * dbprocess, DBVOIDPTR bufp);
683RETCODE dbrecvpassthru(DBPROCESS * dbprocess, DBVOIDPTR * bufp);
685RETCODE dbgetloginfo(DBPROCESS * dbprocess, DBLOGINFO ** loginfo);
686RETCODE dbsetloginfo(
LOGINREC * loginrec, DBLOGINFO * loginfo);
688int dbtsnewlen(DBPROCESS * dbprocess);
689DBBINARY *dbtsnewval(DBPROCESS * dbprocess);
690RETCODE dbtsput(DBPROCESS * dbprocess, DBBINARY * newts,
int newtslen,
int tabnum,
char *tabname);
692RETCODE dbfree_xlate(DBPROCESS * dbprocess, DBXLATE * xlt_tosrv, DBXLATE * clt_todisp);
693int dbxlate(DBPROCESS * dbprocess,
char *src,
int srclen,
char *dest,
int destlen, DBXLATE * xlt,
int *srcbytes_used,
694 DBBOOL srcend,
int status);
696RETCODE bcp_moretext(DBPROCESS * dbproc, DBINT size, BYTE * text);
697RETCODE bcp_writefmt(DBPROCESS * dbproc,
const char filename[]);
699void build_xact_string(
char *xact_name,
char *service_name, DBINT commid,
char *result);
700RETCODE remove_xact(DBPROCESS * connect, DBINT commid,
int n);
701RETCODE abort_xact(DBPROCESS * connect, DBINT commid);
702void close_commit(DBPROCESS * connect);
703RETCODE commit_xact(DBPROCESS * connect, DBINT commid);
704DBPROCESS *open_commit(
LOGINREC * login,
char *servername);
705RETCODE scan_xact(DBPROCESS * connect, DBINT commid);
706DBINT start_xact(DBPROCESS * connect,
char *application_name,
char *xact_name,
int site_count);
707DBINT stat_xact(DBPROCESS * connect, DBINT commid);
711BYTE *
dbadata(DBPROCESS * dbproc,
int computeid,
int column);
712DBINT
dbadlen(DBPROCESS * dbproc,
int computeid,
int column);
713RETCODE
dbaltbind(DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
714RETCODE dbaltbind_ps(DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
715 DBTYPEINFO * typeinfo);
716int dbaltcolid(DBPROCESS * dbproc,
int computeid,
int column);
717DBINT
dbaltlen(DBPROCESS * dbproc,
int computeid,
int column);
718int dbaltop(DBPROCESS * dbproc,
int computeid,
int column);
719int dbalttype(DBPROCESS * dbproc,
int computeid,
int column);
720DBINT
dbaltutype(DBPROCESS * dbproc,
int computeid,
int column);
721RETCODE
dbanullbind(DBPROCESS * dbprocess,
int computeid,
int column, DBINT * indicator);
722RETCODE
dbbind(DBPROCESS * dbproc,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
723RETCODE dbbind_ps(DBPROCESS * dbprocess,
int column,
int vartype, DBINT varlen, BYTE * varaddr, DBTYPEINFO * typeinfo);
724int dbbufsize(DBPROCESS * dbprocess);
725BYTE *
dbbylist(DBPROCESS * dbproc,
int computeid,
int *size);
726RETCODE
dbcancel(DBPROCESS * dbproc);
728char *
dbchange(DBPROCESS * dbprocess);
729DBBOOL dbcharsetconv(DBPROCESS * dbprocess);
730void dbclose(DBPROCESS * dbproc);
731void dbclrbuf(DBPROCESS * dbproc, DBINT n);
732RETCODE
dbclropt(DBPROCESS * dbproc,
int option,
const char param[]);
733RETCODE
dbcmd(DBPROCESS * dbproc,
const char cmdstring[]);
734RETCODE
dbcmdrow(DBPROCESS * dbproc);
736#define DBCMDROW(x) dbcmdrow((x))
738RETCODE
dbcolinfo (DBPROCESS *dbproc, CI_TYPE type, DBINT column, DBINT computeid,
DBCOL *pdbcol);
739DBINT
dbcollen(DBPROCESS * dbproc,
int column);
740char *
dbcolname(DBPROCESS * dbproc,
int column);
741const char *
dbacolname(DBPROCESS * dbproc,
int computeid,
int column);
743int dbcoltype(DBPROCESS * dbproc,
int column);
745DBINT
dbcolutype(DBPROCESS * dbprocess,
int column);
746DBINT
dbconvert(DBPROCESS * dbproc,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen);
747DBINT
dbconvert_ps(DBPROCESS * dbprocess,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen,
748 DBTYPEINFO * typeinfo);
750DBINT
dbcount(DBPROCESS * dbproc);
752#define DBCOUNT(x) dbcount((x))
755#define DBCURCMD(x) dbcurcmd((x))
758#define DBCURROW(x) dbcurrow((x))
759BYTE *
dbdata(DBPROCESS * dbproc,
int column);
762RETCODE
dbanydatecrack(DBPROCESS * dbproc, DBDATEREC2 * di,
int type,
const void *data);
763DBINT
dbdatlen(DBPROCESS * dbproc,
int column);
764DBBOOL
dbdead(DBPROCESS * dbproc);
766#define DBDEAD(x) dbdead((x))
769RETCODE
dbfcmd(DBPROCESS * dbproc,
const char *fmt, ...);
772#define DBFIRSTROW(x) dbfirstrow((x))
774char *
dbgetchar(DBPROCESS * dbprocess,
int n);
775char *dbgetcharset(DBPROCESS * dbprocess);
776int dbgetlusername(
LOGINREC * login, BYTE * name_buffer,
int buffer_len);
778char *dbgetnatlanf(DBPROCESS * dbprocess);
780RETCODE
dbgetrow(DBPROCESS * dbproc, DBINT row);
782#define DBGETTIME dbgettime
788#define DBIORDESC(x) dbiordesc((x))
791#define DBIOWDESC(x) dbiowdesc((x))
792DBBOOL dbisavail(DBPROCESS * dbprocess);
794#define DBISAVAIL(x) dbisavail((x))
795DBBOOL
dbisopt(DBPROCESS * dbproc,
int option,
const char param[]);
798#define DBLASTROW(x) dblastrow((x))
821const char *
dbmonthname(DBPROCESS * dbproc,
char *language,
int monthnum, DBBOOL shortform);
824#define DBMORECMDS(x) dbmorecmds((x))
825RETCODE
dbmoretext(DBPROCESS * dbproc, DBINT size,
const BYTE text[]);
827char *
dbname(DBPROCESS * dbproc);
828STATUS dbnextrow(DBPROCESS * dbproc);
829RETCODE
dbnullbind(DBPROCESS * dbproc,
int column, DBINT * indicator);
830int dbnumalts(DBPROCESS * dbproc,
int computeid);
835DBPROCESS *dbopen(
LOGINREC * login,
const char *server);
839void dbpivot_count (
struct col_t *output,
const struct col_t *input);
840void dbpivot_sum (
struct col_t *output,
const struct col_t *input);
841void dbpivot_min (
struct col_t *output,
const struct col_t *input);
842void dbpivot_max (
struct col_t *output,
const struct col_t *input);
845typedef void (*DBPIVOT_FUNC)(
struct col_t *output,
const struct col_t *input);
846struct pivot_t * dbrows_pivoted(DBPROCESS *dbproc);
847STATUS dbnextrow_pivoted(DBPROCESS *dbproc,
struct pivot_t *pp);
848RETCODE
dbpivot(DBPROCESS *dbproc,
int nkeys,
int *keys,
int ncols,
int *cols, DBPIVOT_FUNC func,
int val);
850DBPIVOT_FUNC dbpivot_lookup_name(
const char name[] );
853#define dbopen(x,y) tdsdbopen((x),(y), 1)
855#define dbopen(x,y) tdsdbopen((x),(y), 0)
859#ifdef PHP_SYBASE_DBOPEN
860#undef PHP_SYBASE_DBOPEN
861#define PHP_SYBASE_DBOPEN dbopen
865DBINT
dbprcollen(DBPROCESS * dbproc,
int column);
866RETCODE
dbprrow(DBPROCESS * dbproc);
868DBBOOL DRBUF(DBPROCESS * dbprocess);
869STATUS
dbreadtext(DBPROCESS * dbproc,
void *buf, DBINT bufsize);
872RETCODE dbresults_r(DBPROCESS * dbproc,
int recursive);
873BYTE *
dbretdata(DBPROCESS * dbproc,
int retnum);
874int dbretlen(DBPROCESS * dbproc,
int retnum);
875char *
dbretname(DBPROCESS * dbproc,
int retnum);
877int dbrettype(DBPROCESS * dbproc,
int retnum);
878RETCODE
dbrows(DBPROCESS * dbproc);
880#define DBROWS(x) dbrows((x))
883#define DBROWTYPE(x) dbrowtype((x))
884RETCODE
dbrpcinit(DBPROCESS * dbproc,
const char rpcname[], DBSMALLINT options);
885RETCODE
dbrpcparam(DBPROCESS * dbproc,
const char paramname[], BYTE status,
int type, DBINT maxlen, DBINT datalen, BYTE * value);
887RETCODE
dbsafestr(DBPROCESS * dbproc,
const char *src, DBINT srclen,
char *dest, DBINT destlen,
int quotetype);
888RETCODE *dbsechandle(DBINT type, INTFUNCPTR handler);
891void dbsetbusy(DBPROCESS * dbprocess, DB_DBBUSY_FUNC busyfunc);
892RETCODE dbsetdefcharset(
char *charset);
893void dbsetidle(DBPROCESS * dbprocess, DB_DBIDLE_FUNC idlefunc);
895void dbsetinterrupt(DBPROCESS * dbproc, DB_DBCHKINTR_FUNC chkintr, DB_DBHNDLINTR_FUNC hndlintr);
898RETCODE
dbsetnull(DBPROCESS * dbprocess,
int bindtype,
int bindlen, BYTE * bindval);
899RETCODE
dbsetopt(DBPROCESS * dbproc,
int option,
const char *char_param,
int int_param);
900STATUS
dbsetrow(DBPROCESS * dbprocess, DBINT row);
905int dbspid(DBPROCESS * dbproc);
906RETCODE
dbspr1row(DBPROCESS * dbproc,
char *buffer, DBINT buf_len);
908RETCODE
dbsprhead(DBPROCESS * dbproc,
char *buffer, DBINT buf_len);
909RETCODE
dbsprline(DBPROCESS * dbproc,
char *buffer, DBINT buf_len, DBCHAR line_char);
911RETCODE
dbsqlok(DBPROCESS * dbproc);
913int dbstrbuild(DBPROCESS * dbproc,
char *charbuf,
int bufsize,
char *text,
char *formats, ...);
914RETCODE
dbstrcpy(DBPROCESS * dbproc,
int start,
int numbytes,
char *dest);
916DBINT
dbvarylen(DBPROCESS * dbproc,
int column);
918#define SYBEVERDOWN 100
919#define SYBEICONVIU 2400
920#define SYBEICONVAVAIL 2401
921#define SYBEICONVO 2402
922#define SYBEICONVI 2403
923#define SYBEICONV2BIG 2404
926#define SYBETDSVER 2410
928#define SYBESYNC 20001
929#define SYBEFCON 20002
930#define SYBETIME 20003
931#define SYBEREAD 20004
932#define SYBEBUFL 20005
933#define SYBEWRIT 20006
935#define SYBESOCK 20008
936#define SYBECONN 20009
938#define SYBEDBPS 20011
939#define SYBEINTF 20012
940#define SYBEUHST 20013
942#define SYBEOPIN 20015
943#define SYBEINLN 20016
944#define SYBESEOF 20017
945#define SYBESMSG 20018
946#define SYBERPND 20019
947#define SYBEBTOK 20020
948#define SYBEITIM 20021
950#define SYBEBTYP 20023
951#define SYBEBNCR 20024
952#define SYBEIICL 20025
953#define SYBECNOR 20026
954#define SYBENPRM 20027
955#define SYBEUVDT 20028
956#define SYBEUFDT 20029
957#define SYBEWAID 20030
958#define SYBECDNS 20031
959#define SYBEABNC 20032
960#define SYBEABMT 20033
961#define SYBEABNP 20034
962#define SYBEAAMT 20035
963#define SYBENXID 20036
964#define SYBERXID 20037
966#define SYBENMOB 20039
967#define SYBEAPUT 20040
968#define SYBEASNL 20041
969#define SYBENTLL 20042
970#define SYBEASUL 20043
971#define SYBERDNR 20044
972#define SYBENSIP 20045
973#define SYBEABNV 20046
974#define SYBEDDNE 20047
975#define SYBECUFL 20048
976#define SYBECOFL 20049
977#define SYBECSYN 20050
978#define SYBECLPR 20051
979#define SYBECNOV 20052
980#define SYBERDCN 20053
981#define SYBESFOV 20054
983#define SYBECLOS 20056
984#define SYBEUAVE 20057
985#define SYBEUSCT 20058
986#define SYBEEQVA 20059
987#define SYBEUDTY 20060
988#define SYBETSIT 20061
989#define SYBEAUTN 20062
990#define SYBEBDIO 20063
991#define SYBEBCNT 20064
992#define SYBEIFNB 20065
994#define SYBEKBCO 20067
995#define SYBEBBCI 20068
996#define SYBEKBCI 20069
997#define SYBEBCRE 20070
998#define SYBETPTN 20071
999#define SYBEBCWE 20072
1000#define SYBEBCNN 20073
1001#define SYBEBCOR 20074
1002#define SYBEBCIS 20075
1003#define SYBEBCPI 20076
1004#define SYBEBCPN 20077
1005#define SYBEBCPB 20078
1006#define SYBEVDPT 20079
1007#define SYBEBIVI 20080
1008#define SYBEBCBC 20081
1009#define SYBEBCFO 20082
1010#define SYBEBCVH 20083
1011#define SYBEBCUO 20084
1012#define SYBEBCUC 20085
1013#define SYBEBUOE 20086
1014#define SYBEBUCE 20087
1015#define SYBEBWEF 20088
1016#define SYBEASTF 20089
1017#define SYBEUACS 20090
1018#define SYBEASEC 20091
1019#define SYBETMTD 20092
1020#define SYBENTTN 20093
1021#define SYBEDNTI 20094
1022#define SYBEBTMT 20095
1023#define SYBEORPF 20096
1024#define SYBEUVBF 20097
1025#define SYBEBUOF 20098
1026#define SYBEBUCF 20099
1027#define SYBEBRFF 20100
1028#define SYBEBWFF 20101
1029#define SYBEBUDF 20102
1030#define SYBEBIHC 20103
1031#define SYBEBEOF 20104
1032#define SYBEBCNL 20105
1033#define SYBEBCSI 20106
1034#define SYBEBCIT 20107
1035#define SYBEBCSA 20108
1036#define SYBENULL 20109
1037#define SYBEUNAM 20110
1038#define SYBEBCRO 20111
1039#define SYBEMPLL 20112
1040#define SYBERPIL 20113
1041#define SYBERPUL 20114
1042#define SYBEUNOP 20115
1043#define SYBECRNC 20116
1044#define SYBERTCC 20117
1045#define SYBERTSC 20118
1046#define SYBEUCRR 20119
1047#define SYBERPNA 20120
1048#define SYBEOPNA 20121
1049#define SYBEFGTL 20122
1050#define SYBECWLL 20123
1051#define SYBEUFDS 20124
1052#define SYBEUCPT 20125
1053#define SYBETMCF 20126
1054#define SYBEAICF 20127
1055#define SYBEADST 20128
1056#define SYBEALTT 20129
1057#define SYBEAPCT 20130
1058#define SYBEXOCI 20131
1059#define SYBEFSHD 20132
1060#define SYBEAOLF 20133
1061#define SYBEARDI 20134
1062#define SYBEURCI 20135
1063#define SYBEARDL 20136
1064#define SYBEURMI 20137
1065#define SYBEUREM 20138
1066#define SYBEURES 20139
1067#define SYBEUREI 20140
1068#define SYBEOREN 20141
1069#define SYBEISOI 20142
1070#define SYBEIDCL 20143
1071#define SYBEIMCL 20144
1072#define SYBEIFCL 20145
1073#define SYBEUTDS 20146
1074#define SYBEBUFF 20147
1075#define SYBEACNV 20148
1076#define SYBEDPOR 20149
1077#define SYBENDC 20150
1078#define SYBEMVOR 20151
1079#define SYBEDVOR 20152
1080#define SYBENBVP 20153
1081#define SYBESPID 20154
1082#define SYBENDTP 20155
1083#define SYBEXTN 20156
1084#define SYBEXTDN 20157
1085#define SYBEXTSN 20158
1086#define SYBENUM 20159
1087#define SYBETYPE 20160
1088#define SYBEGENOS 20161
1089#define SYBEPAGE 20162
1090#define SYBEOPTNO 20163
1091#define SYBEETD 20164
1092#define SYBERTYPE 20165
1093#define SYBERFILE 20166
1094#define SYBEFMODE 20167
1095#define SYBESLCT 20168
1096#define SYBEZTXT 20169
1097#define SYBENTST 20170
1098#define SYBEOSSL 20171
1099#define SYBEESSL 20172
1100#define SYBENLNL 20173
1101#define SYBENHAN 20174
1102#define SYBENBUF 20175
1103#define SYBENULP 20176
1104#define SYBENOTI 20177
1105#define SYBEEVOP 20178
1106#define SYBENEHA 20179
1107#define SYBETRAN 20180
1108#define SYBEEVST 20181
1109#define SYBEEINI 20182
1110#define SYBEECRT 20183
1111#define SYBEECAN 20184
1112#define SYBEEUNR 20185
1113#define SYBERPCS 20186
1114#define SYBETPAR 20187
1115#define SYBETEXS 20188
1116#define SYBETRAC 20189
1117#define SYBETRAS 20190
1118#define SYBEPRTF 20191
1119#define SYBETRSN 20192
1120#define SYBEBPKS 20193
1121#define SYBEIPV 20194
1122#define SYBEMOV 20195
1123#define SYBEDIVZ 20196
1124#define SYBEASTL 20197
1125#define SYBESEFA 20198
1126#define SYBEPOLL 20199
1127#define SYBENOEV 20200
1128#define SYBEBADPK 20201
1129#define SYBESECURE 20202
1130#define SYBECAP 20203
1131#define SYBEFUNC 20204
1132#define SYBERESP 20205
1133#define SYBEIVERS 20206
1134#define SYBEONCE 20207
1135#define SYBERPNULL 20208
1136#define SYBERPTXTIM 20209
1137#define SYBENEG 20210
1138#define SYBELBLEN 20211
1139#define SYBEUMSG 20212
1140#define SYBECAPTYP 20213
1141#define SYBEBNUM 20214
1142#define SYBEBBL 20215
1143#define SYBEBPREC 20216
1144#define SYBEBSCALE 20217
1145#define SYBECDOMAIN 20218
1146#define SYBECINTERNAL 20219
1147#define SYBEBTYPSRV 20220
1148#define SYBEBCSET 20221
1149#define SYBEFENC 20222
1150#define SYBEFRES 20223
1151#define SYBEISRVPREC 20224
1152#define SYBEISRVSCL 20225
1153#define SYBEINUMCL 20226
1154#define SYBEIDECCL 20227
1155#define SYBEBCMTXT 20228
1156#define SYBEBCPREC 20229
1157#define SYBEBCBNPR 20230
1158#define SYBEBCBNTYP 20231
1159#define SYBEBCSNTYP 20232
1160#define SYBEBCPCTYP 20233
1161#define SYBEBCVLEN 20234
1162#define SYBEBCHLEN 20235
1163#define SYBEBCBPREF 20236
1164#define SYBEBCPREF 20237
1165#define SYBEBCITBNM 20238
1166#define SYBEBCITBLEN 20239
1167#define SYBEBCSNDROW 20240
1168#define SYBEBPROCOL 20241
1169#define SYBEBPRODEF 20242
1170#define SYBEBPRONUMDEF 20243
1171#define SYBEBPRODEFID 20244
1172#define SYBEBPRONODEF 20245
1173#define SYBEBPRODEFTYP 20246
1174#define SYBEBPROEXTDEF 20247
1175#define SYBEBPROEXTRES 20248
1176#define SYBEBPROBADDEF 20249
1177#define SYBEBPROBADTYP 20250
1178#define SYBEBPROBADLEN 20251
1179#define SYBEBPROBADPREC 20252
1180#define SYBEBPROBADSCL 20253
1181#define SYBEBADTYPE 20254
1182#define SYBECRSNORES 20255
1183#define SYBECRSNOIND 20256
1184#define SYBECRSVIEW 20257
1185#define SYBECRSVIIND 20258
1186#define SYBECRSORD 20259
1187#define SYBECRSBUFR 20260
1188#define SYBECRSNOFREE 20261
1189#define SYBECRSDIS 20262
1190#define SYBECRSAGR 20263
1191#define SYBECRSFRAND 20264
1192#define SYBECRSFLAST 20265
1193#define SYBECRSBROL 20266
1194#define SYBECRSFROWN 20267
1195#define SYBECRSBSKEY 20268
1196#define SYBECRSRO 20269
1197#define SYBECRSNOCOUNT 20270
1198#define SYBECRSTAB 20271
1199#define SYBECRSUPDNB 20272
1200#define SYBECRSNOWHERE 20273
1201#define SYBECRSSET 20274
1202#define SYBECRSUPDTAB 20275
1203#define SYBECRSNOUPD 20276
1204#define SYBECRSINV 20277
1205#define SYBECRSNOKEYS 20278
1206#define SYBECRSNOBIND 20279
1207#define SYBECRSFTYPE 20280
1208#define SYBECRSINVALID 20281
1209#define SYBECRSMROWS 20282
1210#define SYBECRSNROWS 20283
1211#define SYBECRSNOLEN 20284
1212#define SYBECRSNOPTCC 20285
1213#define SYBECRSNORDER 20286
1214#define SYBECRSNOTABLE 20287
1215#define SYBECRSNUNIQUE 20288
1216#define SYBECRSVAR 20289
1217#define SYBENOVALUE 20290
1218#define SYBEVOIDRET 20291
1219#define SYBECLOSEIN 20292
1220#define SYBEBOOL 20293
1221#define SYBEBCPOPT 20294
1222#define SYBEERRLABEL 20295
1223#define SYBEATTNACK 20296
1224#define SYBEBBFL 20297
1225#define SYBEDCL 20298
1227#define SYBEBULKINSERT 20599
1228#define SYBECOLSIZE 22000
1230int dbtds(DBPROCESS * dbprocess);
1232#define DBTDS(a) dbtds(a)
1233DBINT dbtextsize(DBPROCESS * dbprocess);
1234DBBINARY *
dbtxptr(DBPROCESS * dbproc,
int column);
1236DBBINARY *dbtxtsnewval(DBPROCESS * dbprocess);
1237RETCODE dbtxtsput(DBPROCESS * dbprocess, DBBINARY newtxts,
int colnum);
1238RETCODE
dbuse(DBPROCESS * dbproc,
const char *name);
1241RETCODE
dbwritetext(DBPROCESS * dbproc,
char *objname, DBBINARY * textptr, DBTINYINT textptrlen, DBBINARY * timestamp,
1242 DBBOOL log, DBINT size, BYTE * text);
1252#define DBSETLHOST(x,y) dbsetlname((x), (y), DBSETHOST)
1253#define dbsetlhost(x,y) dbsetlname((x), (y), DBSETHOST)
1255#define DBSETLUSER(x,y) dbsetlname((x), (y), DBSETUSER)
1256#define dbsetluser(x,y) dbsetlname((x), (y), DBSETUSER)
1258#define DBSETLPWD(x,y) dbsetlname((x), (y), DBSETPWD)
1259#define dbsetlpwd(x,y) dbsetlname((x), (y), DBSETPWD)
1260#if defined(DBLIB_UNIMPLEMENTED)
1262# define DBSETLHID(x,y) dbsetlname((x), (y), DBSETHID)
1265#define DBSETLAPP(x,y) dbsetlname((x), (y), DBSETAPP)
1266#define dbsetlapp(x,y) dbsetlname((x), (y), DBSETAPP)
1268#define BCP_SETL(x,y) dbsetlbool((x), (y), DBSETBCP)
1269#define DBSETLSECURE(x) dbsetlbool((x), (1), DBSETBCP)
1270#define DBSETNATLANG 7
1271#define DBSETLNATLANG(x,y) dbsetlname((x), (y), DBSETNATLANG)
1272#define dbsetlnatlang(x,y) dbsetlname((x), (y), DBSETNATLANG)
1273#if defined(DBLIB_UNIMPLEMENTED)
1274# define DBSETNOSHORT 8
1275# define DBSETLNOSHORT(x,y) dbsetlbool((x), (y), DBSETNOSHORT)
1277# define DBSETLHIER(x,y) dbsetlshort((x), (y), DBSETHIER)
1279#define DBSETCHARSET 10
1280#define DBSETLCHARSET(x,y) dbsetlname((x), (y), DBSETCHARSET)
1281#define DBSETPACKET 11
1282#define DBSETLPACKET(x,y) dbsetllong((x), (y), DBSETPACKET)
1283#define dbsetlpacket(x,y) dbsetllong((x), (y), DBSETPACKET)
1284#define DBSETENCRYPT 12
1285#define DBSETLENCRYPT(x,y) dbsetlbool((x), (y), DBSETENCRYPT)
1286#define DBSETLABELED 13
1287#define DBSETLLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1288#define BCP_SETLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1289#define DBSETDBNAME 14
1290#define DBSETLDBNAME(x,y) dbsetlname((x), (y), DBSETDBNAME)
1291#define DBSETLVERSION(login, version) dbsetlversion((login), (version))
1292#define DBSETNETWORKAUTH 101
1293#define DBSETLNETWORKAUTH(x, y) dbsetlbool((x), (y), DBSETNETWORKAUTH)
1294#define DBSETMUTUALAUTH 102
1295#define DBSETLMUTUALAUTH(x, y) dbsetlbool((x), (y), DBSETMUTUALAUTH)
1296#define DBSETSERVERPRINCIPAL 103
1297#define DBSETLSERVERPRINCIPAL(x,y) dbsetlname((x), (y), DBSETSERVERPRINCIPAL)
1299#define DBSETUTF16 1001
1300#define DBSETLUTF16(x,y) dbsetlbool((x), (y), DBSETUTF16)
1301#define DBSETNTLMV2 1002
1302#define DBSETLNTLMV2(x,y) dbsetlbool((x), (y), DBSETNTLMV2)
1303#define DBSETREADONLY 1003
1304#define DBSETLREADONLY(x,y) dbsetlbool((x), (y), DBSETREADONLY)
1305#define DBSETDELEGATION 1004
1306#define DBSETLDELEGATION(x, y) dbsetlbool((x), (y), DBSETDELEGATION)
1307#define DBSETENCRYPTION 1005
1308#define DBSETLENCRYPTION(x, y) dbsetlname((x), (y), DBSETENCRYPTION)
1309#define DBSETPORT 1006
1310#define DBSETLPORT(x,y) dbsetlshort((x), (y), DBSETPORT)
1312RETCODE
bcp_init(DBPROCESS * dbproc,
const char *tblname,
const char *hfile,
const char *errfile,
int direction);
1316RETCODE
bcp_bind(DBPROCESS * dbproc, BYTE * varaddr,
int prefixlen, DBINT varlen, BYTE * terminator,
int termlen,
int type,
1318RETCODE
bcp_collen(DBPROCESS * dbproc, DBINT varlen,
int table_column);
1319RETCODE
bcp_columns(DBPROCESS * dbproc,
int host_colcount);
1320RETCODE
bcp_colfmt(DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1321 const BYTE * host_term,
int host_termlen,
int colnum);
1322RETCODE
bcp_colfmt_ps(DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1323 BYTE * host_term,
int host_termlen,
int colnum, DBTYPEINFO * typeinfo);
1324RETCODE
bcp_colptr(DBPROCESS * dbproc, BYTE * colptr,
int table_column);
1325RETCODE
bcp_control(DBPROCESS * dbproc,
int field, DBINT value);
1326int bcp_getbatchsize(DBPROCESS * dbproc);
1327int bcp_gethostcolcount(DBPROCESS * dbproc);
1328RETCODE
bcp_exec(DBPROCESS * dbproc, DBINT * rows_copied);
1330RETCODE
bcp_options(DBPROCESS * dbproc,
int option, BYTE * value,
int valuelen);
1331RETCODE
bcp_readfmt(DBPROCESS * dbproc,
const char filename[]);
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:3091
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:976
void dbclrbuf(DBPROCESS *dbproc, DBINT n)
Clear n rows from the row buffer.
Definition dblib.c:2889
DBTYPEINFO * dbcoltypeinfo(DBPROCESS *dbproc, int column)
Get precision and scale information for a regular result column.
Definition dblib.c:3062
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition dblib.c:726
void dbfreebuf(DBPROCESS *dbproc)
Erase the command buffer, in case DBNOAUTOFREE was set with dbsetopt().
Definition dblib.c:6132
BYTE * dbdata(DBPROCESS *dbproc, int column)
Get address of data in a regular result column.
Definition dblib.c:3400
int dbstrlen(DBPROCESS *dbproc)
Get size of the command buffer, in bytes.
Definition dblib.c:6363
BYTE * dbadata(DBPROCESS *dbproc, int computeid, int column)
Get address of compute column data.
Definition dblib.c:4491
int dbspid(DBPROCESS *dbproc)
Get server process ID for a DBPROCESS.
Definition dblib.c:5992
DBBINARY * dbtxtimestamp(DBPROCESS *dbproc, int column)
Get text timestamp for a column in the current row.
Definition dblib.c:6603
BYTE * dbbylist(DBPROCESS *dbproc, int computeid, int *size)
Get bylist for a compute row.
Definition dblib.c:5075
char * dbservcharset(DBPROCESS *dbprocess)
Get syscharset name of the server character set.
Definition dblib.c:7102
DBINT dbspr1rowlen(DBPROCESS *dbproc)
Determine size buffer required to hold the results returned by dbsprhead(), dbsprline(),...
Definition dblib.c:3467
DBINT dbconvert(DBPROCESS *dbproc, int srctype, const BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen)
cf.
Definition dblib.c:2641
DBINT dbadlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in a compute column.
Definition dblib.c:4386
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:4707
RETCODE dbsetnull(DBPROCESS *dbprocess, int bindtype, int bindlen, BYTE *bindval)
Define substitution values to be used when binding null values.
Definition dblib.c:2010
char * dbcolname(DBPROCESS *dbproc, int column)
Return name of a regular result column.
Definition dblib.c:1920
RETCODE dbfcmd(DBPROCESS *dbproc, const char *fmt,...)
printf-like way to form SQL to send to the server.
Definition dblib.c:1379
RETCODE dbdatecrack(DBPROCESS *dbproc, DBDATEREC *di, DBDATETIME *dt)
Break a DBDATETIME value into useful pieces.
Definition dblib.c:5919
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition dblib.c:1742
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:6670
RETCODE dbcanquery(DBPROCESS *dbproc)
Cancel the query currently being retrieved, discarding all pending rows.
Definition dblib.c:6103
RETCODE dbinit(void)
Initialize db-lib.
Definition dblib.c:675
DBINT dbvarylen(DBPROCESS *dbproc, int column)
Determine whether a column can vary in size.
Definition dblib.c:3264
RETCODE dbcancel(DBPROCESS *dbproc)
Cancel the current command batch.
Definition dblib.c:3442
RETCODE dbsetlogintime(int seconds)
Set maximum seconds db-lib waits for a server response to a login attempt.
Definition dblib.c:4315
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:7379
RETCODE dbgetrow(DBPROCESS *dbproc, DBINT row)
Read a row from the row buffer.
Definition dblib.c:1978
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition dblib.c:3016
void dbsetifile(char *filename)
set name and location of the interfaces file FreeTDS should use to look up a servername.
Definition dblib.c:2759
RETCODE dbuse(DBPROCESS *dbproc, const char *name)
Change current database.
Definition dblib.c:1490
int dbnumalts(DBPROCESS *dbproc, int computeid)
Get count of columns in a compute row.
Definition dblib.c:5016
BOOL dbiscount(DBPROCESS *dbproc)
Indicates whether or not the count returned by dbcount is real (Microsoft-compatibility feature).
Definition dblib.c:2849
int dbgettime(void)
Get maximum seconds db-lib waits for a server response to query.
Definition dblib.c:4299
RETCODE dbmoretext(DBPROCESS *dbproc, DBINT size, const BYTE text[])
Send chunk of a text/image value to the server.
Definition dblib.c:6808
const char * dbprtype(int token)
Print a token value's name to a buffer.
Definition dblib.c:6519
char * dbcolsource(DBPROCESS *dbproc, int colnum)
Get base database column name for a result set column.
Definition dblib.c:3190
char * dbchange(DBPROCESS *dbprocess)
See if a command caused the current database to change.
Definition dblib.c:7066
const char * dbacolname(DBPROCESS *dbproc, int computeid, int column)
Return name of a computed result column.
Definition dblib.c:1946
RETCODE dbnullbind(DBPROCESS *dbproc, int column, DBINT *indicator)
Tie a null-indicator to a regular result column.
Definition dblib.c:2785
RETCODE dbbind(DBPROCESS *dbproc, int column, int vartype, DBINT varlen, BYTE *varaddr)
Tie a host variable to a resultset column.
Definition dblib.c:2682
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
Definition dblib.c:1418
DBINT dbcollen(DBPROCESS *dbproc, int column)
Get size of a regular result column.
Definition dblib.c:3215
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:2348
char * dbgetchar(DBPROCESS *dbprocess, int n)
Get address of a position in the command buffer.
Definition dblib.c:6382
RETCODE dbanullbind(DBPROCESS *dbprocess, int computeid, int column, DBINT *indicator)
Tie a null-indicator to a compute result column.
Definition dblib.c:2821
RETCODE dbclropt(DBPROCESS *dbproc, int option, const char param[])
Reset an option.
Definition dblib.c:6167
DBINT dbcount(DBPROCESS *dbproc)
Get count of rows processed.
Definition dblib.c:2869
int dbaltop(DBPROCESS *dbproc, int computeid, int column)
Get aggregation operator for a compute column.
Definition dblib.c:4520
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:6536
DBINT dbaltlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in compute column.
Definition dblib.c:7216
RETCODE dbsetopt(DBPROCESS *dbproc, int option, const char *char_param, int int_param)
Set db-lib or server option.
Definition dblib.c:4547
void dbprhead(DBPROCESS *dbproc)
Print result set headings to stdout.
Definition dblib.c:4035
RETCODE dbsetlversion(LOGINREC *login, BYTE version)
Set TDS version for future connections.
Definition dblib.c:973
RETCODE dbprrow(DBPROCESS *dbproc)
Print a result set to stdout.
Definition dblib.c:3588
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Definition dblib.c:7086
int dbalttype(DBPROCESS *dbproc, int computeid, int column)
Get datatype for a compute column.
Definition dblib.c:4416
RETCODE dbsprhead(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print result set headings to a buffer.
Definition dblib.c:3970
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition dblib.c:1464
DBBOOL dbwillconvert(int srctype, int desttype)
Test whether or not a datatype can be converted to another datatype.
Definition dblib.c:2919
DBINT dbcolutype(DBPROCESS *dbprocess, int column)
Get user-defined datatype of a regular result column.
Definition dblib.c:3039
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition dblib.c:5193
RETCODE dbsetversion(DBINT version)
Specify a db-lib version level.
Definition dblib.c:6048
int dbgetpacket(DBPROCESS *dbproc)
Get TDS packet size for the connection.
Definition dblib.c:4151
void dbrecftos(const char filename[])
Record to a file all SQL commands sent to the server.
Definition dblib.c:6843
BYTE * dbgetuserdata(DBPROCESS *dbproc)
Get address of user-allocated data from a DBPROCESS.
Definition dblib.c:6030
void dbsetuserdata(DBPROCESS *dbproc, BYTE *ptr)
Associate client-allocated (and defined) data with a DBPROCESS.
Definition dblib.c:6012
DBINT dbprcollen(DBPROCESS *dbproc, int column)
Get size of a result column needed to print column.
Definition dblib.c:3238
void dbexit(void)
Close server connections and free all related structures.
Definition dblib.c:1600
void dbloginfree(LOGINREC *login)
free the LOGINREC
Definition dblib.c:759
RETCODE dbmorecmds(DBPROCESS *dbproc)
See if more commands are to be processed.
Definition dblib.c:6309
DBBOOL dbisopt(DBPROCESS *dbproc, int option, const char param[])
Get value of an option.
Definition dblib.c:6235
int dbnumcompute(DBPROCESS *dbprocess)
Get count of COMPUTE clauses for a result set.
Definition dblib.c:5049
RETCODE dbsqlsend(DBPROCESS *dbproc)
Transmit the command buffer to the server.
Definition dblib.c:7122
RETCODE dbsprline(DBPROCESS *dbproc, char *buffer, DBINT buf_len, DBCHAR line_char)
Get formatted string for underlining dbsprhead() column names.
Definition dblib.c:3912
const char * dbversion(void)
See which version of db-lib is in use.
Definition dblib.c:6919
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:6458
int dbaltcolid(DBPROCESS *dbproc, int computeid, int column)
Get column ID of a compute column.
Definition dblib.c:4360
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:5940
RETCODE dbsettime(int seconds)
Set maximum seconds db-lib waits for a server response to query.
Definition dblib.c:4268
int dbnumcols(DBPROCESS *dbproc)
Return number of regular columns in a result set.
Definition dblib.c:1896
int dbgetmaxprocs(void)
get maximum simultaneous connections db-lib will open to the server.
Definition dblib.c:4247
DBBINARY * dbtxptr(DBPROCESS *dbproc, int column)
Get text pointer for a column in the current row.
Definition dblib.c:6633
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition dblib.c:5212
STATUS dbreadtext(DBPROCESS *dbproc, void *buf, DBINT bufsize)
Fetch part of a text or image value from the server.
Definition dblib.c:6739
RETCODE dbsqlok(DBPROCESS *dbproc)
Wait for results of a query from the server.
Definition dblib.c:4890
DBINT dbdatlen(DBPROCESS *dbproc, int column)
Get size of current row's data in a regular result column.
Definition dblib.c:3372
STATUS dbsetrow(DBPROCESS *dbprocess, DBINT row)
Make a buffered row "current" without fetching it into bound variables.
Definition dblib.c:2093
void dbclose(DBPROCESS *dbproc)
Close a connection to the server and free associated resources.
Definition dblib.c:1530
RETCODE dbstrcpy(DBPROCESS *dbproc, int start, int numbytes, char *dest)
Get a copy of a chunk of the command buffer.
Definition dblib.c:6414
DBINT dbaltutype(DBPROCESS *dbproc, int computeid, int column)
Get user-defined datatype of a compute column.
Definition dblib.c:7193
RETCODE dbsetmaxprocs(int maxprocs)
Set maximum simultaneous connections db-lib will open to the server.
Definition dblib.c:4175
RETCODE dbspr1row(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print a regular result row to a buffer.
Definition dblib.c:3505
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:4445
DBINT dbretstatus(DBPROCESS *dbproc)
Fetch status value returned by query or remote procedure call.
Definition dblib.c:4750
RETCODE dbrpcinit(DBPROCESS *dbproc, const char rpcname[], DBSMALLINT options)
Initialize a remote procedure call.
Definition rpc.c:70
BYTE * dbretdata(DBPROCESS *dbproc, int retnum)
Get value of an output parameter filled by a stored procedure.
Definition dblib.c:4829
char * dbretname(DBPROCESS *dbproc, int retnum)
Get name of an output parameter filled by a stored procedure.
Definition dblib.c:4800
DBBOOL dbhasretstat(DBPROCESS *dbproc)
Determine if query generated a return status number.
Definition dblib.c:4726
int dbrettype(DBPROCESS *dbproc, int retnum)
Get datatype of a stored procedure's return parameter.
Definition dblib.c:6338
int dbretlen(DBPROCESS *dbproc, int retnum)
Get size of an output parameter filled by a stored procedure.
Definition dblib.c:4855
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:153
RETCODE dbrpcsend(DBPROCESS *dbproc)
Execute the procedure and free associated memory.
Definition rpc.c:279
int dbnumrets(DBPROCESS *dbproc)
Get count of output parameters filled by a stored procedure.
Definition dblib.c:4768
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:359
DBBOOL bcp_getl(LOGINREC *login)
See if BCP_SETL() was used to set the LOGINREC for BCP work.
Definition bcp.c:709
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition bcp.c:528
RETCODE bcp_columns(DBPROCESS *dbproc, int host_colcount)
Indicate how many columns are to be found in the datafile.
Definition bcp.c:283
RETCODE bcp_colptr(DBPROCESS *dbproc, BYTE *colptr, int table_column)
Override bcp_bind() by pointing to a different host variable.
Definition bcp.c:673
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:2127
RETCODE bcp_exec(DBPROCESS *dbproc, DBINT *rows_copied)
Write a datafile to a table.
Definition bcp.c:1665
DBINT bcp_done(DBPROCESS *dbproc)
Conclude the transfer of data from program variables.
Definition bcp.c:2085
RETCODE bcp_readfmt(DBPROCESS *dbproc, const char filename[])
Read a format definition file.
Definition bcp.c:1726
DBINT bcp_batch(DBPROCESS *dbproc)
Commit a set of rows to the table.
Definition bcp.c:2058
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:149
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:249
RETCODE bcp_sendrow(DBPROCESS *dbproc)
Write data in host variables to the table.
Definition bcp.c:1415
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:491
RETCODE bcp_options(DBPROCESS *dbproc, int option, BYTE *value, int valuelen)
Set bulk copy options.
Definition bcp.c:633
RETCODE dbmny4zero(DBPROCESS *dbproc, DBMONEY4 *dest)
Zero a DBMONEY4 value.
Definition dblib.c:5642
RETCODE dbmny4add(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *sum)
Add two DBMONEY4 values.
Definition dblib.c:5665
int dbmny4cmp(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2)
Compare two DBMONEY4 values.
Definition dblib.c:5784
RETCODE dbmnymaxpos(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum positive DBMONEY value supported.
Definition dblib.c:5417
RETCODE dbmny4minus(DBPROCESS *dbproc, DBMONEY4 *src, DBMONEY4 *dest)
Negate a DBMONEY4 value.
Definition dblib.c:5618
RETCODE dbmnyminus(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Negate a DBMONEY value.
Definition dblib.c:5591
RETCODE dbmny4sub(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *diff)
Subtract two DBMONEY4 values.
Definition dblib.c:5696
RETCODE dbmnyzero(DBPROCESS *dbproc, DBMONEY *dest)
Set a DBMONEY value to zero.
Definition dblib.c:5396
RETCODE dbmnycopy(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Copy a DBMONEY value.
Definition dblib.c:6082
RETCODE dbmny4copy(DBPROCESS *dbprocess, DBMONEY4 *m1, DBMONEY4 *m2)
Copy a DBMONEY4 value.
Definition dblib.c:5812
RETCODE dbmnymaxneg(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum negative DBMONEY value supported.
Definition dblib.c:5438
RETCODE dbmnydec(DBPROCESS *dbproc, DBMONEY *mnyptr)
Subtract $0.0001 from a DBMONEY value.
Definition dblib.c:5563
RETCODE dbmnyinc(DBPROCESS *dbproc, DBMONEY *mnyptr)
Add $0.0001 to a DBMONEY value.
Definition dblib.c:5535
int dbmnycmp(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2)
Compare two DBMONEY values.
Definition dblib.c:5338
int dbdatecmp(DBPROCESS *dbproc, DBDATETIME *d1, DBDATETIME *d2)
Compare DBDATETIME values, similar to strcmp(3).
Definition dblib.c:5837
const char * dbmonthname(DBPROCESS *dbproc, char *language, int monthnum, DBBOOL shortform)
Get name of a month, in some human language.
Definition dblib.c:7037
int dbcurcmd(DBPROCESS *dbproc)
Get number of the row just returned.
Definition dblib.c:6292
RETCODE dbsetlbool(LOGINREC *login, int value, int which)
Set a boolean value in a LOGINREC structure.
Definition dblib.c:922
DBINT dblastrow(DBPROCESS *dbproc)
Get number of the last row in the row buffer.
Definition dblib.c:7286
RETCODE dbcmdrow(DBPROCESS *dbproc)
See if the current command can return rows.
Definition dblib.c:4336
RETCODE dbsetlshort(LOGINREC *login, int value, int which)
Set an integer value in a LOGINREC structure.
Definition dblib.c:887
RETCODE dbrows(DBPROCESS *dbproc)
Indicate whether a query returned rows.
Definition dblib.c:4110
void dbsetavail(DBPROCESS *dbprocess)
Mark a DBPROCESS as "available".
Definition dblib.c:7354
int dbiowdesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to write data coming to the server....
Definition dblib.c:7326
int dbtds(DBPROCESS *dbprocess)
Get the TDS version in use for dbproc.
Definition dblib.c:6878
DBINT dbcurrow(DBPROCESS *dbproc)
Get number of the row currently being read.
Definition dblib.c:6258
STATUS dbrowtype(DBPROCESS *dbprocess)
Get returned row's type.
Definition dblib.c:6275
int dbiordesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to read data coming from the server....
Definition dblib.c:7310
RETCODE dbsetllong(LOGINREC *login, long value, int which)
Set an integer value in a LOGINREC structure.
Definition dblib.c:850
RETCODE dbsetlname(LOGINREC *login, const char *value, int which)
Set the value of a string in a LOGINREC structure.
Definition dblib.c:781
DBPROCESS * tdsdbopen(LOGINREC *login, const char *server, int msdblib)
Form a connection with the server.
Definition dblib.c:1205
DBBOOL dbdead(DBPROCESS *dbproc)
Check if dbproc is an ex-parrot.
Definition dblib.c:5134
DBINT dbfirstrow(DBPROCESS *dbproc)
See if a server response has arrived.
Definition dblib.c:7271
Definition bsqlodbc.c:100
DBSMALLINT offset
time offset
Definition sybdb.h:314
DBUBIGINT time
time, 7 digit precision
Definition sybdb.h:312
DBINT date
date, 0 = 1900-01-01
Definition sybdb.h:313