31 #include "tds_sysdep_public.h" 33 #undef TDS_STATIC_CAST 35 #define TDS_STATIC_CAST(type, a) static_cast<type>(a) 42 #define TDS_STATIC_CAST(type, a) ((type)(a)) 59 #define INT_CONTINUE 1 63 #define DBMAXNUMLEN 33 70 #define DBVERSION_UNKNOWN 0 71 #define DBVERSION_46 1 72 #define DBVERSION_100 2 73 #define DBVERSION_42 3 74 #define DBVERSION_70 4 75 #define DBVERSION_71 5 76 #define DBVERSION_72 6 77 #define DBVERSION_73 7 78 #define DBVERSION_74 8 81 #define DBVER42 DBVERSION_42 82 #define DBVER60 DBVERSION_70 88 #define DBTDS_UNKNOWN 0 110 #define BCPKEEPIDENTITY 8 121 typedef void DBCURSOR;
122 typedef void DBXLATE;
123 typedef void DBSORTORDER;
124 typedef void DBLOGINFO;
125 typedef void *DBVOIDPTR;
127 typedef unsigned short USHORT;
128 typedef int (*INTFUNCPTR) (
void *, ...);
129 typedef int (*DBWAITFUNC) (void);
130 typedef DBWAITFUNC(*DB_DBBUSY_FUNC) (
void *dbproc);
131 typedef void (*DB_DBIDLE_FUNC) (DBWAITFUNC dfunc,
void *dbproc);
132 typedef int (*DB_DBCHKINTR_FUNC) (
void *dbproc);
133 typedef int (*DB_DBHNDLINTR_FUNC) (
void *dbproc);
135 #ifndef __INCvxWorksh 147 #if !defined(_WINDEF_) && !defined(_WINDEF_H) && !defined(DOS32X) 158 #define SYBCHAR SYBCHAR 160 #define SYBVARCHAR SYBVARCHAR 162 #define SYBINTN SYBINTN 164 #define SYBINT1 SYBINT1 166 #define SYBINT2 SYBINT2 168 #define SYBINT4 SYBINT4 170 #define SYBINT8 SYBINT8 172 #define SYBFLT8 SYBFLT8 174 #define SYBDATETIME SYBDATETIME 176 #define SYBBIT SYBBIT 178 #define SYBBITN SYBBITN 180 #define SYBTEXT SYBTEXT 182 #define SYBNTEXT SYBNTEXT 184 #define SYBIMAGE SYBIMAGE 186 #define SYBMONEY4 SYBMONEY4 188 #define SYBMONEY SYBMONEY 190 #define SYBDATETIME4 SYBDATETIME4 192 #define SYBREAL SYBREAL 194 #define SYBBINARY SYBBINARY 196 #define SYBVOID SYBVOID 198 #define SYBVARBINARY SYBVARBINARY 200 #define SYBNUMERIC SYBNUMERIC 202 #define SYBDECIMAL SYBDECIMAL 204 #define SYBFLTN SYBFLTN 206 #define SYBMONEYN SYBMONEYN 208 #define SYBDATETIMN SYBDATETIMN 210 #define SYBNVARCHAR SYBNVARCHAR 212 #define SYBDATE SYBDATE 214 #define SYBTIME SYBTIME 215 SYBBIGDATETIME = 187,
216 #define SYBBIGDATETIME SYBBIGDATETIME 218 #define SYBBIGTIME SYBBIGTIME 220 #define SYBMSDATE SYBMSDATE 222 #define SYBMSTIME SYBMSTIME 224 #define SYBMSDATETIME2 SYBMSDATETIME2 225 SYBMSDATETIMEOFFSET = 43,
226 #define SYBMSDATETIMEOFFSET SYBMSDATETIMEOFFSET 229 #define SYBAOPCNT 0x4b 230 #define SYBAOPCNTU 0x4c 231 #define SYBAOPSUM 0x4d 232 #define SYBAOPSUMU 0x4e 233 #define SYBAOPAVG 0x4f 234 #define SYBAOPAVGU 0x50 235 #define SYBAOPMIN 0x51 236 #define SYBAOPMAX 0x52 239 #define SYBAOPCNT_BIG 0x09 240 #define SYBAOPSTDEV 0x30 241 #define SYBAOPSTDEVP 0x31 242 #define SYBAOPVAR 0x32 243 #define SYBAOPVARP 0x33 244 #define SYBAOPCHECKSUM_AGG 0x72 248 typedef unsigned char DBBOOL;
250 typedef unsigned char DBBIT;
251 typedef unsigned char DBTINYINT;
252 typedef tds_sysdep_int16_type DBSMALLINT;
253 typedef tds_sysdep_int32_type DBINT;
254 typedef tds_sysdep_int64_type DBBIGINT;
255 typedef unsigned char DBBINARY;
256 typedef tds_sysdep_real32_type DBREAL;
257 typedef tds_sysdep_real64_type DBFLT8;
258 typedef unsigned tds_sysdep_int16_type DBUSMALLINT;
259 typedef unsigned tds_sysdep_int32_type DBUINT;
260 typedef unsigned tds_sysdep_int64_type DBUBIGINT;
271 unsigned char array[256];
276 unsigned char precision;
278 unsigned char array[33];
286 unsigned tds_sysdep_int32_type mnylow;
311 DBUSMALLINT time_prec:3;
315 DBUSMALLINT has_time:1;
316 DBUSMALLINT has_date:1;
317 DBUSMALLINT has_offset:1;
321 # define SQLCHAR SYBCHAR 332 typedef unsigned char BYTE;
351 { MAXCOLNAMELEN = 512 };
352 typedef enum { CI_REGULAR=1, CI_ALTERNATE=2, CI_CURSOR=3 } CI_TYPE;
357 DBCHAR Name[MAXCOLNAMELEN+2];
358 DBCHAR ActualName[MAXCOLNAMELEN+2];
359 DBCHAR TableName[MAXCOLNAMELEN+2];
376 DBCHAR Name[MAXCOLNAMELEN+2];
377 DBCHAR ActualName[MAXCOLNAMELEN+2];
378 DBCHAR TableName[MAXCOLNAMELEN+2];
390 DBINT ServerMaxLength;
391 DBCHAR ServerTypeDeclaration[256];
398 #define DBPARSEONLY 0 402 #define DBARITHIGNORE 4 404 #define DBARITHABORT 6 405 #define DBTEXTLIMIT 7 411 #define DBSTORPROCID 13 413 #define DBNOAUTOFREE 15 414 #define DBROWCOUNT 16 415 #define DBTEXTSIZE 17 417 #define DBDATEFORMAT 19 419 #define DBPRCOLSEP 21 420 #define DBPRLINELEN 22 421 #define DBPRLINESEP 23 422 #define DBLFCONVERT 24 423 #define DBDATEFIRST 25 424 #define DBCHAINXACTS 26 425 #define DBFIPSFLAG 27 426 #define DBISOLATION 28 428 #define DBIDENTITY 30 430 #define DBDATESHORT 32 431 #define DBCLIENTCURSORS 33 433 #define DBQUOTEDIDENT 35 435 #define DBNUMOPTIONS 36 443 #define NOSUCHOPTION 2 445 #define MAXOPTTEXT 32 530 typedef int (*EHANDLEFUNC) (DBPROCESS * dbproc,
int severity,
int dberr,
int oserr,
char *dberrstr,
char *oserrstr);
532 typedef int (*MHANDLEFUNC) (DBPROCESS * dbproc, DBINT msgno,
int msgstate,
int severity,
char *msgtext,
char *srvname,
533 char *proc,
int line);
537 #define DBNOTIFICATION 2 539 #define DBINTERRUPT 4 547 #define NTBSTRINGBIND 2 548 #define VARYCHARBIND 3 549 #define VARYBINBIND 4 555 #define DATETIMEBIND 11 556 #define SMALLDATETIMEBIND 12 558 #define SMALLMONEYBIND 14 559 #define BINARYBIND 15 561 #define NUMERICBIND 17 562 #define DECIMALBIND 18 563 #define SRCNUMERICBIND 19 564 #define SRCDECIMALBIND 20 567 #define BIGDATETIMEBIND 23 568 #define BIGTIMEBIND 24 569 #define BIGINTBIND 30 570 #define DATETIME2BIND 31 571 #define MAXBINDTYPES 32 573 #define DBPRCOLSEP 21 574 #define DBPRLINELEN 22 575 #define DBRPCRETURN 1 576 #define DBRPCDEFAULT 2 580 #define NO_MORE_ROWS -2 582 #define NO_MORE_RESULTS 2 588 #define DB_QUERYOUT 3 595 #define DBRPCRECOMPILE TDS_STATIC_CAST(DBSMALLINT, 0x0001) 596 #define DBRPCRESET TDS_STATIC_CAST(DBSMALLINT, 0x0002) 597 #define DBRPCCURSOR TDS_STATIC_CAST(DBSMALLINT, 0x0008) 599 #if defined(DBLIB_UNIMPLEMENTED) 600 DBBOOL db12hour(DBPROCESS * dbprocess,
const char language[]);
602 DBBOOL dbcolbrowse(DBPROCESS * dbprocess,
int colnum);
604 RETCODE dbcursor(DBCURSOR * hc, DBINT optype, DBINT bufno, BYTE * table, BYTE * values);
605 RETCODE dbcursorbind(DBCURSOR * hc,
int col,
int vartype, DBINT varlen, DBINT * poutlen, BYTE * pvaraddr,
DBTYPEINFO * typeinfo);
606 void dbcursorclose(DBCURSOR * hc);
607 RETCODE dbcursorcolinfo(DBCURSOR * hc, DBINT column, DBCHAR * colname, DBINT * coltype, DBINT * collen, DBINT * usertype);
608 RETCODE dbcursorfetch(DBCURSOR * hc, DBINT fetchtype, DBINT rownum);
609 RETCODE dbcursorinfo(DBCURSOR * hc, DBINT * ncols, DBINT * nrows);
610 DBCURSOR *dbcursoropen(DBPROCESS * dbprocess, BYTE * stmt, SHORT scollopt, SHORT concuropt, USHORT nrows, DBINT * pstatus);
613 RETCODE dbdate4zero(DBPROCESS * dbprocess,
DBDATETIME4 * d1);
614 RETCODE dbdatechar(DBPROCESS * dbprocess,
char *buf,
int datepart,
int value);
615 int dbdatename(DBPROCESS * dbprocess,
char *buf,
int date,
DBDATETIME * datetime);
616 char *dateorder(DBPROCESS * dbprocess,
char *language);
617 DBINT dbdatepart(DBPROCESS * dbprocess,
int datepart,
DBDATETIME * datetime);
618 RETCODE dbdatezero(DBPROCESS * dbprocess,
DBDATETIME * d1);
619 char *dbdayname(DBPROCESS * dbprocess,
char *language,
int daynum);
621 int dbgetoff(DBPROCESS * dbprocess, DBUSMALLINT offtype,
int startfrom);
623 char *dbqual(DBPROCESS * dbprocess,
int tabnum,
char *tabname);
624 void dbfreequal(
char *qualptr);
626 DBSORTORDER *dbloadsort(DBPROCESS * dbprocess);
627 RETCODE dbfreesort(DBPROCESS * dbprocess, DBSORTORDER * sortorder);
629 RETCODE dbload_xlate(DBPROCESS * dbprocess,
char *srv_charset,
char *clt_name, DBXLATE ** xlt_tosrv, DBXLATE ** xlt_todisp);
635 RETCODE dbmnydown(DBPROCESS * dbproc,
DBMONEY * mnyptr,
int divisor,
int *remainder);
636 RETCODE dbmnyinit(DBPROCESS * dbproc,
DBMONEY * mnyptr,
int trim, DBBOOL * negative);
637 RETCODE dbmnyndigit(DBPROCESS * dbproc,
DBMONEY * mnyptr, DBCHAR * value, DBBOOL * zero);
639 RETCODE dbmnydigit(DBPROCESS * dbprocess,
DBMONEY * m1, DBCHAR * value, DBBOOL * zero);
640 RETCODE dbmnyscale(DBPROCESS * dbproc,
DBMONEY * dest,
int multiplier,
int addend);
643 RETCODE dbnpcreate(DBPROCESS * dbprocess);
644 RETCODE dbnpdefine(DBPROCESS * dbprocess, DBCHAR * procedure_name, DBSMALLINT namelen);
646 int DBNUMORDERS(DBPROCESS * dbprocess);
648 RETCODE dbpoll(DBPROCESS * dbproc,
long milliseconds, DBPROCESS ** ready_dbproc,
int *return_reason);
649 int dbordercol(DBPROCESS * dbprocess,
int order);
651 RETCODE dbregdrop(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
652 RETCODE dbregexec(DBPROCESS * dbproc, DBUSMALLINT options);
653 RETCODE dbreghandle(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, INTFUNCPTR handler);
654 RETCODE dbreginit(DBPROCESS * dbproc, DBCHAR * procedure_name, DBSMALLINT namelen);
655 RETCODE dbreglist(DBPROCESS * dbproc);
656 RETCODE dbregnowatch(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
657 RETCODE dbregparam(DBPROCESS * dbproc,
char *param_name,
int type, DBINT datalen, BYTE * data);
658 RETCODE dbregwatch(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, DBUSMALLINT options);
659 RETCODE dbregwatchlist(DBPROCESS * dbprocess);
661 void dbrpwclr(LOGINREC * login);
662 RETCODE dbrpwset(LOGINREC * login,
char *srvname,
char *password,
int pwlen);
664 DBINT dbreadpage(DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, BYTE * buf);
665 RETCODE dbwritepage(DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, DBINT size, BYTE * buf);
667 RETCODE dbsetdeflang(
char *language);
669 int dbstrcmp(DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
670 int dbstrsort(DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
672 DBBOOL dbtabbrowse(DBPROCESS * dbprocess,
int tabnum);
673 int dbtabcount(DBPROCESS * dbprocess);
674 char *dbtabname(DBPROCESS * dbprocess,
int tabnum);
675 char *dbtabsource(DBPROCESS * dbprocess,
int colnum,
int *tabnum);
677 RETCODE dbsendpassthru(DBPROCESS * dbprocess, DBVOIDPTR bufp);
678 RETCODE dbrecvpassthru(DBPROCESS * dbprocess, DBVOIDPTR * bufp);
680 RETCODE dbgetloginfo(DBPROCESS * dbprocess, DBLOGINFO ** loginfo);
681 RETCODE dbsetloginfo(LOGINREC * loginrec, DBLOGINFO * loginfo);
683 int dbtsnewlen(DBPROCESS * dbprocess);
684 DBBINARY *dbtsnewval(DBPROCESS * dbprocess);
685 RETCODE dbtsput(DBPROCESS * dbprocess, DBBINARY * newts,
int newtslen,
int tabnum,
char *tabname);
687 RETCODE dbfree_xlate(DBPROCESS * dbprocess, DBXLATE * xlt_tosrv, DBXLATE * clt_todisp);
688 int dbxlate(DBPROCESS * dbprocess,
char *src,
int srclen,
char *dest,
int destlen, DBXLATE * xlt,
int *srcbytes_used,
689 DBBOOL srcend,
int status);
691 RETCODE bcp_moretext(DBPROCESS * dbproc, DBINT size, BYTE * text);
692 RETCODE bcp_writefmt(DBPROCESS * dbproc,
const char filename[]);
694 void build_xact_string(
char *xact_name,
char *service_name, DBINT commid,
char *result);
695 RETCODE remove_xact(DBPROCESS * connect, DBINT commid,
int n);
696 RETCODE abort_xact(DBPROCESS * connect, DBINT commid);
697 void close_commit(DBPROCESS * connect);
698 RETCODE commit_xact(DBPROCESS * connect, DBINT commid);
699 DBPROCESS *open_commit(LOGINREC * login,
char *servername);
700 RETCODE scan_xact(DBPROCESS * connect, DBINT commid);
701 DBINT start_xact(DBPROCESS * connect,
char *application_name,
char *xact_name,
int site_count);
702 DBINT stat_xact(DBPROCESS * connect, DBINT commid);
706 BYTE *
dbadata(DBPROCESS * dbproc,
int computeid,
int column);
707 DBINT
dbadlen(DBPROCESS * dbproc,
int computeid,
int column);
708 RETCODE
dbaltbind(DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
709 RETCODE dbaltbind_ps(DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
711 int dbaltcolid(DBPROCESS * dbproc,
int computeid,
int column);
712 DBINT
dbaltlen(DBPROCESS * dbproc,
int computeid,
int column);
713 int dbaltop(DBPROCESS * dbproc,
int computeid,
int column);
714 int dbalttype(DBPROCESS * dbproc,
int computeid,
int column);
715 DBINT
dbaltutype(DBPROCESS * dbproc,
int computeid,
int column);
716 RETCODE
dbanullbind(DBPROCESS * dbprocess,
int computeid,
int column, DBINT * indicator);
717 RETCODE
dbbind(DBPROCESS * dbproc,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
718 RETCODE dbbind_ps(DBPROCESS * dbprocess,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
DBTYPEINFO * typeinfo);
719 int dbbufsize(DBPROCESS * dbprocess);
720 BYTE *
dbbylist(DBPROCESS * dbproc,
int computeid,
int *size);
721 RETCODE
dbcancel(DBPROCESS * dbproc);
723 char *
dbchange(DBPROCESS * dbprocess);
724 DBBOOL dbcharsetconv(DBPROCESS * dbprocess);
725 void dbclose(DBPROCESS * dbproc);
726 void dbclrbuf(DBPROCESS * dbproc, DBINT n);
727 RETCODE
dbclropt(DBPROCESS * dbproc,
int option,
const char param[]);
728 RETCODE
dbcmd(DBPROCESS * dbproc,
const char cmdstring[]);
729 RETCODE
dbcmdrow(DBPROCESS * dbproc);
731 #define DBCMDROW(x) dbcmdrow((x)) 733 RETCODE
dbcolinfo (DBPROCESS *dbproc, CI_TYPE type, DBINT column, DBINT computeid,
DBCOL *pdbcol);
734 DBINT
dbcollen(DBPROCESS * dbproc,
int column);
735 char *
dbcolname(DBPROCESS * dbproc,
int column);
737 int dbcoltype(DBPROCESS * dbproc,
int column);
739 DBINT
dbcolutype(DBPROCESS * dbprocess,
int column);
740 DBINT
dbconvert(DBPROCESS * dbproc,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen);
741 DBINT
dbconvert_ps(DBPROCESS * dbprocess,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen,
744 DBINT
dbcount(DBPROCESS * dbproc);
746 #define DBCOUNT(x) dbcount((x)) 749 #define DBCURCMD(x) dbcurcmd((x)) 752 #define DBCURROW(x) dbcurrow((x)) 753 BYTE *
dbdata(DBPROCESS * dbproc,
int column);
756 RETCODE
dbanydatecrack(DBPROCESS * dbproc, DBDATEREC2 * di,
int type,
const void *data);
757 DBINT
dbdatlen(DBPROCESS * dbproc,
int column);
758 DBBOOL
dbdead(DBPROCESS * dbproc);
760 #define DBDEAD(x) dbdead((x)) 763 RETCODE
dbfcmd(DBPROCESS * dbproc,
const char *fmt, ...);
766 #define DBFIRSTROW(x) dbfirstrow((x)) 768 char *
dbgetchar(DBPROCESS * dbprocess,
int n);
769 char *dbgetcharset(DBPROCESS * dbprocess);
770 int dbgetlusername(LOGINREC * login, BYTE * name_buffer,
int buffer_len);
772 char *dbgetnatlanf(DBPROCESS * dbprocess);
774 RETCODE
dbgetrow(DBPROCESS * dbproc, DBINT row);
776 #define DBGETTIME dbgettime 782 #define DBIORDESC(x) dbiordesc((x)) 785 #define DBIOWDESC(x) dbiowdesc((x)) 786 DBBOOL dbisavail(DBPROCESS * dbprocess);
788 #define DBISAVAIL(x) dbisavail((x)) 789 DBBOOL
dbisopt(DBPROCESS * dbproc,
int option,
const char param[]);
792 #define DBLASTROW(x) dblastrow((x)) 815 const char *
dbmonthname(DBPROCESS * dbproc,
char *language,
int monthnum, DBBOOL shortform);
818 #define DBMORECMDS(x) dbmorecmds((x)) 819 RETCODE
dbmoretext(DBPROCESS * dbproc, DBINT size,
const BYTE text[]);
821 char *
dbname(DBPROCESS * dbproc);
822 STATUS dbnextrow(DBPROCESS * dbproc);
823 RETCODE
dbnullbind(DBPROCESS * dbproc,
int column, DBINT * indicator);
824 int dbnumalts(DBPROCESS * dbproc,
int computeid);
828 DBPROCESS *
tdsdbopen(LOGINREC * login,
const char *server,
int msdblib);
829 DBPROCESS *
dbopen(LOGINREC * login,
const char *server);
833 void dbpivot_count (
struct col_t *output,
const struct col_t *input);
834 void dbpivot_sum (
struct col_t *output,
const struct col_t *input);
835 void dbpivot_min (
struct col_t *output,
const struct col_t *input);
836 void dbpivot_max (
struct col_t *output,
const struct col_t *input);
839 typedef void (*DBPIVOT_FUNC)(
struct col_t *output,
const struct col_t *input);
840 struct pivot_t * dbrows_pivoted(DBPROCESS *dbproc);
841 STATUS dbnextrow_pivoted(DBPROCESS *dbproc,
struct pivot_t *pp);
842 RETCODE
dbpivot(DBPROCESS *dbproc,
int nkeys,
int *keys,
int ncols,
int *cols, DBPIVOT_FUNC func,
int val);
844 DBPIVOT_FUNC dbpivot_lookup_name(
const char name[] );
847 #define dbopen(x,y) tdsdbopen((x),(y), 1) 849 #define dbopen(x,y) tdsdbopen((x),(y), 0) 853 #ifdef PHP_SYBASE_DBOPEN 854 #undef PHP_SYBASE_DBOPEN 855 #define PHP_SYBASE_DBOPEN dbopen 859 DBINT
dbprcollen(DBPROCESS * dbproc,
int column);
860 RETCODE
dbprrow(DBPROCESS * dbproc);
862 DBBOOL DRBUF(DBPROCESS * dbprocess);
863 STATUS
dbreadtext(DBPROCESS * dbproc,
void *buf, DBINT bufsize);
866 RETCODE dbresults_r(DBPROCESS * dbproc,
int recursive);
867 BYTE *
dbretdata(DBPROCESS * dbproc,
int retnum);
868 int dbretlen(DBPROCESS * dbproc,
int retnum);
869 char *
dbretname(DBPROCESS * dbproc,
int retnum);
871 int dbrettype(DBPROCESS * dbproc,
int retnum);
872 RETCODE
dbrows(DBPROCESS * dbproc);
874 #define DBROWS(x) dbrows((x)) 877 #define DBROWTYPE(x) dbrowtype((x)) 878 RETCODE
dbrpcinit(DBPROCESS * dbproc,
const char rpcname[], DBSMALLINT options);
879 RETCODE
dbrpcparam(DBPROCESS * dbproc,
const char paramname[], BYTE status,
int type, DBINT maxlen, DBINT datalen, BYTE * value);
881 RETCODE
dbsafestr(DBPROCESS * dbproc,
const char *src, DBINT srclen,
char *dest, DBINT destlen,
int quotetype);
882 RETCODE *dbsechandle(DBINT type, INTFUNCPTR handler);
885 void dbsetbusy(DBPROCESS * dbprocess, DB_DBBUSY_FUNC busyfunc);
886 RETCODE dbsetdefcharset(
char *charset);
887 void dbsetidle(DBPROCESS * dbprocess, DB_DBIDLE_FUNC idlefunc);
889 void dbsetinterrupt(DBPROCESS * dbproc, DB_DBCHKINTR_FUNC chkintr, DB_DBHNDLINTR_FUNC hndlintr);
892 RETCODE
dbsetnull(DBPROCESS * dbprocess,
int bindtype,
int bindlen, BYTE * bindval);
893 RETCODE
dbsetopt(DBPROCESS * dbproc,
int option,
const char *char_param,
int int_param);
894 STATUS
dbsetrow(DBPROCESS * dbprocess, DBINT row);
899 int dbspid(DBPROCESS * dbproc);
900 RETCODE
dbspr1row(DBPROCESS * dbproc,
char *buffer, DBINT buf_len);
902 RETCODE
dbsprhead(DBPROCESS * dbproc,
char *buffer, DBINT buf_len);
903 RETCODE
dbsprline(DBPROCESS * dbproc,
char *buffer, DBINT buf_len, DBCHAR line_char);
905 RETCODE
dbsqlok(DBPROCESS * dbproc);
907 int dbstrbuild(DBPROCESS * dbproc,
char *charbuf,
int bufsize,
char *text,
char *formats, ...);
908 RETCODE
dbstrcpy(DBPROCESS * dbproc,
int start,
int numbytes,
char *dest);
910 DBINT
dbvarylen(DBPROCESS * dbproc,
int column);
912 #define SYBEVERDOWN 100 913 #define SYBEICONVIU 2400 914 #define SYBEICONVAVAIL 2401 915 #define SYBEICONVO 2402 916 #define SYBEICONVI 2403 917 #define SYBEICONV2BIG 2404 920 #define SYBETDSVER 2410 921 #define SYBEPORT 2500 922 #define SYBESYNC 20001 923 #define SYBEFCON 20002 924 #define SYBETIME 20003 925 #define SYBEREAD 20004 926 #define SYBEBUFL 20005 927 #define SYBEWRIT 20006 928 #define SYBEVMS 20007 929 #define SYBESOCK 20008 930 #define SYBECONN 20009 931 #define SYBEMEM 20010 932 #define SYBEDBPS 20011 933 #define SYBEINTF 20012 934 #define SYBEUHST 20013 935 #define SYBEPWD 20014 936 #define SYBEOPIN 20015 937 #define SYBEINLN 20016 938 #define SYBESEOF 20017 939 #define SYBESMSG 20018 940 #define SYBERPND 20019 941 #define SYBEBTOK 20020 942 #define SYBEITIM 20021 943 #define SYBEOOB 20022 944 #define SYBEBTYP 20023 945 #define SYBEBNCR 20024 946 #define SYBEIICL 20025 947 #define SYBECNOR 20026 948 #define SYBENPRM 20027 949 #define SYBEUVDT 20028 950 #define SYBEUFDT 20029 951 #define SYBEWAID 20030 952 #define SYBECDNS 20031 953 #define SYBEABNC 20032 954 #define SYBEABMT 20033 955 #define SYBEABNP 20034 956 #define SYBEAAMT 20035 957 #define SYBENXID 20036 958 #define SYBERXID 20037 959 #define SYBEICN 20038 960 #define SYBENMOB 20039 961 #define SYBEAPUT 20040 962 #define SYBEASNL 20041 963 #define SYBENTLL 20042 964 #define SYBEASUL 20043 965 #define SYBERDNR 20044 966 #define SYBENSIP 20045 967 #define SYBEABNV 20046 968 #define SYBEDDNE 20047 969 #define SYBECUFL 20048 970 #define SYBECOFL 20049 971 #define SYBECSYN 20050 972 #define SYBECLPR 20051 973 #define SYBECNOV 20052 974 #define SYBERDCN 20053 975 #define SYBESFOV 20054 976 #define SYBEUNT 20055 977 #define SYBECLOS 20056 978 #define SYBEUAVE 20057 979 #define SYBEUSCT 20058 980 #define SYBEEQVA 20059 981 #define SYBEUDTY 20060 982 #define SYBETSIT 20061 983 #define SYBEAUTN 20062 984 #define SYBEBDIO 20063 985 #define SYBEBCNT 20064 986 #define SYBEIFNB 20065 987 #define SYBETTS 20066 988 #define SYBEKBCO 20067 989 #define SYBEBBCI 20068 990 #define SYBEKBCI 20069 991 #define SYBEBCRE 20070 992 #define SYBETPTN 20071 993 #define SYBEBCWE 20072 994 #define SYBEBCNN 20073 995 #define SYBEBCOR 20074 996 #define SYBEBCIS 20075 997 #define SYBEBCPI 20076 998 #define SYBEBCPN 20077 999 #define SYBEBCPB 20078 1000 #define SYBEVDPT 20079 1001 #define SYBEBIVI 20080 1002 #define SYBEBCBC 20081 1003 #define SYBEBCFO 20082 1004 #define SYBEBCVH 20083 1005 #define SYBEBCUO 20084 1006 #define SYBEBCUC 20085 1007 #define SYBEBUOE 20086 1008 #define SYBEBUCE 20087 1009 #define SYBEBWEF 20088 1010 #define SYBEASTF 20089 1011 #define SYBEUACS 20090 1012 #define SYBEASEC 20091 1013 #define SYBETMTD 20092 1014 #define SYBENTTN 20093 1015 #define SYBEDNTI 20094 1016 #define SYBEBTMT 20095 1017 #define SYBEORPF 20096 1018 #define SYBEUVBF 20097 1019 #define SYBEBUOF 20098 1020 #define SYBEBUCF 20099 1021 #define SYBEBRFF 20100 1022 #define SYBEBWFF 20101 1023 #define SYBEBUDF 20102 1024 #define SYBEBIHC 20103 1025 #define SYBEBEOF 20104 1026 #define SYBEBCNL 20105 1027 #define SYBEBCSI 20106 1028 #define SYBEBCIT 20107 1029 #define SYBEBCSA 20108 1030 #define SYBENULL 20109 1031 #define SYBEUNAM 20110 1032 #define SYBEBCRO 20111 1033 #define SYBEMPLL 20112 1034 #define SYBERPIL 20113 1035 #define SYBERPUL 20114 1036 #define SYBEUNOP 20115 1037 #define SYBECRNC 20116 1038 #define SYBERTCC 20117 1039 #define SYBERTSC 20118 1040 #define SYBEUCRR 20119 1041 #define SYBERPNA 20120 1042 #define SYBEOPNA 20121 1043 #define SYBEFGTL 20122 1044 #define SYBECWLL 20123 1045 #define SYBEUFDS 20124 1046 #define SYBEUCPT 20125 1047 #define SYBETMCF 20126 1048 #define SYBEAICF 20127 1049 #define SYBEADST 20128 1050 #define SYBEALTT 20129 1051 #define SYBEAPCT 20130 1052 #define SYBEXOCI 20131 1053 #define SYBEFSHD 20132 1054 #define SYBEAOLF 20133 1055 #define SYBEARDI 20134 1056 #define SYBEURCI 20135 1057 #define SYBEARDL 20136 1058 #define SYBEURMI 20137 1059 #define SYBEUREM 20138 1060 #define SYBEURES 20139 1061 #define SYBEUREI 20140 1062 #define SYBEOREN 20141 1063 #define SYBEISOI 20142 1064 #define SYBEIDCL 20143 1065 #define SYBEIMCL 20144 1066 #define SYBEIFCL 20145 1067 #define SYBEUTDS 20146 1068 #define SYBEBUFF 20147 1069 #define SYBEACNV 20148 1070 #define SYBEDPOR 20149 1071 #define SYBENDC 20150 1072 #define SYBEMVOR 20151 1073 #define SYBEDVOR 20152 1074 #define SYBENBVP 20153 1075 #define SYBESPID 20154 1076 #define SYBENDTP 20155 1077 #define SYBEXTN 20156 1078 #define SYBEXTDN 20157 1079 #define SYBEXTSN 20158 1080 #define SYBENUM 20159 1081 #define SYBETYPE 20160 1082 #define SYBEGENOS 20161 1083 #define SYBEPAGE 20162 1084 #define SYBEOPTNO 20163 1085 #define SYBEETD 20164 1086 #define SYBERTYPE 20165 1087 #define SYBERFILE 20166 1088 #define SYBEFMODE 20167 1089 #define SYBESLCT 20168 1090 #define SYBEZTXT 20169 1091 #define SYBENTST 20170 1092 #define SYBEOSSL 20171 1093 #define SYBEESSL 20172 1094 #define SYBENLNL 20173 1095 #define SYBENHAN 20174 1096 #define SYBENBUF 20175 1097 #define SYBENULP 20176 1098 #define SYBENOTI 20177 1099 #define SYBEEVOP 20178 1100 #define SYBENEHA 20179 1101 #define SYBETRAN 20180 1102 #define SYBEEVST 20181 1103 #define SYBEEINI 20182 1104 #define SYBEECRT 20183 1105 #define SYBEECAN 20184 1106 #define SYBEEUNR 20185 1107 #define SYBERPCS 20186 1108 #define SYBETPAR 20187 1109 #define SYBETEXS 20188 1110 #define SYBETRAC 20189 1111 #define SYBETRAS 20190 1112 #define SYBEPRTF 20191 1113 #define SYBETRSN 20192 1114 #define SYBEBPKS 20193 1115 #define SYBEIPV 20194 1116 #define SYBEMOV 20195 1117 #define SYBEDIVZ 20196 1118 #define SYBEASTL 20197 1119 #define SYBESEFA 20198 1120 #define SYBEPOLL 20199 1121 #define SYBENOEV 20200 1122 #define SYBEBADPK 20201 1123 #define SYBESECURE 20202 1124 #define SYBECAP 20203 1125 #define SYBEFUNC 20204 1126 #define SYBERESP 20205 1127 #define SYBEIVERS 20206 1128 #define SYBEONCE 20207 1129 #define SYBERPNULL 20208 1130 #define SYBERPTXTIM 20209 1131 #define SYBENEG 20210 1132 #define SYBELBLEN 20211 1133 #define SYBEUMSG 20212 1134 #define SYBECAPTYP 20213 1135 #define SYBEBNUM 20214 1136 #define SYBEBBL 20215 1137 #define SYBEBPREC 20216 1138 #define SYBEBSCALE 20217 1139 #define SYBECDOMAIN 20218 1140 #define SYBECINTERNAL 20219 1141 #define SYBEBTYPSRV 20220 1142 #define SYBEBCSET 20221 1143 #define SYBEFENC 20222 1144 #define SYBEFRES 20223 1145 #define SYBEISRVPREC 20224 1146 #define SYBEISRVSCL 20225 1147 #define SYBEINUMCL 20226 1148 #define SYBEIDECCL 20227 1149 #define SYBEBCMTXT 20228 1150 #define SYBEBCPREC 20229 1151 #define SYBEBCBNPR 20230 1152 #define SYBEBCBNTYP 20231 1153 #define SYBEBCSNTYP 20232 1154 #define SYBEBCPCTYP 20233 1155 #define SYBEBCVLEN 20234 1156 #define SYBEBCHLEN 20235 1157 #define SYBEBCBPREF 20236 1158 #define SYBEBCPREF 20237 1159 #define SYBEBCITBNM 20238 1160 #define SYBEBCITBLEN 20239 1161 #define SYBEBCSNDROW 20240 1162 #define SYBEBPROCOL 20241 1163 #define SYBEBPRODEF 20242 1164 #define SYBEBPRONUMDEF 20243 1165 #define SYBEBPRODEFID 20244 1166 #define SYBEBPRONODEF 20245 1167 #define SYBEBPRODEFTYP 20246 1168 #define SYBEBPROEXTDEF 20247 1169 #define SYBEBPROEXTRES 20248 1170 #define SYBEBPROBADDEF 20249 1171 #define SYBEBPROBADTYP 20250 1172 #define SYBEBPROBADLEN 20251 1173 #define SYBEBPROBADPREC 20252 1174 #define SYBEBPROBADSCL 20253 1175 #define SYBEBADTYPE 20254 1176 #define SYBECRSNORES 20255 1177 #define SYBECRSNOIND 20256 1178 #define SYBECRSVIEW 20257 1179 #define SYBECRSVIIND 20258 1180 #define SYBECRSORD 20259 1181 #define SYBECRSBUFR 20260 1182 #define SYBECRSNOFREE 20261 1183 #define SYBECRSDIS 20262 1184 #define SYBECRSAGR 20263 1185 #define SYBECRSFRAND 20264 1186 #define SYBECRSFLAST 20265 1187 #define SYBECRSBROL 20266 1188 #define SYBECRSFROWN 20267 1189 #define SYBECRSBSKEY 20268 1190 #define SYBECRSRO 20269 1191 #define SYBECRSNOCOUNT 20270 1192 #define SYBECRSTAB 20271 1193 #define SYBECRSUPDNB 20272 1194 #define SYBECRSNOWHERE 20273 1195 #define SYBECRSSET 20274 1196 #define SYBECRSUPDTAB 20275 1197 #define SYBECRSNOUPD 20276 1198 #define SYBECRSINV 20277 1199 #define SYBECRSNOKEYS 20278 1200 #define SYBECRSNOBIND 20279 1201 #define SYBECRSFTYPE 20280 1202 #define SYBECRSINVALID 20281 1203 #define SYBECRSMROWS 20282 1204 #define SYBECRSNROWS 20283 1205 #define SYBECRSNOLEN 20284 1206 #define SYBECRSNOPTCC 20285 1207 #define SYBECRSNORDER 20286 1208 #define SYBECRSNOTABLE 20287 1209 #define SYBECRSNUNIQUE 20288 1210 #define SYBECRSVAR 20289 1211 #define SYBENOVALUE 20290 1212 #define SYBEVOIDRET 20291 1213 #define SYBECLOSEIN 20292 1214 #define SYBEBOOL 20293 1215 #define SYBEBCPOPT 20294 1216 #define SYBEERRLABEL 20295 1217 #define SYBEATTNACK 20296 1218 #define SYBEBBFL 20297 1219 #define SYBEDCL 20298 1220 #define SYBECS 20299 1221 #define SYBEBULKINSERT 20599 1222 #define SYBECOLSIZE 22000 1224 int dbtds(DBPROCESS * dbprocess);
1226 #define DBTDS(a) dbtds(a) 1227 DBINT dbtextsize(DBPROCESS * dbprocess);
1228 DBBINARY *
dbtxptr(DBPROCESS * dbproc,
int column);
1230 DBBINARY *dbtxtsnewval(DBPROCESS * dbprocess);
1231 RETCODE dbtxtsput(DBPROCESS * dbprocess, DBBINARY newtxts,
int colnum);
1232 RETCODE
dbuse(DBPROCESS * dbproc,
const char *name);
1235 RETCODE
dbwritetext(DBPROCESS * dbproc,
char *objname, DBBINARY * textptr, DBTINYINT textptrlen, DBBINARY * timestamp,
1236 DBBOOL log, DBINT size, BYTE * text);
1239 RETCODE
dbsetlname(LOGINREC * login,
const char *value,
int which);
1240 RETCODE
dbsetlbool(LOGINREC * login,
int value,
int which);
1241 RETCODE dbsetlshort(LOGINREC * login,
int value,
int which);
1242 RETCODE
dbsetllong(LOGINREC * login,
long value,
int which);
1246 #define DBSETLHOST(x,y) dbsetlname((x), (y), DBSETHOST) 1247 #define dbsetlhost(x,y) dbsetlname((x), (y), DBSETHOST) 1249 #define DBSETLUSER(x,y) dbsetlname((x), (y), DBSETUSER) 1250 #define dbsetluser(x,y) dbsetlname((x), (y), DBSETUSER) 1252 #define DBSETLPWD(x,y) dbsetlname((x), (y), DBSETPWD) 1253 #define dbsetlpwd(x,y) dbsetlname((x), (y), DBSETPWD) 1254 #if defined(DBLIB_UNIMPLEMENTED) 1256 # define DBSETLHID(x,y) dbsetlname((x), (y), DBSETHID) 1259 #define DBSETLAPP(x,y) dbsetlname((x), (y), DBSETAPP) 1260 #define dbsetlapp(x,y) dbsetlname((x), (y), DBSETAPP) 1262 #define BCP_SETL(x,y) dbsetlbool((x), (y), DBSETBCP) 1263 #define DBSETLSECURE(x) dbsetlbool((x), (1), DBSETBCP) 1264 #define DBSETNATLANG 7 1265 #define DBSETLNATLANG(x,y) dbsetlname((x), (y), DBSETNATLANG) 1266 #define dbsetlnatlang(x,y) dbsetlname((x), (y), DBSETNATLANG) 1267 #if defined(DBLIB_UNIMPLEMENTED) 1268 # define DBSETNOSHORT 8 1269 # define DBSETLNOSHORT(x,y) dbsetlbool((x), (y), DBSETNOSHORT) 1270 # define DBSETHIER 9 1271 # define DBSETLHIER(x,y) dbsetlshort((x), (y), DBSETHIER) 1273 #define DBSETCHARSET 10 1274 #define DBSETLCHARSET(x,y) dbsetlname((x), (y), DBSETCHARSET) 1275 #define DBSETPACKET 11 1276 #define DBSETLPACKET(x,y) dbsetllong((x), (y), DBSETPACKET) 1277 #define dbsetlpacket(x,y) dbsetllong((x), (y), DBSETPACKET) 1278 #define DBSETENCRYPT 12 1279 #define DBSETLENCRYPT(x,y) dbsetlbool((x), (y), DBSETENCRYPT) 1280 #define DBSETLABELED 13 1281 #define DBSETLLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED) 1282 #define BCP_SETLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED) 1283 #define DBSETDBNAME 14 1284 #define DBSETLDBNAME(x,y) dbsetlname((x), (y), DBSETDBNAME) 1285 #define DBSETLVERSION(login, version) dbsetlversion((login), (version)) 1287 #define DBSETUTF16 1001 1288 #define DBSETLUTF16(x,y) dbsetlbool((x), (y), DBSETUTF16) 1289 #define DBSETNTLMV2 1002 1290 #define DBSETLNTLMV2(x,y) dbsetlbool((x), (y), DBSETNTLMV2) 1291 #define DBSETREADONLY 1003 1292 #define DBSETLREADONLY(x,y) dbsetlbool((x), (y), DBSETREADONLY) 1294 RETCODE
bcp_init(DBPROCESS * dbproc,
const char *tblname,
const char *hfile,
const char *errfile,
int direction);
1295 DBINT
bcp_done(DBPROCESS * dbproc);
1298 RETCODE
bcp_bind(DBPROCESS * dbproc, BYTE * varaddr,
int prefixlen, DBINT varlen, BYTE * terminator,
int termlen,
int type,
1300 RETCODE
bcp_collen(DBPROCESS * dbproc, DBINT varlen,
int table_column);
1301 RETCODE
bcp_columns(DBPROCESS * dbproc,
int host_colcount);
1302 RETCODE
bcp_colfmt(DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1303 const BYTE * host_term,
int host_termlen,
int colnum);
1304 RETCODE
bcp_colfmt_ps(DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1305 BYTE * host_term,
int host_termlen,
int colnum,
DBTYPEINFO * typeinfo);
1306 RETCODE
bcp_colptr(DBPROCESS * dbproc, BYTE * colptr,
int table_column);
1307 RETCODE
bcp_control(DBPROCESS * dbproc,
int field, DBINT value);
1308 int bcp_getbatchsize(DBPROCESS * dbproc);
1309 RETCODE
bcp_exec(DBPROCESS * dbproc, DBINT * rows_copied);
1311 RETCODE
bcp_options(DBPROCESS * dbproc,
int option, BYTE * value,
int valuelen);
1312 RETCODE
bcp_readfmt(DBPROCESS * dbproc,
const char filename[]);
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Definition: dblib.c:6859
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:7153
RETCODE dbcancel(DBPROCESS *dbproc)
Cancel the current command batch.
Definition: dblib.c:3231
RETCODE dbcanquery(DBPROCESS *dbproc)
Cancel the query currently being retrieved, discarding all pending rows.
Definition: dblib.c:5878
RETCODE dbmny4sub(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *diff)
Subtract two DBMONEY4 values.
Definition: dblib.c:5472
RETCODE dbmnydec(DBPROCESS *dbproc, DBMONEY *mnyptr)
Subtract $0.0001 from a DBMONEY value.
Definition: dblib.c:5339
DBINT dbprcollen(DBPROCESS *dbproc, int column)
Get size of a result column needed to print column.
Definition: dblib.c:3086
void dbsetavail(DBPROCESS *dbprocess)
Mark a DBPROCESS as "available".
Definition: dblib.c:7128
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:164
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:2028
BYTE * dbdata(DBPROCESS *dbproc, int column)
Get address of data in a regular result column.
Definition: dblib.c:3189
RETCODE dbmnyzero(DBPROCESS *dbproc, DBMONEY *dest)
Set a DBMONEY value to zero.
Definition: dblib.c:5172
int dbmnycmp(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2)
Compare two DBMONEY values.
Definition: dblib.c:5114
void dbrecftos(const char filename[])
Record to a file all SQL commands sent to the server.
Definition: dblib.c:6619
int dbaltop(DBPROCESS *dbproc, int computeid, int column)
Get aggregation operator for a compute column.
Definition: dblib.c:4294
RETCODE dbsqlok(DBPROCESS *dbproc)
Wait for results of a query from the server.
Definition: dblib.c:4661
RETCODE dbrpcsend(DBPROCESS *dbproc)
Execute the procedure and free associated memory.
Definition: rpc.c:281
void dbloginfree(LOGINREC *login)
free the LOGINREC
Definition: dblib.c:748
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition: dblib.c:1688
int dbalttype(DBPROCESS *dbproc, int computeid, int column)
Get datatype for a compute column.
Definition: dblib.c:4181
RETCODE dbsetlbool(LOGINREC *login, int value, int which)
Set a boolean value in a LOGINREC structure.
Definition: dblib.c:904
DBPROCESS * dbopen(LOGINREC *login, const char *server)
Normally not used.
Definition: dbopen.c:36
char * dbretname(DBPROCESS *dbproc, int retnum)
Get name of an output parameter filled by a stored procedure.
Definition: dblib.c:4571
DBINT dbaltutype(DBPROCESS *dbproc, int computeid, int column)
Get user-defined datatype of a compute column.
Definition: dblib.c:6966
DBINT dbspr1rowlen(DBPROCESS *dbproc)
Determine size buffer required to hold the results returned by dbsprhead(), dbsprline(), and dbspr1row().
Definition: dblib.c:3256
RETCODE dbcmdrow(DBPROCESS *dbproc)
See if the current command can return rows.
Definition: dblib.c:4099
DBINT bcp_batch(DBPROCESS *dbproc)
Commit a set of rows to the table.
Definition: bcp.c:1959
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:2941
DBBOOL bcp_getl(LOGINREC *login)
See if BCP_SETL() was used to set the LOGINREC for BCP work.
Definition: bcp.c:697
RETCODE bcp_readfmt(DBPROCESS *dbproc, const char filename[])
Read a format definition file.
Definition: bcp.c:1627
void dbexit(void)
Close server connections and free all related structures.
Definition: dblib.c:1541
int dbrettype(DBPROCESS *dbproc, int retnum)
Get datatype of a stored procedure's return parameter.
Definition: dblib.c:6118
int dbmny4cmp(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2)
Compare two DBMONEY4 values.
Definition: dblib.c:5560
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
Definition: dblib.c:1359
RETCODE dbdatecrack(DBPROCESS *dbproc, DBDATEREC *di, DBDATETIME *dt)
Break a DBDATETIME value into useful pieces.
Definition: dblib.c:5695
RETCODE dbmny4minus(DBPROCESS *dbproc, DBMONEY4 *src, DBMONEY4 *dest)
Negate a DBMONEY4 value.
Definition: dblib.c:5394
DBINT dbretstatus(DBPROCESS *dbproc)
Fetch status value returned by query or remote procedure call.
Definition: dblib.c:4521
RETCODE dbsetlversion(LOGINREC *login, BYTE version)
Set TDS version for future connections.
Definition: dblib.c:942
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:907
STATUS dbreadtext(DBPROCESS *dbproc, void *buf, DBINT bufsize)
Fetch part of a text or image value from the server.
Definition: dblib.c:6515
int dbdatecmp(DBPROCESS *dbproc, DBDATETIME *d1, DBDATETIME *d2)
Compare DBDATETIME values, similar to strcmp(3).
Definition: dblib.c:5613
int dbspid(DBPROCESS *dbproc)
Get server process ID for a DBPROCESS.
Definition: dblib.c:5768
void dbsetuserdata(DBPROCESS *dbproc, BYTE *ptr)
Associate client-allocated (and defined) data with a DBPROCESS.
Definition: dblib.c:5788
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition: bcp.c:539
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition: dblib.c:716
int dbnumrets(DBPROCESS *dbproc)
Get count of output parameters filled by a stored procedure.
Definition: dblib.c:4539
DBTYPEINFO * dbcoltypeinfo(DBPROCESS *dbproc, int column)
Get precision and scale information for a regular result column.
Definition: dblib.c:2912
DBINT dbdatlen(DBPROCESS *dbproc, int column)
Get size of current row's data in a regular result column.
Definition: dblib.c:3161
RETCODE dbmnyminus(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Negate a DBMONEY value.
Definition: dblib.c:5367
void dbfreebuf(DBPROCESS *dbproc)
Erase the command buffer, in case DBNOAUTOFREE was set with dbsetopt().
Definition: dblib.c:5910
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:4217
int dbnumcols(DBPROCESS *dbproc)
Return number of regular columns in a result set.
Definition: dblib.c:1842
RETCODE bcp_exec(DBPROCESS *dbproc, DBINT *rows_copied)
Write a datafile to a table.
Definition: bcp.c:1566
RETCODE dbsetnull(DBPROCESS *dbprocess, int bindtype, int bindlen, BYTE *bindval)
Define substitution values to be used when binding null values.
Definition: dblib.c:1930
DBINT dbvarylen(DBPROCESS *dbproc, int column)
Determine whether a column can vary in size.
Definition: dblib.c:3112
DBINT dbcurrow(DBPROCESS *dbproc)
Get number of the row currently being read.
Definition: dblib.c:6036
RETCODE bcp_columns(DBPROCESS *dbproc, int host_colcount)
Indicate how many columns are to be found in the datafile.
Definition: bcp.c:296
RETCODE dbuse(DBPROCESS *dbproc, const char *name)
Change current database.
Definition: dblib.c:1431
DBINT dbcollen(DBPROCESS *dbproc, int column)
Get size of a regular result column.
Definition: dblib.c:3063
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:6446
void dbprhead(DBPROCESS *dbproc)
Print result set headings to stdout.
Definition: dblib.c:3796
int dbgetmaxprocs(void)
get maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:4010
Definition: dbpivot.c:764
RETCODE bcp_sendrow(DBPROCESS *dbproc)
Write data in host variables to the table.
Definition: bcp.c:1339
RETCODE dbsqlsend(DBPROCESS *dbproc)
Transmit the command buffer to the server.
Definition: dblib.c:6895
RETCODE dbmny4copy(DBPROCESS *dbprocess, DBMONEY4 *m1, DBMONEY4 *m2)
Copy a DBMONEY4 value.
Definition: dblib.c:5588
RETCODE dbmoretext(DBPROCESS *dbproc, DBINT size, const BYTE text[])
Send chunk of a text/image value to the server.
Definition: dblib.c:6584
RETCODE dbmny4zero(DBPROCESS *dbproc, DBMONEY4 *dest)
Zero a DBMONEY4 value.
Definition: dblib.c:5418
const char * dbmonthname(DBPROCESS *dbproc, char *language, int monthnum, DBBOOL shortform)
Get name of a month, in some human language.
Definition: dblib.c:6810
RETCODE dbmnycopy(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Copy a DBMONEY value.
Definition: dblib.c:5857
DBINT dbadlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in a compute column.
Definition: dblib.c:4150
DBSMALLINT offset
time offset
Definition: sybdb.h:310
RETCODE dbmnymaxpos(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum positive DBMONEY value supported.
Definition: dblib.c:5193
RETCODE dbspr1row(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print a regular result row to a buffer.
Definition: dblib.c:3294
int dbiordesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to read data coming from the server...
Definition: dblib.c:7084
DBINT dbcount(DBPROCESS *dbproc)
Get count of rows processed.
Definition: dblib.c:2793
DBINT dblastrow(DBPROCESS *dbproc)
Get number of the last row in the row buffer.
Definition: dblib.c:7060
DBINT dbconvert(DBPROCESS *dbproc, int srctype, const BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen)
cf.
Definition: dblib.c:2562
int dbaltcolid(DBPROCESS *dbproc, int computeid, int column)
Get column ID of a compute column.
Definition: dblib.c:4123
const char * dbprtype(int token)
Print a token value's name to a buffer.
Definition: dblib.c:6300
DBUBIGINT time
time, 7 digit precision
Definition: sybdb.h:308
int dbgetpacket(DBPROCESS *dbproc)
Get TDS packet size for the connection.
Definition: dblib.c:3912
RETCODE dbmny4add(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *sum)
Add two DBMONEY4 values.
Definition: dblib.c:5441
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:5716
STATUS dbsetrow(DBPROCESS *dbprocess, DBINT row)
Make a buffered row "current" without fetching it into bound variables.
Definition: dblib.c:2013
RETCODE dbmnyinc(DBPROCESS *dbproc, DBMONEY *mnyptr)
Add $0.0001 to a DBMONEY value.
Definition: dblib.c:5311
RETCODE dbsetlname(LOGINREC *login, const char *value, int which)
Set the value of a string in a LOGINREC structure.
Definition: dblib.c:770
RETCODE dbmnymaxneg(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum negative DBMONEY value supported.
Definition: dblib.c:5214
RETCODE dbinit(void)
Initialize db-lib.
Definition: dblib.c:671
char * dbcolname(DBPROCESS *dbproc, int column)
Return name of a regular result column.
Definition: dblib.c:1866
RETCODE dbmorecmds(DBPROCESS *dbproc)
See if more commands are to be processed.
Definition: dblib.c:6087
DBINT bcp_done(DBPROCESS *dbproc)
Conclude the transfer of data from program variables.
Definition: bcp.c:1986
RETCODE dbsprhead(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print result set headings to a buffer.
Definition: dblib.c:3732
BYTE * dbretdata(DBPROCESS *dbproc, int retnum)
Get value of an output parameter filled by a stored procedure.
Definition: dblib.c:4600
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:2269
char * dbcolsource(DBPROCESS *dbproc, int colnum)
Get base database column name for a result set column.
Definition: dblib.c:3038
DBBOOL dbhasretstat(DBPROCESS *dbproc)
Determine if query generated a return status number.
Definition: dblib.c:4497
BYTE * dbbylist(DBPROCESS *dbproc, int computeid, int *size)
Get bylist for a compute row.
Definition: dblib.c:4847
DBBINARY * dbtxtimestamp(DBPROCESS *dbproc, int column)
Get text timestamp for a column in the current row.
Definition: dblib.c:6379
RETCODE dbrows(DBPROCESS *dbproc)
Indicate whether a query returned rows.
Definition: dblib.c:3871
DBINT dbaltlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in compute column.
Definition: dblib.c:6990
RETCODE dbsprline(DBPROCESS *dbproc, char *buffer, DBINT buf_len, DBCHAR line_char)
Get formatted string for underlining dbsprhead() column names.
Definition: dblib.c:3674
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:4478
char * dbchange(DBPROCESS *dbprocess)
See if a command caused the current database to change.
Definition: dblib.c:6839
RETCODE dbsetmaxprocs(int maxprocs)
Set maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3936
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:504
DBINT dbfirstrow(DBPROCESS *dbproc)
See if a server response has arrived.
Definition: dblib.c:7045
int dbgettime(void)
Get maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4062
int dbcurcmd(DBPROCESS *dbproc)
Get number of the row just returned.
Definition: dblib.c:6070
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:6239
RETCODE dbrpcinit(DBPROCESS *dbproc, const char rpcname[], DBSMALLINT options)
Initialize a remote procedure call.
Definition: rpc.c:72
RETCODE dbsetllong(LOGINREC *login, long value, int which)
Set an integer value in a LOGINREC structure.
Definition: dblib.c:833
BYTE * dbadata(DBPROCESS *dbproc, int computeid, int column)
Get address of compute column data.
Definition: dblib.c:4264
char * dbservcharset(DBPROCESS *dbprocess)
Get syscharset name of the server character set.
Definition: dblib.c:6875
RETCODE dbsetversion(DBINT version)
Specify a db-lib version level.
Definition: dblib.c:5824
int dbnumcompute(DBPROCESS *dbprocess)
Get count of COMPUTE clauses for a result set.
Definition: dblib.c:4821
DBINT date
date, 0 = 1900-01-01
Definition: sybdb.h:309
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:155
BYTE * dbgetuserdata(DBPROCESS *dbproc)
Get address of user-allocated data from a DBPROCESS.
Definition: dblib.c:5806
int dbtds(DBPROCESS *dbprocess)
Get the TDS version in use for dbproc.
Definition: dblib.c:6653
int dbiowdesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to write data coming to the server...
Definition: dblib.c:7100
BOOL dbiscount(DBPROCESS *dbproc)
Indicates whether or not the count returned by dbcount is real (Microsoft-compatibility feature)...
Definition: dblib.c:2773
int dbstrlen(DBPROCESS *dbproc)
Get size of the command buffer, in bytes.
Definition: dblib.c:6143
RETCODE bcp_options(DBPROCESS *dbproc, int option, BYTE *value, int valuelen)
Set "hints" for uploading a file.
Definition: bcp.c:613
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition: dblib.c:2860
DBINT dbcolutype(DBPROCESS *dbprocess, int column)
Get user-defined datatype of a regular result column.
Definition: dblib.c:2889
char * dbgetchar(DBPROCESS *dbprocess, int n)
Get address of a position in the command buffer.
Definition: dblib.c:6162
STATUS dbrowtype(DBPROCESS *dbprocess)
Get returned row's type.
Definition: dblib.c:6053
void dbclose(DBPROCESS *dbproc)
Close a connection to the server and free associated resources.
Definition: dblib.c:1474
DBBOOL dbwillconvert(int srctype, int desttype)
Test whether or not a datatype can be converted to another datatype.
Definition: dblib.c:2843
RETCODE dbsetopt(DBPROCESS *dbproc, int option, const char *char_param, int int_param)
Set db-lib or server option.
Definition: dblib.c:4322
void dbsetifile(char *filename)
set name and location of the interfaces file FreeTDS should use to look up a servername.
Definition: dblib.c:2680
RETCODE bcp_colptr(DBPROCESS *dbproc, BYTE *colptr, int table_column)
Override bcp_bind() by pointing to a different host variable.
Definition: bcp.c:661
DBBOOL dbisopt(DBPROCESS *dbproc, int option, const char param[])
Get value of an option.
Definition: dblib.c:6013
RETCODE dbsettime(int seconds)
Set maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4031
void dbclrbuf(DBPROCESS *dbproc, DBINT n)
Clear n rows from the row buffer.
Definition: dblib.c:2813
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition: dblib.c:4969
RETCODE dbnullbind(DBPROCESS *dbproc, int column, DBINT *indicator)
Tie a null-indicator to a regular result column.
Definition: dblib.c:2709
DBBOOL dbdead(DBPROCESS *dbproc)
Check if dbproc is an ex-parrot.
Definition: dblib.c:4906
int dbretlen(DBPROCESS *dbproc, int retnum)
Get size of an output parameter filled by a stored procedure.
Definition: dblib.c:4626
DBBINARY * dbtxptr(DBPROCESS *dbproc, int column)
Get text pointer for a column in the current row.
Definition: dblib.c:6409
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition: dblib.c:1405
RETCODE dbstrcpy(DBPROCESS *dbproc, int start, int numbytes, char *dest)
Get a copy of a chunk of the command buffer.
Definition: dblib.c:6195
RETCODE dbclropt(DBPROCESS *dbproc, int option, const char param[])
Reset an option.
Definition: dblib.c:5945
RETCODE dbsetlogintime(int seconds)
Set maximum seconds db-lib waits for a server response to a login attempt.
Definition: dblib.c:4078
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:372
int dbnumalts(DBPROCESS *dbproc, int computeid)
Get count of columns in a compute row.
Definition: dblib.c:4788
const char * dbversion(void)
See which version of db-lib is in use.
Definition: dblib.c:6692
RETCODE dbprrow(DBPROCESS *dbproc)
Print a result set to stdout.
Definition: dblib.c:3377
RETCODE dbbind(DBPROCESS *dbproc, int column, int vartype, DBINT varlen, BYTE *varaddr)
Tie a host variable to a resultset column.
Definition: dblib.c:2603
DBPROCESS * tdsdbopen(LOGINREC *login, const char *server, int msdblib)
Form a connection with the server.
Definition: dblib.c:1171
RETCODE dbanullbind(DBPROCESS *dbprocess, int computeid, int column, DBINT *indicator)
Tie a null-indicator to a compute result column.
Definition: dblib.c:2745
RETCODE dbfcmd(DBPROCESS *dbproc, const char *fmt,...)
printf-like way to form SQL to send to the server.
Definition: dblib.c:1320
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:6317
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:261
RETCODE dbgetrow(DBPROCESS *dbproc, DBINT row)
Read a row from the row buffer.
Definition: dblib.c:1898
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition: dblib.c:4988