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 97 #define DBTDS_8_0 ("Use DBTDS_7_1 instead"*x) 98 #define DBTDS_9_0 ("Use DBTDS_7_2 instead"*x) 103 #define DBTDS_8_0_ 13 111 #define BCPKEEPIDENTITY 8 122 typedef void DBCURSOR;
123 typedef void DBXLATE;
124 typedef void DBSORTORDER;
125 typedef void DBLOGINFO;
126 typedef void *DBVOIDPTR;
128 typedef unsigned short USHORT;
129 typedef int (*INTFUNCPTR) (
void *, ...);
130 typedef int (*DBWAITFUNC) (void);
131 typedef DBWAITFUNC(*DB_DBBUSY_FUNC) (
void *dbproc);
132 typedef void (*DB_DBIDLE_FUNC) (DBWAITFUNC dfunc,
void *dbproc);
133 typedef int (*DB_DBCHKINTR_FUNC) (
void *dbproc);
134 typedef int (*DB_DBHNDLINTR_FUNC) (
void *dbproc);
136 #ifndef __INCvxWorksh 148 #if !defined(_WINDEF_) && !defined(_WINDEF_H) && !defined(DOS32X) 153 #ifndef _tdsguard_hfOrWb5znoUCWdBPoNQvqN_ 159 #define SYBCHAR SYBCHAR 161 #define SYBVARCHAR SYBVARCHAR 163 #define SYBINTN SYBINTN 165 #define SYBINT1 SYBINT1 167 #define SYBINT2 SYBINT2 169 #define SYBINT4 SYBINT4 171 #define SYBINT8 SYBINT8 173 #define SYBFLT8 SYBFLT8 175 #define SYBDATETIME SYBDATETIME 177 #define SYBBIT SYBBIT 179 #define SYBBITN SYBBITN 181 #define SYBTEXT SYBTEXT 183 #define SYBNTEXT SYBNTEXT 185 #define SYBIMAGE SYBIMAGE 187 #define SYBMONEY4 SYBMONEY4 189 #define SYBMONEY SYBMONEY 191 #define SYBDATETIME4 SYBDATETIME4 193 #define SYBREAL SYBREAL 195 #define SYBBINARY SYBBINARY 197 #define SYBVOID SYBVOID 199 #define SYBVARBINARY SYBVARBINARY 201 #define SYBNUMERIC SYBNUMERIC 203 #define SYBDECIMAL SYBDECIMAL 205 #define SYBFLTN SYBFLTN 207 #define SYBMONEYN SYBMONEYN 209 #define SYBDATETIMN SYBDATETIMN 211 #define SYBNVARCHAR SYBNVARCHAR 213 #define SYBDATE SYBDATE 215 #define SYBTIME SYBTIME 216 SYBBIGDATETIME = 187,
217 #define SYBBIGDATETIME SYBBIGDATETIME 219 #define SYBBIGTIME SYBBIGTIME 221 #define SYBMSDATE SYBMSDATE 223 #define SYBMSTIME SYBMSTIME 225 #define SYBMSDATETIME2 SYBMSDATETIME2 226 SYBMSDATETIMEOFFSET = 43,
227 #define SYBMSDATETIMEOFFSET SYBMSDATETIMEOFFSET 230 #define SYBAOPCNT 0x4b 231 #define SYBAOPCNTU 0x4c 232 #define SYBAOPSUM 0x4d 233 #define SYBAOPSUMU 0x4e 234 #define SYBAOPAVG 0x4f 235 #define SYBAOPAVGU 0x50 236 #define SYBAOPMIN 0x51 237 #define SYBAOPMAX 0x52 240 #define SYBAOPCNT_BIG 0x09 241 #define SYBAOPSTDEV 0x30 242 #define SYBAOPSTDEVP 0x31 243 #define SYBAOPVAR 0x32 244 #define SYBAOPVARP 0x33 245 #define SYBAOPCHECKSUM_AGG 0x72 249 typedef unsigned char DBBOOL;
251 typedef unsigned char DBBIT;
252 typedef unsigned char DBTINYINT;
253 typedef int16_t DBSMALLINT;
254 typedef int32_t DBINT;
255 typedef int64_t DBBIGINT;
256 typedef unsigned char DBBINARY;
257 typedef tds_sysdep_real32_type DBREAL;
258 typedef tds_sysdep_real64_type DBFLT8;
259 typedef uint16_t DBUSMALLINT;
260 typedef uint32_t DBUINT;
261 typedef uint64_t DBUBIGINT;
272 unsigned char array[256];
277 unsigned char precision;
279 unsigned char array[33];
312 DBUSMALLINT time_prec:3;
316 DBUSMALLINT has_time:1;
317 DBUSMALLINT has_date:1;
318 DBUSMALLINT has_offset:1;
322 # define SQLCHAR SYBCHAR 333 typedef unsigned char BYTE;
352 { MAXCOLNAMELEN = 512 };
353 typedef enum { CI_REGULAR=1, CI_ALTERNATE=2, CI_CURSOR=3 } CI_TYPE;
358 DBCHAR Name[MAXCOLNAMELEN+2];
359 DBCHAR ActualName[MAXCOLNAMELEN+2];
360 DBCHAR TableName[MAXCOLNAMELEN+2];
377 DBCHAR Name[MAXCOLNAMELEN+2];
378 DBCHAR ActualName[MAXCOLNAMELEN+2];
379 DBCHAR TableName[MAXCOLNAMELEN+2];
391 DBINT ServerMaxLength;
392 DBCHAR ServerTypeDeclaration[256];
399 #define DBPARSEONLY 0 403 #define DBARITHIGNORE 4 405 #define DBARITHABORT 6 406 #define DBTEXTLIMIT 7 412 #define DBSTORPROCID 13 414 #define DBNOAUTOFREE 15 415 #define DBROWCOUNT 16 416 #define DBTEXTSIZE 17 418 #define DBDATEFORMAT 19 420 #define DBPRCOLSEP 21 421 #define DBPRLINELEN 22 422 #define DBPRLINESEP 23 423 #define DBLFCONVERT 24 424 #define DBDATEFIRST 25 425 #define DBCHAINXACTS 26 426 #define DBFIPSFLAG 27 427 #define DBISOLATION 28 429 #define DBIDENTITY 30 431 #define DBDATESHORT 32 432 #define DBCLIENTCURSORS 33 434 #define DBQUOTEDIDENT 35 436 #define DBNUMOPTIONS 36 444 #define NOSUCHOPTION 2 446 #define MAXOPTTEXT 32 531 typedef int (*EHANDLEFUNC) (DBPROCESS * dbproc,
int severity,
int dberr,
int oserr,
char *dberrstr,
char *oserrstr);
533 typedef int (*MHANDLEFUNC) (DBPROCESS * dbproc, DBINT msgno,
int msgstate,
int severity,
char *msgtext,
char *srvname,
534 char *proc,
int line);
538 #define DBNOTIFICATION 2 540 #define DBINTERRUPT 4 548 #define NTBSTRINGBIND 2 549 #define VARYCHARBIND 3 550 #define VARYBINBIND 4 556 #define DATETIMEBIND 11 557 #define SMALLDATETIMEBIND 12 559 #define SMALLMONEYBIND 14 560 #define BINARYBIND 15 562 #define NUMERICBIND 17 563 #define DECIMALBIND 18 564 #define SRCNUMERICBIND 19 565 #define SRCDECIMALBIND 20 568 #define BIGDATETIMEBIND 23 569 #define BIGTIMEBIND 24 570 #define BIGINTBIND 30 571 #define DATETIME2BIND 31 572 #define MAXBINDTYPES 32 574 #define DBPRCOLSEP 21 575 #define DBPRLINELEN 22 576 #define DBRPCNORETURN 0 577 #define DBRPCRETURN 1 578 #define DBRPCDEFAULT 2 582 #define NO_MORE_ROWS -2 584 #define NO_MORE_RESULTS 2 590 #define DB_QUERYOUT 3 597 #define DBRPCRECOMPILE TDS_STATIC_CAST(DBSMALLINT, 0x0001) 598 #define DBRPCRESET TDS_STATIC_CAST(DBSMALLINT, 0x0002) 599 #define DBRPCCURSOR TDS_STATIC_CAST(DBSMALLINT, 0x0008) 601 #if defined(DBLIB_UNIMPLEMENTED) 602 DBBOOL db12hour(DBPROCESS * dbprocess,
const char language[]);
604 DBBOOL dbcolbrowse(DBPROCESS * dbprocess,
int colnum);
606 RETCODE dbcursor(DBCURSOR * hc, DBINT optype, DBINT bufno, BYTE * table, BYTE * values);
607 RETCODE dbcursorbind(DBCURSOR * hc,
int col,
int vartype, DBINT varlen, DBINT * poutlen, BYTE * pvaraddr,
DBTYPEINFO * typeinfo);
608 void dbcursorclose(DBCURSOR * hc);
609 RETCODE dbcursorcolinfo(DBCURSOR * hc, DBINT column, DBCHAR * colname, DBINT * coltype, DBINT * collen, DBINT * usertype);
610 RETCODE dbcursorfetch(DBCURSOR * hc, DBINT fetchtype, DBINT rownum);
611 RETCODE dbcursorinfo(DBCURSOR * hc, DBINT * ncols, DBINT * nrows);
612 DBCURSOR *dbcursoropen(DBPROCESS * dbprocess, BYTE * stmt, SHORT scollopt, SHORT concuropt, USHORT nrows, DBINT * pstatus);
615 RETCODE dbdate4zero(DBPROCESS * dbprocess,
DBDATETIME4 * d1);
616 RETCODE dbdatechar(DBPROCESS * dbprocess,
char *buf,
int datepart,
int value);
617 int dbdatename(DBPROCESS * dbprocess,
char *buf,
int date,
DBDATETIME * datetime);
618 char *dateorder(DBPROCESS * dbprocess,
char *language);
619 DBINT dbdatepart(DBPROCESS * dbprocess,
int datepart,
DBDATETIME * datetime);
620 RETCODE dbdatezero(DBPROCESS * dbprocess,
DBDATETIME * d1);
621 char *dbdayname(DBPROCESS * dbprocess,
char *language,
int daynum);
623 int dbgetoff(DBPROCESS * dbprocess, DBUSMALLINT offtype,
int startfrom);
625 char *dbqual(DBPROCESS * dbprocess,
int tabnum,
char *tabname);
626 void dbfreequal(
char *qualptr);
628 DBSORTORDER *dbloadsort(DBPROCESS * dbprocess);
629 RETCODE dbfreesort(DBPROCESS * dbprocess, DBSORTORDER * sortorder);
631 RETCODE dbload_xlate(DBPROCESS * dbprocess,
char *srv_charset,
char *clt_name, DBXLATE ** xlt_tosrv, DBXLATE ** xlt_todisp);
637 RETCODE dbmnydown(DBPROCESS * dbproc,
DBMONEY * mnyptr,
int divisor,
int *remainder);
638 RETCODE dbmnyinit(DBPROCESS * dbproc,
DBMONEY * mnyptr,
int trim, DBBOOL * negative);
639 RETCODE dbmnyndigit(DBPROCESS * dbproc,
DBMONEY * mnyptr, DBCHAR * value, DBBOOL * zero);
641 RETCODE dbmnydigit(DBPROCESS * dbprocess,
DBMONEY * m1, DBCHAR * value, DBBOOL * zero);
642 RETCODE dbmnyscale(DBPROCESS * dbproc,
DBMONEY * dest,
int multiplier,
int addend);
645 RETCODE dbnpcreate(DBPROCESS * dbprocess);
646 RETCODE dbnpdefine(DBPROCESS * dbprocess, DBCHAR * procedure_name, DBSMALLINT namelen);
648 int DBNUMORDERS(DBPROCESS * dbprocess);
650 RETCODE dbpoll(DBPROCESS * dbproc,
long milliseconds, DBPROCESS ** ready_dbproc,
int *return_reason);
651 int dbordercol(DBPROCESS * dbprocess,
int order);
653 RETCODE dbregdrop(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
654 RETCODE dbregexec(DBPROCESS * dbproc, DBUSMALLINT options);
655 RETCODE dbreghandle(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, INTFUNCPTR handler);
656 RETCODE dbreginit(DBPROCESS * dbproc, DBCHAR * procedure_name, DBSMALLINT namelen);
657 RETCODE dbreglist(DBPROCESS * dbproc);
658 RETCODE dbregnowatch(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
659 RETCODE dbregparam(DBPROCESS * dbproc,
char *param_name,
int type, DBINT datalen, BYTE * data);
660 RETCODE dbregwatch(DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, DBUSMALLINT options);
661 RETCODE dbregwatchlist(DBPROCESS * dbprocess);
663 void dbrpwclr(LOGINREC * login);
664 RETCODE dbrpwset(LOGINREC * login,
char *srvname,
char *password,
int pwlen);
666 DBINT dbreadpage(DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, BYTE * buf);
667 RETCODE dbwritepage(DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, DBINT size, BYTE * buf);
669 RETCODE dbsetdeflang(
char *language);
671 int dbstrcmp(DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
672 int dbstrsort(DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
674 DBBOOL dbtabbrowse(DBPROCESS * dbprocess,
int tabnum);
675 int dbtabcount(DBPROCESS * dbprocess);
676 char *dbtabname(DBPROCESS * dbprocess,
int tabnum);
677 char *dbtabsource(DBPROCESS * dbprocess,
int colnum,
int *tabnum);
679 RETCODE dbsendpassthru(DBPROCESS * dbprocess, DBVOIDPTR bufp);
680 RETCODE dbrecvpassthru(DBPROCESS * dbprocess, DBVOIDPTR * bufp);
682 RETCODE dbgetloginfo(DBPROCESS * dbprocess, DBLOGINFO ** loginfo);
683 RETCODE dbsetloginfo(LOGINREC * loginrec, DBLOGINFO * loginfo);
685 int dbtsnewlen(DBPROCESS * dbprocess);
686 DBBINARY *dbtsnewval(DBPROCESS * dbprocess);
687 RETCODE dbtsput(DBPROCESS * dbprocess, DBBINARY * newts,
int newtslen,
int tabnum,
char *tabname);
689 RETCODE dbfree_xlate(DBPROCESS * dbprocess, DBXLATE * xlt_tosrv, DBXLATE * clt_todisp);
690 int dbxlate(DBPROCESS * dbprocess,
char *src,
int srclen,
char *dest,
int destlen, DBXLATE * xlt,
int *srcbytes_used,
691 DBBOOL srcend,
int status);
693 RETCODE bcp_moretext(DBPROCESS * dbproc, DBINT size, BYTE * text);
694 RETCODE bcp_writefmt(DBPROCESS * dbproc,
const char filename[]);
696 void build_xact_string(
char *xact_name,
char *service_name, DBINT commid,
char *result);
697 RETCODE remove_xact(DBPROCESS * connect, DBINT commid,
int n);
698 RETCODE abort_xact(DBPROCESS * connect, DBINT commid);
699 void close_commit(DBPROCESS * connect);
700 RETCODE commit_xact(DBPROCESS * connect, DBINT commid);
701 DBPROCESS *open_commit(LOGINREC * login,
char *servername);
702 RETCODE scan_xact(DBPROCESS * connect, DBINT commid);
703 DBINT start_xact(DBPROCESS * connect,
char *application_name,
char *xact_name,
int site_count);
704 DBINT stat_xact(DBPROCESS * connect, DBINT commid);
708 BYTE *
dbadata(DBPROCESS * dbproc,
int computeid,
int column);
709 DBINT
dbadlen(DBPROCESS * dbproc,
int computeid,
int column);
710 RETCODE
dbaltbind(DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
711 RETCODE dbaltbind_ps(DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
713 int dbaltcolid(DBPROCESS * dbproc,
int computeid,
int column);
714 DBINT
dbaltlen(DBPROCESS * dbproc,
int computeid,
int column);
715 int dbaltop(DBPROCESS * dbproc,
int computeid,
int column);
716 int dbalttype(DBPROCESS * dbproc,
int computeid,
int column);
717 DBINT
dbaltutype(DBPROCESS * dbproc,
int computeid,
int column);
718 RETCODE
dbanullbind(DBPROCESS * dbprocess,
int computeid,
int column, DBINT * indicator);
719 RETCODE
dbbind(DBPROCESS * dbproc,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
720 RETCODE dbbind_ps(DBPROCESS * dbprocess,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
DBTYPEINFO * typeinfo);
721 int dbbufsize(DBPROCESS * dbprocess);
722 BYTE *
dbbylist(DBPROCESS * dbproc,
int computeid,
int *size);
723 RETCODE
dbcancel(DBPROCESS * dbproc);
725 char *
dbchange(DBPROCESS * dbprocess);
726 DBBOOL dbcharsetconv(DBPROCESS * dbprocess);
727 void dbclose(DBPROCESS * dbproc);
728 void dbclrbuf(DBPROCESS * dbproc, DBINT n);
729 RETCODE
dbclropt(DBPROCESS * dbproc,
int option,
const char param[]);
730 RETCODE
dbcmd(DBPROCESS * dbproc,
const char cmdstring[]);
731 RETCODE
dbcmdrow(DBPROCESS * dbproc);
733 #define DBCMDROW(x) dbcmdrow((x)) 735 RETCODE
dbcolinfo (DBPROCESS *dbproc, CI_TYPE type, DBINT column, DBINT computeid,
DBCOL *pdbcol);
736 DBINT
dbcollen(DBPROCESS * dbproc,
int column);
737 char *
dbcolname(DBPROCESS * dbproc,
int column);
738 const char *
dbacolname(DBPROCESS * dbproc,
int computeid,
int column);
740 int dbcoltype(DBPROCESS * dbproc,
int column);
742 DBINT
dbcolutype(DBPROCESS * dbprocess,
int column);
743 DBINT
dbconvert(DBPROCESS * dbproc,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen);
744 DBINT
dbconvert_ps(DBPROCESS * dbprocess,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen,
747 DBINT
dbcount(DBPROCESS * dbproc);
749 #define DBCOUNT(x) dbcount((x)) 752 #define DBCURCMD(x) dbcurcmd((x)) 755 #define DBCURROW(x) dbcurrow((x)) 756 BYTE *
dbdata(DBPROCESS * dbproc,
int column);
759 RETCODE
dbanydatecrack(DBPROCESS * dbproc, DBDATEREC2 * di,
int type,
const void *data);
760 DBINT
dbdatlen(DBPROCESS * dbproc,
int column);
761 DBBOOL
dbdead(DBPROCESS * dbproc);
763 #define DBDEAD(x) dbdead((x)) 766 RETCODE
dbfcmd(DBPROCESS * dbproc,
const char *fmt, ...);
769 #define DBFIRSTROW(x) dbfirstrow((x)) 771 char *
dbgetchar(DBPROCESS * dbprocess,
int n);
772 char *dbgetcharset(DBPROCESS * dbprocess);
773 int dbgetlusername(LOGINREC * login, BYTE * name_buffer,
int buffer_len);
775 char *dbgetnatlanf(DBPROCESS * dbprocess);
777 RETCODE
dbgetrow(DBPROCESS * dbproc, DBINT row);
779 #define DBGETTIME dbgettime 785 #define DBIORDESC(x) dbiordesc((x)) 788 #define DBIOWDESC(x) dbiowdesc((x)) 789 DBBOOL dbisavail(DBPROCESS * dbprocess);
791 #define DBISAVAIL(x) dbisavail((x)) 792 DBBOOL
dbisopt(DBPROCESS * dbproc,
int option,
const char param[]);
795 #define DBLASTROW(x) dblastrow((x)) 818 const char *
dbmonthname(DBPROCESS * dbproc,
char *language,
int monthnum, DBBOOL shortform);
821 #define DBMORECMDS(x) dbmorecmds((x)) 822 RETCODE
dbmoretext(DBPROCESS * dbproc, DBINT size,
const BYTE text[]);
824 char *
dbname(DBPROCESS * dbproc);
825 STATUS dbnextrow(DBPROCESS * dbproc);
826 RETCODE
dbnullbind(DBPROCESS * dbproc,
int column, DBINT * indicator);
827 int dbnumalts(DBPROCESS * dbproc,
int computeid);
831 DBPROCESS *
tdsdbopen(LOGINREC * login,
const char *server,
int msdblib);
832 DBPROCESS *
dbopen(LOGINREC * login,
const char *server);
836 void dbpivot_count (
struct col_t *output,
const struct col_t *input);
837 void dbpivot_sum (
struct col_t *output,
const struct col_t *input);
838 void dbpivot_min (
struct col_t *output,
const struct col_t *input);
839 void dbpivot_max (
struct col_t *output,
const struct col_t *input);
842 typedef void (*DBPIVOT_FUNC)(
struct col_t *output,
const struct col_t *input);
843 struct pivot_t * dbrows_pivoted(DBPROCESS *dbproc);
844 STATUS dbnextrow_pivoted(DBPROCESS *dbproc,
struct pivot_t *pp);
845 RETCODE
dbpivot(DBPROCESS *dbproc,
int nkeys,
int *keys,
int ncols,
int *cols, DBPIVOT_FUNC func,
int val);
847 DBPIVOT_FUNC dbpivot_lookup_name(
const char name[] );
850 #define dbopen(x,y) tdsdbopen((x),(y), 1) 852 #define dbopen(x,y) tdsdbopen((x),(y), 0) 856 #ifdef PHP_SYBASE_DBOPEN 857 #undef PHP_SYBASE_DBOPEN 858 #define PHP_SYBASE_DBOPEN dbopen 862 DBINT
dbprcollen(DBPROCESS * dbproc,
int column);
863 RETCODE
dbprrow(DBPROCESS * dbproc);
865 DBBOOL DRBUF(DBPROCESS * dbprocess);
866 STATUS
dbreadtext(DBPROCESS * dbproc,
void *buf, DBINT bufsize);
869 RETCODE dbresults_r(DBPROCESS * dbproc,
int recursive);
870 BYTE *
dbretdata(DBPROCESS * dbproc,
int retnum);
871 int dbretlen(DBPROCESS * dbproc,
int retnum);
872 char *
dbretname(DBPROCESS * dbproc,
int retnum);
874 int dbrettype(DBPROCESS * dbproc,
int retnum);
875 RETCODE
dbrows(DBPROCESS * dbproc);
877 #define DBROWS(x) dbrows((x)) 880 #define DBROWTYPE(x) dbrowtype((x)) 881 RETCODE
dbrpcinit(DBPROCESS * dbproc,
const char rpcname[], DBSMALLINT options);
882 RETCODE
dbrpcparam(DBPROCESS * dbproc,
const char paramname[], BYTE status,
int type, DBINT maxlen, DBINT datalen, BYTE * value);
884 RETCODE
dbsafestr(DBPROCESS * dbproc,
const char *src, DBINT srclen,
char *dest, DBINT destlen,
int quotetype);
885 RETCODE *dbsechandle(DBINT type, INTFUNCPTR handler);
888 void dbsetbusy(DBPROCESS * dbprocess, DB_DBBUSY_FUNC busyfunc);
889 RETCODE dbsetdefcharset(
char *charset);
890 void dbsetidle(DBPROCESS * dbprocess, DB_DBIDLE_FUNC idlefunc);
892 void dbsetinterrupt(DBPROCESS * dbproc, DB_DBCHKINTR_FUNC chkintr, DB_DBHNDLINTR_FUNC hndlintr);
895 RETCODE
dbsetnull(DBPROCESS * dbprocess,
int bindtype,
int bindlen, BYTE * bindval);
896 RETCODE
dbsetopt(DBPROCESS * dbproc,
int option,
const char *char_param,
int int_param);
897 STATUS
dbsetrow(DBPROCESS * dbprocess, DBINT row);
902 int dbspid(DBPROCESS * dbproc);
903 RETCODE
dbspr1row(DBPROCESS * dbproc,
char *buffer, DBINT buf_len);
905 RETCODE
dbsprhead(DBPROCESS * dbproc,
char *buffer, DBINT buf_len);
906 RETCODE
dbsprline(DBPROCESS * dbproc,
char *buffer, DBINT buf_len, DBCHAR line_char);
908 RETCODE
dbsqlok(DBPROCESS * dbproc);
910 int dbstrbuild(DBPROCESS * dbproc,
char *charbuf,
int bufsize,
char *text,
char *formats, ...);
911 RETCODE
dbstrcpy(DBPROCESS * dbproc,
int start,
int numbytes,
char *dest);
913 DBINT
dbvarylen(DBPROCESS * dbproc,
int column);
915 #define SYBEVERDOWN 100 916 #define SYBEICONVIU 2400 917 #define SYBEICONVAVAIL 2401 918 #define SYBEICONVO 2402 919 #define SYBEICONVI 2403 920 #define SYBEICONV2BIG 2404 923 #define SYBETDSVER 2410 924 #define SYBEPORT 2500 925 #define SYBESYNC 20001 926 #define SYBEFCON 20002 927 #define SYBETIME 20003 928 #define SYBEREAD 20004 929 #define SYBEBUFL 20005 930 #define SYBEWRIT 20006 931 #define SYBEVMS 20007 932 #define SYBESOCK 20008 933 #define SYBECONN 20009 934 #define SYBEMEM 20010 935 #define SYBEDBPS 20011 936 #define SYBEINTF 20012 937 #define SYBEUHST 20013 938 #define SYBEPWD 20014 939 #define SYBEOPIN 20015 940 #define SYBEINLN 20016 941 #define SYBESEOF 20017 942 #define SYBESMSG 20018 943 #define SYBERPND 20019 944 #define SYBEBTOK 20020 945 #define SYBEITIM 20021 946 #define SYBEOOB 20022 947 #define SYBEBTYP 20023 948 #define SYBEBNCR 20024 949 #define SYBEIICL 20025 950 #define SYBECNOR 20026 951 #define SYBENPRM 20027 952 #define SYBEUVDT 20028 953 #define SYBEUFDT 20029 954 #define SYBEWAID 20030 955 #define SYBECDNS 20031 956 #define SYBEABNC 20032 957 #define SYBEABMT 20033 958 #define SYBEABNP 20034 959 #define SYBEAAMT 20035 960 #define SYBENXID 20036 961 #define SYBERXID 20037 962 #define SYBEICN 20038 963 #define SYBENMOB 20039 964 #define SYBEAPUT 20040 965 #define SYBEASNL 20041 966 #define SYBENTLL 20042 967 #define SYBEASUL 20043 968 #define SYBERDNR 20044 969 #define SYBENSIP 20045 970 #define SYBEABNV 20046 971 #define SYBEDDNE 20047 972 #define SYBECUFL 20048 973 #define SYBECOFL 20049 974 #define SYBECSYN 20050 975 #define SYBECLPR 20051 976 #define SYBECNOV 20052 977 #define SYBERDCN 20053 978 #define SYBESFOV 20054 979 #define SYBEUNT 20055 980 #define SYBECLOS 20056 981 #define SYBEUAVE 20057 982 #define SYBEUSCT 20058 983 #define SYBEEQVA 20059 984 #define SYBEUDTY 20060 985 #define SYBETSIT 20061 986 #define SYBEAUTN 20062 987 #define SYBEBDIO 20063 988 #define SYBEBCNT 20064 989 #define SYBEIFNB 20065 990 #define SYBETTS 20066 991 #define SYBEKBCO 20067 992 #define SYBEBBCI 20068 993 #define SYBEKBCI 20069 994 #define SYBEBCRE 20070 995 #define SYBETPTN 20071 996 #define SYBEBCWE 20072 997 #define SYBEBCNN 20073 998 #define SYBEBCOR 20074 999 #define SYBEBCIS 20075 1000 #define SYBEBCPI 20076 1001 #define SYBEBCPN 20077 1002 #define SYBEBCPB 20078 1003 #define SYBEVDPT 20079 1004 #define SYBEBIVI 20080 1005 #define SYBEBCBC 20081 1006 #define SYBEBCFO 20082 1007 #define SYBEBCVH 20083 1008 #define SYBEBCUO 20084 1009 #define SYBEBCUC 20085 1010 #define SYBEBUOE 20086 1011 #define SYBEBUCE 20087 1012 #define SYBEBWEF 20088 1013 #define SYBEASTF 20089 1014 #define SYBEUACS 20090 1015 #define SYBEASEC 20091 1016 #define SYBETMTD 20092 1017 #define SYBENTTN 20093 1018 #define SYBEDNTI 20094 1019 #define SYBEBTMT 20095 1020 #define SYBEORPF 20096 1021 #define SYBEUVBF 20097 1022 #define SYBEBUOF 20098 1023 #define SYBEBUCF 20099 1024 #define SYBEBRFF 20100 1025 #define SYBEBWFF 20101 1026 #define SYBEBUDF 20102 1027 #define SYBEBIHC 20103 1028 #define SYBEBEOF 20104 1029 #define SYBEBCNL 20105 1030 #define SYBEBCSI 20106 1031 #define SYBEBCIT 20107 1032 #define SYBEBCSA 20108 1033 #define SYBENULL 20109 1034 #define SYBEUNAM 20110 1035 #define SYBEBCRO 20111 1036 #define SYBEMPLL 20112 1037 #define SYBERPIL 20113 1038 #define SYBERPUL 20114 1039 #define SYBEUNOP 20115 1040 #define SYBECRNC 20116 1041 #define SYBERTCC 20117 1042 #define SYBERTSC 20118 1043 #define SYBEUCRR 20119 1044 #define SYBERPNA 20120 1045 #define SYBEOPNA 20121 1046 #define SYBEFGTL 20122 1047 #define SYBECWLL 20123 1048 #define SYBEUFDS 20124 1049 #define SYBEUCPT 20125 1050 #define SYBETMCF 20126 1051 #define SYBEAICF 20127 1052 #define SYBEADST 20128 1053 #define SYBEALTT 20129 1054 #define SYBEAPCT 20130 1055 #define SYBEXOCI 20131 1056 #define SYBEFSHD 20132 1057 #define SYBEAOLF 20133 1058 #define SYBEARDI 20134 1059 #define SYBEURCI 20135 1060 #define SYBEARDL 20136 1061 #define SYBEURMI 20137 1062 #define SYBEUREM 20138 1063 #define SYBEURES 20139 1064 #define SYBEUREI 20140 1065 #define SYBEOREN 20141 1066 #define SYBEISOI 20142 1067 #define SYBEIDCL 20143 1068 #define SYBEIMCL 20144 1069 #define SYBEIFCL 20145 1070 #define SYBEUTDS 20146 1071 #define SYBEBUFF 20147 1072 #define SYBEACNV 20148 1073 #define SYBEDPOR 20149 1074 #define SYBENDC 20150 1075 #define SYBEMVOR 20151 1076 #define SYBEDVOR 20152 1077 #define SYBENBVP 20153 1078 #define SYBESPID 20154 1079 #define SYBENDTP 20155 1080 #define SYBEXTN 20156 1081 #define SYBEXTDN 20157 1082 #define SYBEXTSN 20158 1083 #define SYBENUM 20159 1084 #define SYBETYPE 20160 1085 #define SYBEGENOS 20161 1086 #define SYBEPAGE 20162 1087 #define SYBEOPTNO 20163 1088 #define SYBEETD 20164 1089 #define SYBERTYPE 20165 1090 #define SYBERFILE 20166 1091 #define SYBEFMODE 20167 1092 #define SYBESLCT 20168 1093 #define SYBEZTXT 20169 1094 #define SYBENTST 20170 1095 #define SYBEOSSL 20171 1096 #define SYBEESSL 20172 1097 #define SYBENLNL 20173 1098 #define SYBENHAN 20174 1099 #define SYBENBUF 20175 1100 #define SYBENULP 20176 1101 #define SYBENOTI 20177 1102 #define SYBEEVOP 20178 1103 #define SYBENEHA 20179 1104 #define SYBETRAN 20180 1105 #define SYBEEVST 20181 1106 #define SYBEEINI 20182 1107 #define SYBEECRT 20183 1108 #define SYBEECAN 20184 1109 #define SYBEEUNR 20185 1110 #define SYBERPCS 20186 1111 #define SYBETPAR 20187 1112 #define SYBETEXS 20188 1113 #define SYBETRAC 20189 1114 #define SYBETRAS 20190 1115 #define SYBEPRTF 20191 1116 #define SYBETRSN 20192 1117 #define SYBEBPKS 20193 1118 #define SYBEIPV 20194 1119 #define SYBEMOV 20195 1120 #define SYBEDIVZ 20196 1121 #define SYBEASTL 20197 1122 #define SYBESEFA 20198 1123 #define SYBEPOLL 20199 1124 #define SYBENOEV 20200 1125 #define SYBEBADPK 20201 1126 #define SYBESECURE 20202 1127 #define SYBECAP 20203 1128 #define SYBEFUNC 20204 1129 #define SYBERESP 20205 1130 #define SYBEIVERS 20206 1131 #define SYBEONCE 20207 1132 #define SYBERPNULL 20208 1133 #define SYBERPTXTIM 20209 1134 #define SYBENEG 20210 1135 #define SYBELBLEN 20211 1136 #define SYBEUMSG 20212 1137 #define SYBECAPTYP 20213 1138 #define SYBEBNUM 20214 1139 #define SYBEBBL 20215 1140 #define SYBEBPREC 20216 1141 #define SYBEBSCALE 20217 1142 #define SYBECDOMAIN 20218 1143 #define SYBECINTERNAL 20219 1144 #define SYBEBTYPSRV 20220 1145 #define SYBEBCSET 20221 1146 #define SYBEFENC 20222 1147 #define SYBEFRES 20223 1148 #define SYBEISRVPREC 20224 1149 #define SYBEISRVSCL 20225 1150 #define SYBEINUMCL 20226 1151 #define SYBEIDECCL 20227 1152 #define SYBEBCMTXT 20228 1153 #define SYBEBCPREC 20229 1154 #define SYBEBCBNPR 20230 1155 #define SYBEBCBNTYP 20231 1156 #define SYBEBCSNTYP 20232 1157 #define SYBEBCPCTYP 20233 1158 #define SYBEBCVLEN 20234 1159 #define SYBEBCHLEN 20235 1160 #define SYBEBCBPREF 20236 1161 #define SYBEBCPREF 20237 1162 #define SYBEBCITBNM 20238 1163 #define SYBEBCITBLEN 20239 1164 #define SYBEBCSNDROW 20240 1165 #define SYBEBPROCOL 20241 1166 #define SYBEBPRODEF 20242 1167 #define SYBEBPRONUMDEF 20243 1168 #define SYBEBPRODEFID 20244 1169 #define SYBEBPRONODEF 20245 1170 #define SYBEBPRODEFTYP 20246 1171 #define SYBEBPROEXTDEF 20247 1172 #define SYBEBPROEXTRES 20248 1173 #define SYBEBPROBADDEF 20249 1174 #define SYBEBPROBADTYP 20250 1175 #define SYBEBPROBADLEN 20251 1176 #define SYBEBPROBADPREC 20252 1177 #define SYBEBPROBADSCL 20253 1178 #define SYBEBADTYPE 20254 1179 #define SYBECRSNORES 20255 1180 #define SYBECRSNOIND 20256 1181 #define SYBECRSVIEW 20257 1182 #define SYBECRSVIIND 20258 1183 #define SYBECRSORD 20259 1184 #define SYBECRSBUFR 20260 1185 #define SYBECRSNOFREE 20261 1186 #define SYBECRSDIS 20262 1187 #define SYBECRSAGR 20263 1188 #define SYBECRSFRAND 20264 1189 #define SYBECRSFLAST 20265 1190 #define SYBECRSBROL 20266 1191 #define SYBECRSFROWN 20267 1192 #define SYBECRSBSKEY 20268 1193 #define SYBECRSRO 20269 1194 #define SYBECRSNOCOUNT 20270 1195 #define SYBECRSTAB 20271 1196 #define SYBECRSUPDNB 20272 1197 #define SYBECRSNOWHERE 20273 1198 #define SYBECRSSET 20274 1199 #define SYBECRSUPDTAB 20275 1200 #define SYBECRSNOUPD 20276 1201 #define SYBECRSINV 20277 1202 #define SYBECRSNOKEYS 20278 1203 #define SYBECRSNOBIND 20279 1204 #define SYBECRSFTYPE 20280 1205 #define SYBECRSINVALID 20281 1206 #define SYBECRSMROWS 20282 1207 #define SYBECRSNROWS 20283 1208 #define SYBECRSNOLEN 20284 1209 #define SYBECRSNOPTCC 20285 1210 #define SYBECRSNORDER 20286 1211 #define SYBECRSNOTABLE 20287 1212 #define SYBECRSNUNIQUE 20288 1213 #define SYBECRSVAR 20289 1214 #define SYBENOVALUE 20290 1215 #define SYBEVOIDRET 20291 1216 #define SYBECLOSEIN 20292 1217 #define SYBEBOOL 20293 1218 #define SYBEBCPOPT 20294 1219 #define SYBEERRLABEL 20295 1220 #define SYBEATTNACK 20296 1221 #define SYBEBBFL 20297 1222 #define SYBEDCL 20298 1223 #define SYBECS 20299 1224 #define SYBEBULKINSERT 20599 1225 #define SYBECOLSIZE 22000 1227 int dbtds(DBPROCESS * dbprocess);
1229 #define DBTDS(a) dbtds(a) 1230 DBINT dbtextsize(DBPROCESS * dbprocess);
1231 DBBINARY *
dbtxptr(DBPROCESS * dbproc,
int column);
1233 DBBINARY *dbtxtsnewval(DBPROCESS * dbprocess);
1234 RETCODE dbtxtsput(DBPROCESS * dbprocess, DBBINARY newtxts,
int colnum);
1235 RETCODE
dbuse(DBPROCESS * dbproc,
const char *name);
1238 RETCODE
dbwritetext(DBPROCESS * dbproc,
char *objname, DBBINARY * textptr, DBTINYINT textptrlen, DBBINARY * timestamp,
1239 DBBOOL log, DBINT size, BYTE * text);
1242 RETCODE
dbsetlname(LOGINREC * login,
const char *value,
int which);
1243 RETCODE
dbsetlbool(LOGINREC * login,
int value,
int which);
1244 RETCODE
dbsetlshort(LOGINREC * login,
int value,
int which);
1245 RETCODE
dbsetllong(LOGINREC * login,
long value,
int which);
1249 #define DBSETLHOST(x,y) dbsetlname((x), (y), DBSETHOST) 1250 #define dbsetlhost(x,y) dbsetlname((x), (y), DBSETHOST) 1252 #define DBSETLUSER(x,y) dbsetlname((x), (y), DBSETUSER) 1253 #define dbsetluser(x,y) dbsetlname((x), (y), DBSETUSER) 1255 #define DBSETLPWD(x,y) dbsetlname((x), (y), DBSETPWD) 1256 #define dbsetlpwd(x,y) dbsetlname((x), (y), DBSETPWD) 1257 #if defined(DBLIB_UNIMPLEMENTED) 1259 # define DBSETLHID(x,y) dbsetlname((x), (y), DBSETHID) 1262 #define DBSETLAPP(x,y) dbsetlname((x), (y), DBSETAPP) 1263 #define dbsetlapp(x,y) dbsetlname((x), (y), DBSETAPP) 1265 #define BCP_SETL(x,y) dbsetlbool((x), (y), DBSETBCP) 1266 #define DBSETLSECURE(x) dbsetlbool((x), (1), DBSETBCP) 1267 #define DBSETNATLANG 7 1268 #define DBSETLNATLANG(x,y) dbsetlname((x), (y), DBSETNATLANG) 1269 #define dbsetlnatlang(x,y) dbsetlname((x), (y), DBSETNATLANG) 1270 #if defined(DBLIB_UNIMPLEMENTED) 1271 # define DBSETNOSHORT 8 1272 # define DBSETLNOSHORT(x,y) dbsetlbool((x), (y), DBSETNOSHORT) 1273 # define DBSETHIER 9 1274 # define DBSETLHIER(x,y) dbsetlshort((x), (y), DBSETHIER) 1276 #define DBSETCHARSET 10 1277 #define DBSETLCHARSET(x,y) dbsetlname((x), (y), DBSETCHARSET) 1278 #define DBSETPACKET 11 1279 #define DBSETLPACKET(x,y) dbsetllong((x), (y), DBSETPACKET) 1280 #define dbsetlpacket(x,y) dbsetllong((x), (y), DBSETPACKET) 1281 #define DBSETENCRYPT 12 1282 #define DBSETLENCRYPT(x,y) dbsetlbool((x), (y), DBSETENCRYPT) 1283 #define DBSETLABELED 13 1284 #define DBSETLLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED) 1285 #define BCP_SETLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED) 1286 #define DBSETDBNAME 14 1287 #define DBSETLDBNAME(x,y) dbsetlname((x), (y), DBSETDBNAME) 1288 #define DBSETLVERSION(login, version) dbsetlversion((login), (version)) 1289 #define DBSETNETWORKAUTH 101 1290 #define DBSETLNETWORKAUTH(x, y) dbsetlbool((x), (y), DBSETNETWORKAUTH) 1291 #define DBSETMUTUALAUTH 102 1292 #define DBSETLMUTUALAUTH(x, y) dbsetlbool((x), (y), DBSETMUTUALAUTH) 1293 #define DBSETSERVERPRINCIPAL 103 1294 #define DBSETLSERVERPRINCIPAL(x,y) dbsetlname((x), (y), DBSETSERVERPRINCIPAL) 1296 #define DBSETUTF16 1001 1297 #define DBSETLUTF16(x,y) dbsetlbool((x), (y), DBSETUTF16) 1298 #define DBSETNTLMV2 1002 1299 #define DBSETLNTLMV2(x,y) dbsetlbool((x), (y), DBSETNTLMV2) 1300 #define DBSETREADONLY 1003 1301 #define DBSETLREADONLY(x,y) dbsetlbool((x), (y), DBSETREADONLY) 1302 #define DBSETDELEGATION 1004 1303 #define DBSETLDELEGATION(x, y) dbsetlbool((x), (y), DBSETDELEGATION) 1304 #define DBSETENCRYPTION 1005 1305 #define DBSETLENCRYPTION(x, y) dbsetlname((x), (y), DBSETENCRYPTION) 1306 #define DBSETPORT 1006 1307 #define DBSETLPORT(x,y) dbsetlshort((x), (y), DBSETPORT) 1309 RETCODE
bcp_init(DBPROCESS * dbproc,
const char *tblname,
const char *hfile,
const char *errfile,
int direction);
1310 DBINT
bcp_done(DBPROCESS * dbproc);
1313 RETCODE
bcp_bind(DBPROCESS * dbproc, BYTE * varaddr,
int prefixlen, DBINT varlen, BYTE * terminator,
int termlen,
int type,
1315 RETCODE
bcp_collen(DBPROCESS * dbproc, DBINT varlen,
int table_column);
1316 RETCODE
bcp_columns(DBPROCESS * dbproc,
int host_colcount);
1317 RETCODE
bcp_colfmt(DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1318 const BYTE * host_term,
int host_termlen,
int colnum);
1319 RETCODE
bcp_colfmt_ps(DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1320 BYTE * host_term,
int host_termlen,
int colnum,
DBTYPEINFO * typeinfo);
1321 RETCODE
bcp_colptr(DBPROCESS * dbproc, BYTE * colptr,
int table_column);
1322 RETCODE
bcp_control(DBPROCESS * dbproc,
int field, DBINT value);
1323 int bcp_getbatchsize(DBPROCESS * dbproc);
1324 RETCODE
bcp_exec(DBPROCESS * dbproc, DBINT * rows_copied);
1326 RETCODE
bcp_options(DBPROCESS * dbproc,
int option, BYTE * value,
int valuelen);
1327 RETCODE
bcp_readfmt(DBPROCESS * dbproc,
const char filename[]);
DBINT dbcollen(DBPROCESS *dbproc, int column)
Get size of a regular result column.
Definition: dblib.c:3182
DBBOOL bcp_getl(LOGINREC *login)
See if BCP_SETL() was used to set the LOGINREC for BCP work.
Definition: bcp.c:706
DBINT dbprcollen(DBPROCESS *dbproc, int column)
Get size of a result column needed to print column.
Definition: dblib.c:3205
RETCODE dbmnycopy(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Copy a DBMONEY value.
Definition: dblib.c:6052
DBBINARY * dbtxptr(DBPROCESS *dbproc, int column)
Get text pointer for a column in the current row.
Definition: dblib.c:6603
BYTE * dbadata(DBPROCESS *dbproc, int computeid, int column)
Get address of compute column data.
Definition: dblib.c:4457
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Definition: dblib.c:7055
BYTE * dbdata(DBPROCESS *dbproc, int column)
Get address of data in a regular result column.
Definition: dblib.c:3367
int dbtds(DBPROCESS *dbprocess)
Get the TDS version in use for dbproc.
Definition: dblib.c:6847
RETCODE dbsprline(DBPROCESS *dbproc, char *buffer, DBINT buf_len, DBCHAR line_char)
Get formatted string for underlining dbsprhead() column names.
Definition: dblib.c:3878
void dbprhead(DBPROCESS *dbproc)
Print result set headings to stdout.
Definition: dblib.c:4001
RETCODE dbmnymaxpos(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum positive DBMONEY value supported.
Definition: dblib.c:5387
RETCODE dbrows(DBPROCESS *dbproc)
Indicate whether a query returned rows.
Definition: dblib.c:4076
RETCODE dbsetlbool(LOGINREC *login, int value, int which)
Set a boolean value in a LOGINREC structure.
Definition: dblib.c:905
void dbclose(DBPROCESS *dbproc)
Close a connection to the server and free associated resources.
Definition: dblib.c:1500
RETCODE bcp_collen(DBPROCESS *dbproc, DBINT varlen, int table_column)
Set the length of a host variable to be written to a table.
Definition: bcp.c:263
RETCODE dbinit(void)
Initialize db-lib.
Definition: dblib.c:664
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition: dblib.c:1434
int dbnumcols(DBPROCESS *dbproc)
Return number of regular columns in a result set.
Definition: dblib.c:1863
RETCODE dbanullbind(DBPROCESS *dbprocess, int computeid, int column, DBINT *indicator)
Tie a null-indicator to a compute result column.
Definition: dblib.c:2788
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:6506
RETCODE dbsprhead(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print result set headings to a buffer.
Definition: dblib.c:3936
char * dbgetchar(DBPROCESS *dbprocess, int n)
Get address of a position in the command buffer.
Definition: dblib.c:6352
RETCODE dbmorecmds(DBPROCESS *dbproc)
See if more commands are to be processed.
Definition: dblib.c:6279
DBBOOL dbwillconvert(int srctype, int desttype)
Test whether or not a datatype can be converted to another datatype.
Definition: dblib.c:2886
RETCODE dbsqlsend(DBPROCESS *dbproc)
Transmit the command buffer to the server.
Definition: dblib.c:7091
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition: bcp.c:542
DBPROCESS * tdsdbopen(LOGINREC *login, const char *server, int msdblib)
Form a connection with the server.
Definition: dblib.c:1188
char * dbservcharset(DBPROCESS *dbprocess)
Get syscharset name of the server character set.
Definition: dblib.c:7071
DBBOOL dbisopt(DBPROCESS *dbproc, int option, const char param[])
Get value of an option.
Definition: dblib.c:6205
RETCODE dbbind(DBPROCESS *dbproc, int column, int vartype, DBINT varlen, BYTE *varaddr)
Tie a host variable to a resultset column.
Definition: dblib.c:2649
RETCODE bcp_sendrow(DBPROCESS *dbproc)
Write data in host variables to the table.
Definition: bcp.c:1380
char * dbchange(DBPROCESS *dbprocess)
See if a command caused the current database to change.
Definition: dblib.c:7035
DBINT dbconvert(DBPROCESS *dbproc, int srctype, const BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen)
cf.
Definition: dblib.c:2608
int dbspid(DBPROCESS *dbproc)
Get server process ID for a DBPROCESS.
Definition: dblib.c:5962
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:373
const char * dbversion(void)
See which version of db-lib is in use.
Definition: dblib.c:6888
void dbsetifile(char *filename)
set name and location of the interfaces file FreeTDS should use to look up a servername.
Definition: dblib.c:2726
int dbiordesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to read data coming from the server...
Definition: dblib.c:7279
RETCODE dbmoretext(DBPROCESS *dbproc, DBINT size, const BYTE text[])
Send chunk of a text/image value to the server.
Definition: dblib.c:6778
DBINT bcp_done(DBPROCESS *dbproc)
Conclude the transfer of data from program variables.
Definition: bcp.c:2037
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition: dblib.c:2983
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
DBINT dbaltutype(DBPROCESS *dbproc, int computeid, int column)
Get user-defined datatype of a compute column.
Definition: dblib.c:7162
RETCODE dbmny4minus(DBPROCESS *dbproc, DBMONEY4 *src, DBMONEY4 *dest)
Negate a DBMONEY4 value.
Definition: dblib.c:5588
int dbdatecmp(DBPROCESS *dbproc, DBDATETIME *d1, DBDATETIME *d2)
Compare DBDATETIME values, similar to strcmp(3).
Definition: dblib.c:5807
DBINT dbfirstrow(DBPROCESS *dbproc)
See if a server response has arrived.
Definition: dblib.c:7240
char * dbretname(DBPROCESS *dbproc, int retnum)
Get name of an output parameter filled by a stored procedure.
Definition: dblib.c:4766
int dbretlen(DBPROCESS *dbproc, int retnum)
Get size of an output parameter filled by a stored procedure.
Definition: dblib.c:4821
RETCODE dbsqlok(DBPROCESS *dbproc)
Wait for results of a query from the server.
Definition: dblib.c:4856
RETCODE dbnullbind(DBPROCESS *dbproc, int column, DBINT *indicator)
Tie a null-indicator to a regular result column.
Definition: dblib.c:2752
int dbgetpacket(DBPROCESS *dbproc)
Get TDS packet size for the connection.
Definition: dblib.c:4117
DBINT date
date, 0 = 1900-01-01
Definition: sybdb.h:310
RETCODE dbmny4add(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *sum)
Add two DBMONEY4 values.
Definition: dblib.c:5635
void dbfreebuf(DBPROCESS *dbproc)
Erase the command buffer, in case DBNOAUTOFREE was set with dbsetopt().
Definition: dblib.c:6102
RETCODE dbsettime(int seconds)
Set maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4234
DBTYPEINFO * dbcoltypeinfo(DBPROCESS *dbproc, int column)
Get precision and scale information for a regular result column.
Definition: dblib.c:3029
DBBOOL dbhasretstat(DBPROCESS *dbproc)
Determine if query generated a return status number.
Definition: dblib.c:4692
int dbaltcolid(DBPROCESS *dbproc, int computeid, int column)
Get column ID of a compute column.
Definition: dblib.c:4326
int dbnumrets(DBPROCESS *dbproc)
Get count of output parameters filled by a stored procedure.
Definition: dblib.c:4734
RETCODE dbclropt(DBPROCESS *dbproc, int option, const char param[])
Reset an option.
Definition: dblib.c:6137
RETCODE dbmnyzero(DBPROCESS *dbproc, DBMONEY *dest)
Set a DBMONEY value to zero.
Definition: dblib.c:5366
int dbrettype(DBPROCESS *dbproc, int retnum)
Get datatype of a stored procedure's return parameter.
Definition: dblib.c:6308
int dbnumcompute(DBPROCESS *dbprocess)
Get count of COMPUTE clauses for a result set.
Definition: dblib.c:5015
void dbrecftos(const char filename[])
Record to a file all SQL commands sent to the server.
Definition: dblib.c:6813
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:6640
RETCODE bcp_readfmt(DBPROCESS *dbproc, const char filename[])
Read a format definition file.
Definition: bcp.c:1678
void dbexit(void)
Close server connections and free all related structures.
Definition: dblib.c:1567
RETCODE bcp_exec(DBPROCESS *dbproc, DBINT *rows_copied)
Write a datafile to a table.
Definition: bcp.c:1617
RETCODE dbmnydec(DBPROCESS *dbproc, DBMONEY *mnyptr)
Subtract $0.0001 from a DBMONEY value.
Definition: dblib.c:5533
RETCODE dbdatecrack(DBPROCESS *dbproc, DBDATEREC *di, DBDATETIME *dt)
Break a DBDATETIME value into useful pieces.
Definition: dblib.c:5889
RETCODE dbgetrow(DBPROCESS *dbproc, DBINT row)
Read a row from the row buffer.
Definition: dblib.c:1945
RETCODE dbmny4zero(DBPROCESS *dbproc, DBMONEY4 *dest)
Zero a DBMONEY4 value.
Definition: dblib.c:5612
RETCODE dbfcmd(DBPROCESS *dbproc, const char *fmt,...)
printf-like way to form SQL to send to the server.
Definition: dblib.c:1349
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:3058
BOOL dbiscount(DBPROCESS *dbproc)
Indicates whether or not the count returned by dbcount is real (Microsoft-compatibility feature)...
Definition: dblib.c:2816
char * dbcolsource(DBPROCESS *dbproc, int colnum)
Get base database column name for a result set column.
Definition: dblib.c:3157
DBINT dbcolutype(DBPROCESS *dbprocess, int column)
Get user-defined datatype of a regular result column.
Definition: dblib.c:3006
int dbmny4cmp(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2)
Compare two DBMONEY4 values.
Definition: dblib.c:5754
RETCODE dbstrcpy(DBPROCESS *dbproc, int start, int numbytes, char *dest)
Get a copy of a chunk of the command buffer.
Definition: dblib.c:6384
DBPROCESS * dbopen(LOGINREC *login, const char *server)
Normally not used.
Definition: dbopen.c:36
const char * dbprtype(int token)
Print a token value's name to a buffer.
Definition: dblib.c:6489
RETCODE dbsetlname(LOGINREC *login, const char *value, int which)
Set the value of a string in a LOGINREC structure.
Definition: dblib.c:764
RETCODE dbmnyinc(DBPROCESS *dbproc, DBMONEY *mnyptr)
Add $0.0001 to a DBMONEY value.
Definition: dblib.c:5505
int dbcurcmd(DBPROCESS *dbproc)
Get number of the row just returned.
Definition: dblib.c:6262
RETCODE dbsetversion(DBINT version)
Specify a db-lib version level.
Definition: dblib.c:6018
RETCODE dbsetlversion(LOGINREC *login, BYTE version)
Set TDS version for future connections.
Definition: dblib.c:956
RETCODE dbmny4copy(DBPROCESS *dbprocess, DBMONEY4 *m1, DBMONEY4 *m2)
Copy a DBMONEY4 value.
Definition: dblib.c:5782
STATUS dbreadtext(DBPROCESS *dbproc, void *buf, DBINT bufsize)
Fetch part of a text or image value from the server.
Definition: dblib.c:6709
void dbsetavail(DBPROCESS *dbprocess)
Mark a DBPROCESS as "available".
Definition: dblib.c:7323
RETCODE dbcmdrow(DBPROCESS *dbproc)
See if the current command can return rows.
Definition: dblib.c:4302
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition: dblib.c:1709
int dbmnycmp(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2)
Compare two DBMONEY values.
Definition: dblib.c:5308
DBINT dbadlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in a compute column.
Definition: dblib.c:4352
DBINT bcp_batch(DBPROCESS *dbproc)
Commit a set of rows to the table.
Definition: bcp.c:2010
DBINT dbvarylen(DBPROCESS *dbproc, int column)
Determine whether a column can vary in size.
Definition: dblib.c:3231
DBINT dbdatlen(DBPROCESS *dbproc, int column)
Get size of current row's data in a regular result column.
Definition: dblib.c:3339
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:5910
int dbaltop(DBPROCESS *dbproc, int computeid, int column)
Get aggregation operator for a compute column.
Definition: dblib.c:4486
void dbloginfree(LOGINREC *login)
free the LOGINREC
Definition: dblib.c:742
RETCODE bcp_colptr(DBPROCESS *dbproc, BYTE *colptr, int table_column)
Override bcp_bind() by pointing to a different host variable.
Definition: bcp.c:670
RETCODE dbspr1row(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print a regular result row to a buffer.
Definition: dblib.c:3472
int dbiowdesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to write data coming to the server...
Definition: dblib.c:7295
char * dbcolname(DBPROCESS *dbproc, int column)
Return name of a regular result column.
Definition: dblib.c:1887
DBINT dbcount(DBPROCESS *dbproc)
Get count of rows processed.
Definition: dblib.c:2836
RETCODE dbsetopt(DBPROCESS *dbproc, int option, const char *char_param, int int_param)
Set db-lib or server option.
Definition: dblib.c:4513
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:2315
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:2079
RETCODE dbsetnull(DBPROCESS *dbprocess, int bindtype, int bindlen, BYTE *bindval)
Define substitution values to be used when binding null values.
Definition: dblib.c:1977
STATUS dbrowtype(DBPROCESS *dbprocess)
Get returned row's type.
Definition: dblib.c:6245
DBBINARY * dbtxtimestamp(DBPROCESS *dbproc, int column)
Get text timestamp for a column in the current row.
Definition: dblib.c:6573
RETCODE bcp_columns(DBPROCESS *dbproc, int host_colcount)
Indicate how many columns are to be found in the datafile.
Definition: bcp.c:297
RETCODE dbmnymaxneg(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum negative DBMONEY value supported.
Definition: dblib.c:5408
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:6428
int dbalttype(DBPROCESS *dbproc, int computeid, int column)
Get datatype for a compute column.
Definition: dblib.c:4382
RETCODE dbrpcsend(DBPROCESS *dbproc)
Execute the procedure and free associated memory.
Definition: rpc.c:279
STATUS dbsetrow(DBPROCESS *dbprocess, DBINT row)
Make a buffered row "current" without fetching it into bound variables.
Definition: dblib.c:2060
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition: dblib.c:5163
const char * dbacolname(DBPROCESS *dbproc, int computeid, int column)
Return name of a computed result column.
Definition: dblib.c:1913
int dbgettime(void)
Get maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4265
DBINT dblastrow(DBPROCESS *dbproc)
Get number of the last row in the row buffer.
Definition: dblib.c:7255
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition: dblib.c:709
DBUBIGINT time
time, 7 digit precision
Definition: sybdb.h:309
RETCODE dbmny4sub(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *diff)
Subtract two DBMONEY4 values.
Definition: dblib.c:5666
RETCODE dbprrow(DBPROCESS *dbproc)
Print a result set to stdout.
Definition: dblib.c:3555
DBINT dbcurrow(DBPROCESS *dbproc)
Get number of the row currently being read.
Definition: dblib.c:6228
BYTE * dbbylist(DBPROCESS *dbproc, int computeid, int *size)
Get bylist for a compute row.
Definition: dblib.c:5041
DBINT dbspr1rowlen(DBPROCESS *dbproc)
Determine size buffer required to hold the results returned by dbsprhead(), dbsprline(), and dbspr1row().
Definition: dblib.c:3434
RETCODE dbcanquery(DBPROCESS *dbproc)
Cancel the query currently being retrieved, discarding all pending rows.
Definition: dblib.c:6073
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:4673
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:4411
RETCODE dbsetllong(LOGINREC *login, long value, int which)
Set an integer value in a LOGINREC structure.
Definition: dblib.c:833
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
Definition: dblib.c:1388
RETCODE dbmnyminus(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Negate a DBMONEY value.
Definition: dblib.c:5561
RETCODE dbrpcinit(DBPROCESS *dbproc, const char rpcname[], DBSMALLINT options)
Initialize a remote procedure call.
Definition: rpc.c:70
int dbgetmaxprocs(void)
get maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:4213
RETCODE dbsetlshort(LOGINREC *login, int value, int which)
Set an integer value in a LOGINREC structure.
Definition: dblib.c:870
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition: dblib.c:5182
DBINT dbretstatus(DBPROCESS *dbproc)
Fetch status value returned by query or remote procedure call.
Definition: dblib.c:4716
void dbclrbuf(DBPROCESS *dbproc, DBINT n)
Clear n rows from the row buffer.
Definition: dblib.c:2856
RETCODE bcp_options(DBPROCESS *dbproc, int option, BYTE *value, int valuelen)
Set "hints" for uploading a file.
Definition: bcp.c:620
const char * dbmonthname(DBPROCESS *dbproc, char *language, int monthnum, DBBOOL shortform)
Get name of a month, in some human language.
Definition: dblib.c:7006
BYTE * dbretdata(DBPROCESS *dbproc, int retnum)
Get value of an output parameter filled by a stored procedure.
Definition: dblib.c:4795
RETCODE dbsetmaxprocs(int maxprocs)
Set maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:4141
Definition: dbpivot.c:841
DBSMALLINT offset
time offset
Definition: sybdb.h:311
int dbstrlen(DBPROCESS *dbproc)
Get size of the command buffer, in bytes.
Definition: dblib.c:6333
BYTE * dbgetuserdata(DBPROCESS *dbproc)
Get address of user-allocated data from a DBPROCESS.
Definition: dblib.c:6000
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:7348
RETCODE dbcancel(DBPROCESS *dbproc)
Cancel the current command batch.
Definition: dblib.c:3409
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
int dbnumalts(DBPROCESS *dbproc, int computeid)
Get count of columns in a compute row.
Definition: dblib.c:4982
DBINT dbaltlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in compute column.
Definition: dblib.c:7185
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:505
RETCODE dbuse(DBPROCESS *dbproc, const char *name)
Change current database.
Definition: dblib.c:1460
RETCODE dbsetlogintime(int seconds)
Set maximum seconds db-lib waits for a server response to a login attempt.
Definition: dblib.c:4281
void dbsetuserdata(DBPROCESS *dbproc, BYTE *ptr)
Associate client-allocated (and defined) data with a DBPROCESS.
Definition: dblib.c:5982
RETCODE bcp_init(DBPROCESS *dbproc, const char *tblname, const char *hfile, const char *errfile, int direction)
Prepare for bulk copy operation on a table.
Definition: bcp.c:163
DBBOOL dbdead(DBPROCESS *dbproc)
Check if dbproc is an ex-parrot.
Definition: dblib.c:5100