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
927#define SYBEICONVPARTIAL 2433
929#define SYBESYNC 20001
930#define SYBEFCON 20002
931#define SYBETIME 20003
932#define SYBEREAD 20004
933#define SYBEBUFL 20005
934#define SYBEWRIT 20006
936#define SYBESOCK 20008
937#define SYBECONN 20009
939#define SYBEDBPS 20011
940#define SYBEINTF 20012
941#define SYBEUHST 20013
943#define SYBEOPIN 20015
944#define SYBEINLN 20016
945#define SYBESEOF 20017
946#define SYBESMSG 20018
947#define SYBERPND 20019
948#define SYBEBTOK 20020
949#define SYBEITIM 20021
951#define SYBEBTYP 20023
952#define SYBEBNCR 20024
953#define SYBEIICL 20025
954#define SYBECNOR 20026
955#define SYBENPRM 20027
956#define SYBEUVDT 20028
957#define SYBEUFDT 20029
958#define SYBEWAID 20030
959#define SYBECDNS 20031
960#define SYBEABNC 20032
961#define SYBEABMT 20033
962#define SYBEABNP 20034
963#define SYBEAAMT 20035
964#define SYBENXID 20036
965#define SYBERXID 20037
967#define SYBENMOB 20039
968#define SYBEAPUT 20040
969#define SYBEASNL 20041
970#define SYBENTLL 20042
971#define SYBEASUL 20043
972#define SYBERDNR 20044
973#define SYBENSIP 20045
974#define SYBEABNV 20046
975#define SYBEDDNE 20047
976#define SYBECUFL 20048
977#define SYBECOFL 20049
978#define SYBECSYN 20050
979#define SYBECLPR 20051
980#define SYBECNOV 20052
981#define SYBERDCN 20053
982#define SYBESFOV 20054
984#define SYBECLOS 20056
985#define SYBEUAVE 20057
986#define SYBEUSCT 20058
987#define SYBEEQVA 20059
988#define SYBEUDTY 20060
989#define SYBETSIT 20061
990#define SYBEAUTN 20062
991#define SYBEBDIO 20063
992#define SYBEBCNT 20064
993#define SYBEIFNB 20065
995#define SYBEKBCO 20067
996#define SYBEBBCI 20068
997#define SYBEKBCI 20069
998#define SYBEBCRE 20070
999#define SYBETPTN 20071
1000#define SYBEBCWE 20072
1001#define SYBEBCNN 20073
1002#define SYBEBCOR 20074
1003#define SYBEBCIS 20075
1004#define SYBEBCPI 20076
1005#define SYBEBCPN 20077
1006#define SYBEBCPB 20078
1007#define SYBEVDPT 20079
1008#define SYBEBIVI 20080
1009#define SYBEBCBC 20081
1010#define SYBEBCFO 20082
1011#define SYBEBCVH 20083
1012#define SYBEBCUO 20084
1013#define SYBEBCUC 20085
1014#define SYBEBUOE 20086
1015#define SYBEBUCE 20087
1016#define SYBEBWEF 20088
1017#define SYBEASTF 20089
1018#define SYBEUACS 20090
1019#define SYBEASEC 20091
1020#define SYBETMTD 20092
1021#define SYBENTTN 20093
1022#define SYBEDNTI 20094
1023#define SYBEBTMT 20095
1024#define SYBEORPF 20096
1025#define SYBEUVBF 20097
1026#define SYBEBUOF 20098
1027#define SYBEBUCF 20099
1028#define SYBEBRFF 20100
1029#define SYBEBWFF 20101
1030#define SYBEBUDF 20102
1031#define SYBEBIHC 20103
1032#define SYBEBEOF 20104
1033#define SYBEBCNL 20105
1034#define SYBEBCSI 20106
1035#define SYBEBCIT 20107
1036#define SYBEBCSA 20108
1037#define SYBENULL 20109
1038#define SYBEUNAM 20110
1039#define SYBEBCRO 20111
1040#define SYBEMPLL 20112
1041#define SYBERPIL 20113
1042#define SYBERPUL 20114
1043#define SYBEUNOP 20115
1044#define SYBECRNC 20116
1045#define SYBERTCC 20117
1046#define SYBERTSC 20118
1047#define SYBEUCRR 20119
1048#define SYBERPNA 20120
1049#define SYBEOPNA 20121
1050#define SYBEFGTL 20122
1051#define SYBECWLL 20123
1052#define SYBEUFDS 20124
1053#define SYBEUCPT 20125
1054#define SYBETMCF 20126
1055#define SYBEAICF 20127
1056#define SYBEADST 20128
1057#define SYBEALTT 20129
1058#define SYBEAPCT 20130
1059#define SYBEXOCI 20131
1060#define SYBEFSHD 20132
1061#define SYBEAOLF 20133
1062#define SYBEARDI 20134
1063#define SYBEURCI 20135
1064#define SYBEARDL 20136
1065#define SYBEURMI 20137
1066#define SYBEUREM 20138
1067#define SYBEURES 20139
1068#define SYBEUREI 20140
1069#define SYBEOREN 20141
1070#define SYBEISOI 20142
1071#define SYBEIDCL 20143
1072#define SYBEIMCL 20144
1073#define SYBEIFCL 20145
1074#define SYBEUTDS 20146
1075#define SYBEBUFF 20147
1076#define SYBEACNV 20148
1077#define SYBEDPOR 20149
1078#define SYBENDC 20150
1079#define SYBEMVOR 20151
1080#define SYBEDVOR 20152
1081#define SYBENBVP 20153
1082#define SYBESPID 20154
1083#define SYBENDTP 20155
1084#define SYBEXTN 20156
1085#define SYBEXTDN 20157
1086#define SYBEXTSN 20158
1087#define SYBENUM 20159
1088#define SYBETYPE 20160
1089#define SYBEGENOS 20161
1090#define SYBEPAGE 20162
1091#define SYBEOPTNO 20163
1092#define SYBEETD 20164
1093#define SYBERTYPE 20165
1094#define SYBERFILE 20166
1095#define SYBEFMODE 20167
1096#define SYBESLCT 20168
1097#define SYBEZTXT 20169
1098#define SYBENTST 20170
1099#define SYBEOSSL 20171
1100#define SYBEESSL 20172
1101#define SYBENLNL 20173
1102#define SYBENHAN 20174
1103#define SYBENBUF 20175
1104#define SYBENULP 20176
1105#define SYBENOTI 20177
1106#define SYBEEVOP 20178
1107#define SYBENEHA 20179
1108#define SYBETRAN 20180
1109#define SYBEEVST 20181
1110#define SYBEEINI 20182
1111#define SYBEECRT 20183
1112#define SYBEECAN 20184
1113#define SYBEEUNR 20185
1114#define SYBERPCS 20186
1115#define SYBETPAR 20187
1116#define SYBETEXS 20188
1117#define SYBETRAC 20189
1118#define SYBETRAS 20190
1119#define SYBEPRTF 20191
1120#define SYBETRSN 20192
1121#define SYBEBPKS 20193
1122#define SYBEIPV 20194
1123#define SYBEMOV 20195
1124#define SYBEDIVZ 20196
1125#define SYBEASTL 20197
1126#define SYBESEFA 20198
1127#define SYBEPOLL 20199
1128#define SYBENOEV 20200
1129#define SYBEBADPK 20201
1130#define SYBESECURE 20202
1131#define SYBECAP 20203
1132#define SYBEFUNC 20204
1133#define SYBERESP 20205
1134#define SYBEIVERS 20206
1135#define SYBEONCE 20207
1136#define SYBERPNULL 20208
1137#define SYBERPTXTIM 20209
1138#define SYBENEG 20210
1139#define SYBELBLEN 20211
1140#define SYBEUMSG 20212
1141#define SYBECAPTYP 20213
1142#define SYBEBNUM 20214
1143#define SYBEBBL 20215
1144#define SYBEBPREC 20216
1145#define SYBEBSCALE 20217
1146#define SYBECDOMAIN 20218
1147#define SYBECINTERNAL 20219
1148#define SYBEBTYPSRV 20220
1149#define SYBEBCSET 20221
1150#define SYBEFENC 20222
1151#define SYBEFRES 20223
1152#define SYBEISRVPREC 20224
1153#define SYBEISRVSCL 20225
1154#define SYBEINUMCL 20226
1155#define SYBEIDECCL 20227
1156#define SYBEBCMTXT 20228
1157#define SYBEBCPREC 20229
1158#define SYBEBCBNPR 20230
1159#define SYBEBCBNTYP 20231
1160#define SYBEBCSNTYP 20232
1161#define SYBEBCPCTYP 20233
1162#define SYBEBCVLEN 20234
1163#define SYBEBCHLEN 20235
1164#define SYBEBCBPREF 20236
1165#define SYBEBCPREF 20237
1166#define SYBEBCITBNM 20238
1167#define SYBEBCITBLEN 20239
1168#define SYBEBCSNDROW 20240
1169#define SYBEBPROCOL 20241
1170#define SYBEBPRODEF 20242
1171#define SYBEBPRONUMDEF 20243
1172#define SYBEBPRODEFID 20244
1173#define SYBEBPRONODEF 20245
1174#define SYBEBPRODEFTYP 20246
1175#define SYBEBPROEXTDEF 20247
1176#define SYBEBPROEXTRES 20248
1177#define SYBEBPROBADDEF 20249
1178#define SYBEBPROBADTYP 20250
1179#define SYBEBPROBADLEN 20251
1180#define SYBEBPROBADPREC 20252
1181#define SYBEBPROBADSCL 20253
1182#define SYBEBADTYPE 20254
1183#define SYBECRSNORES 20255
1184#define SYBECRSNOIND 20256
1185#define SYBECRSVIEW 20257
1186#define SYBECRSVIIND 20258
1187#define SYBECRSORD 20259
1188#define SYBECRSBUFR 20260
1189#define SYBECRSNOFREE 20261
1190#define SYBECRSDIS 20262
1191#define SYBECRSAGR 20263
1192#define SYBECRSFRAND 20264
1193#define SYBECRSFLAST 20265
1194#define SYBECRSBROL 20266
1195#define SYBECRSFROWN 20267
1196#define SYBECRSBSKEY 20268
1197#define SYBECRSRO 20269
1198#define SYBECRSNOCOUNT 20270
1199#define SYBECRSTAB 20271
1200#define SYBECRSUPDNB 20272
1201#define SYBECRSNOWHERE 20273
1202#define SYBECRSSET 20274
1203#define SYBECRSUPDTAB 20275
1204#define SYBECRSNOUPD 20276
1205#define SYBECRSINV 20277
1206#define SYBECRSNOKEYS 20278
1207#define SYBECRSNOBIND 20279
1208#define SYBECRSFTYPE 20280
1209#define SYBECRSINVALID 20281
1210#define SYBECRSMROWS 20282
1211#define SYBECRSNROWS 20283
1212#define SYBECRSNOLEN 20284
1213#define SYBECRSNOPTCC 20285
1214#define SYBECRSNORDER 20286
1215#define SYBECRSNOTABLE 20287
1216#define SYBECRSNUNIQUE 20288
1217#define SYBECRSVAR 20289
1218#define SYBENOVALUE 20290
1219#define SYBEVOIDRET 20291
1220#define SYBECLOSEIN 20292
1221#define SYBEBOOL 20293
1222#define SYBEBCPOPT 20294
1223#define SYBEERRLABEL 20295
1224#define SYBEATTNACK 20296
1225#define SYBEBBFL 20297
1226#define SYBEDCL 20298
1228#define SYBEBULKINSERT 20599
1229#define SYBECOLSIZE 22000
1231int dbtds(DBPROCESS * dbprocess);
1233#define DBTDS(a) dbtds(a)
1234DBINT dbtextsize(DBPROCESS * dbprocess);
1235DBBINARY *
dbtxptr(DBPROCESS * dbproc,
int column);
1237DBBINARY *dbtxtsnewval(DBPROCESS * dbprocess);
1238RETCODE dbtxtsput(DBPROCESS * dbprocess, DBBINARY newtxts,
int colnum);
1239RETCODE
dbuse(DBPROCESS * dbproc,
const char *name);
1242RETCODE
dbwritetext(DBPROCESS * dbproc,
char *objname, DBBINARY * textptr, DBTINYINT textptrlen, DBBINARY * timestamp,
1243 DBBOOL log, DBINT size, BYTE * text);
1253#define DBSETLHOST(x,y) dbsetlname((x), (y), DBSETHOST)
1254#define dbsetlhost(x,y) dbsetlname((x), (y), DBSETHOST)
1256#define DBSETLUSER(x,y) dbsetlname((x), (y), DBSETUSER)
1257#define dbsetluser(x,y) dbsetlname((x), (y), DBSETUSER)
1259#define DBSETLPWD(x,y) dbsetlname((x), (y), DBSETPWD)
1260#define dbsetlpwd(x,y) dbsetlname((x), (y), DBSETPWD)
1261#if defined(DBLIB_UNIMPLEMENTED)
1263# define DBSETLHID(x,y) dbsetlname((x), (y), DBSETHID)
1266#define DBSETLAPP(x,y) dbsetlname((x), (y), DBSETAPP)
1267#define dbsetlapp(x,y) dbsetlname((x), (y), DBSETAPP)
1269#define BCP_SETL(x,y) dbsetlbool((x), (y), DBSETBCP)
1270#define DBSETLSECURE(x) dbsetlbool((x), (1), DBSETBCP)
1271#define DBSETNATLANG 7
1272#define DBSETLNATLANG(x,y) dbsetlname((x), (y), DBSETNATLANG)
1273#define dbsetlnatlang(x,y) dbsetlname((x), (y), DBSETNATLANG)
1274#if defined(DBLIB_UNIMPLEMENTED)
1275# define DBSETNOSHORT 8
1276# define DBSETLNOSHORT(x,y) dbsetlbool((x), (y), DBSETNOSHORT)
1278# define DBSETLHIER(x,y) dbsetlshort((x), (y), DBSETHIER)
1280#define DBSETCHARSET 10
1281#define DBSETLCHARSET(x,y) dbsetlname((x), (y), DBSETCHARSET)
1282#define DBSETPACKET 11
1283#define DBSETLPACKET(x,y) dbsetllong((x), (y), DBSETPACKET)
1284#define dbsetlpacket(x,y) dbsetllong((x), (y), DBSETPACKET)
1285#define DBSETENCRYPT 12
1286#define DBSETLENCRYPT(x,y) dbsetlbool((x), (y), DBSETENCRYPT)
1287#define DBSETLABELED 13
1288#define DBSETLLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1289#define BCP_SETLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED)
1290#define DBSETDBNAME 14
1291#define DBSETLDBNAME(x,y) dbsetlname((x), (y), DBSETDBNAME)
1292#define DBSETLVERSION(login, version) dbsetlversion((login), (version))
1293#define DBSETNETWORKAUTH 101
1294#define DBSETLNETWORKAUTH(x, y) dbsetlbool((x), (y), DBSETNETWORKAUTH)
1295#define DBSETMUTUALAUTH 102
1296#define DBSETLMUTUALAUTH(x, y) dbsetlbool((x), (y), DBSETMUTUALAUTH)
1297#define DBSETSERVERPRINCIPAL 103
1298#define DBSETLSERVERPRINCIPAL(x,y) dbsetlname((x), (y), DBSETSERVERPRINCIPAL)
1300#define DBSETUTF16 1001
1301#define DBSETLUTF16(x,y) dbsetlbool((x), (y), DBSETUTF16)
1302#define DBSETNTLMV2 1002
1303#define DBSETLNTLMV2(x,y) dbsetlbool((x), (y), DBSETNTLMV2)
1304#define DBSETREADONLY 1003
1305#define DBSETLREADONLY(x,y) dbsetlbool((x), (y), DBSETREADONLY)
1306#define DBSETDELEGATION 1004
1307#define DBSETLDELEGATION(x, y) dbsetlbool((x), (y), DBSETDELEGATION)
1308#define DBSETENCRYPTION 1005
1309#define DBSETLENCRYPTION(x, y) dbsetlname((x), (y), DBSETENCRYPTION)
1310#define DBSETPORT 1006
1311#define DBSETLPORT(x,y) dbsetlshort((x), (y), DBSETPORT)
1313RETCODE
bcp_init(DBPROCESS * dbproc,
const char *tblname,
const char *hfile,
const char *errfile,
int direction);
1317RETCODE
bcp_bind(DBPROCESS * dbproc, BYTE * varaddr,
int prefixlen, DBINT varlen, BYTE * terminator,
int termlen,
int type,
1319RETCODE
bcp_collen(DBPROCESS * dbproc, DBINT varlen,
int table_column);
1320RETCODE
bcp_columns(DBPROCESS * dbproc,
int host_colcount);
1321RETCODE
bcp_colfmt(DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1322 const BYTE * host_term,
int host_termlen,
int colnum);
1323RETCODE
bcp_colfmt_ps(DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1324 BYTE * host_term,
int host_termlen,
int colnum, DBTYPEINFO * typeinfo);
1325RETCODE
bcp_colptr(DBPROCESS * dbproc, BYTE * colptr,
int table_column);
1326RETCODE
bcp_control(DBPROCESS * dbproc,
int field, DBINT value);
1327int bcp_getbatchsize(DBPROCESS * dbproc);
1328int bcp_gethostcolcount(DBPROCESS * dbproc);
1329RETCODE
bcp_exec(DBPROCESS * dbproc, DBINT * rows_copied);
1331RETCODE
bcp_options(DBPROCESS * dbproc,
int option, BYTE * value,
int valuelen);
1332RETCODE
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:360
DBBOOL bcp_getl(LOGINREC *login)
See if BCP_SETL() was used to set the LOGINREC for BCP work.
Definition bcp.c:714
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition bcp.c:533
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:678
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:2177
RETCODE bcp_exec(DBPROCESS *dbproc, DBINT *rows_copied)
Write a datafile to a table.
Definition bcp.c:1715
DBINT bcp_done(DBPROCESS *dbproc)
Conclude the transfer of data from program variables.
Definition bcp.c:2135
RETCODE bcp_readfmt(DBPROCESS *dbproc, const char filename[])
Read a format definition file.
Definition bcp.c:1776
DBINT bcp_batch(DBPROCESS *dbproc)
Commit a set of rows to the table.
Definition bcp.c:2108
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:1465
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:496
RETCODE bcp_options(DBPROCESS *dbproc, int option, BYTE *value, int valuelen)
Set bulk copy options.
Definition bcp.c:638
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