30 #include "tds_sysdep_public.h" 32 #undef TDS_STATIC_CAST 34 #define TDS_STATIC_CAST(type, a) static_cast<type>(a) 41 #define TDS_STATIC_CAST(type, a) ((type)(a)) 44 static const char rcsid_sybdb_h[] =
"$Id: sybdb.h,v 1.85 2007/12/02 23:01:37 jklowden Exp $";
45 static const void *
const no_unused_sybdb_h_warn[] = { rcsid_sybdb_h, no_unused_sybdb_h_warn };
61 #define INT_CONTINUE 1 65 #define DBMAXNUMLEN 33 71 #define DBVERSION_UNKNOWN 0 72 #define DBVERSION_46 1 73 #define DBVERSION_100 2 74 #define DBVERSION_42 3 75 #define DBVERSION_70 4 76 #define DBVERSION_80 5 79 #define DBVER42 DBVERSION_42 80 #define DBVER60 DBVERSION_70 86 #define DBTDS_UNKNOWN 0 104 #define BCPKEEPIDENTITY 8 115 typedef void DBCURSOR;
116 typedef void DBXLATE;
117 typedef void DBSORTORDER;
118 typedef void DBLOGINFO;
119 typedef void *DBVOIDPTR;
121 typedef unsigned short USHORT;
122 typedef int (*INTFUNCPTR) (
void *, ...);
123 typedef int (*DBWAITFUNC) (void);
124 typedef DBWAITFUNC(*DB_DBBUSY_FUNC) (
void *dbproc);
125 typedef void (*DB_DBIDLE_FUNC) (DBWAITFUNC dfunc,
void *dbproc);
126 typedef int (*DB_DBCHKINTR_FUNC) (
void *dbproc);
127 typedef int (*DB_DBHNDLINTR_FUNC) (
void *dbproc);
129 #ifndef __INCvxWorksh 141 #if !defined(_WINDEF_) && !defined(_WINDEF_H) && !defined(DOS32X) 146 #if !defined(_FREETDS_LIBRARY_SOURCE) || !defined(_tds_h_) 152 #define SYBCHAR SYBCHAR 154 #define SYBVARCHAR SYBVARCHAR 156 #define SYBINTN SYBINTN 158 #define SYBINT1 SYBINT1 160 #define SYBINT2 SYBINT2 162 #define SYBINT4 SYBINT4 164 #define SYBINT8 SYBINT8 166 #define SYBFLT8 SYBFLT8 168 #define SYBDATETIME SYBDATETIME 170 #define SYBBIT SYBBIT 172 #define SYBTEXT SYBTEXT 174 #define SYBIMAGE SYBIMAGE 176 #define SYBMONEY4 SYBMONEY4 178 #define SYBMONEY SYBMONEY 180 #define SYBDATETIME4 SYBDATETIME4 182 #define SYBREAL SYBREAL 184 #define SYBBINARY SYBBINARY 186 #define SYBVARBINARY SYBVARBINARY 188 #define SYBNUMERIC SYBNUMERIC 190 #define SYBDECIMAL SYBDECIMAL 192 #define SYBFLTN SYBFLTN 194 #define SYBMONEYN SYBMONEYN 196 #define SYBDATETIMN SYBDATETIMN 199 #define SYBAOPCNT 0x4b 200 #define SYBAOPCNTU 0x4c 201 #define SYBAOPSUM 0x4d 202 #define SYBAOPSUMU 0x4e 203 #define SYBAOPAVG 0x4f 204 #define SYBAOPAVGU 0x50 205 #define SYBAOPMIN 0x51 206 #define SYBAOPMAX 0x52 209 #define SYBAOPCNT_BIG 0x09 210 #define SYBAOPSTDEV 0x30 211 #define SYBAOPSTDEVP 0x31 212 #define SYBAOPVAR 0x32 213 #define SYBAOPVARP 0x33 214 #define SYBAOPCHECKSUM_AGG 0x72 218 typedef unsigned char DBBOOL;
220 typedef unsigned char DBBIT;
221 typedef unsigned char DBTINYINT;
222 typedef tds_sysdep_int16_type DBSMALLINT;
223 typedef tds_sysdep_int32_type DBINT;
224 typedef unsigned char DBBINARY;
225 typedef tds_sysdep_real32_type DBREAL;
226 typedef tds_sysdep_real64_type DBFLT8;
227 typedef unsigned tds_sysdep_int16_type DBUSMALLINT;
237 unsigned char precision;
239 unsigned char array[33];
247 unsigned tds_sysdep_int32_type mnylow;
268 #define SQLCHAR SYBCHAR 274 typedef unsigned char BYTE;
293 { MAXCOLNAMELEN = 512 };
294 typedef enum { CI_REGULAR=1, CI_ALTERNATE=2, CI_CURSOR=3 } CI_TYPE;
299 DBCHAR Name[MAXCOLNAMELEN+2];
300 DBCHAR ActualName[MAXCOLNAMELEN+2];
301 DBCHAR TableName[MAXCOLNAMELEN+2];
319 #define DBPARSEONLY 0 323 #define DBARITHIGNORE 4 325 #define DBARITHABORT 6 326 #define DBTEXTLIMIT 7 332 #define DBSTORPROCID 13 334 #define DBNOAUTOFREE 15 335 #define DBROWCOUNT 16 336 #define DBTEXTSIZE 17 338 #define DBDATEFORMAT 19 340 #define DBPRCOLSEP 21 341 #define DBPRLINELEN 22 342 #define DBPRLINESEP 23 343 #define DBLFCONVERT 24 344 #define DBDATEFIRST 25 345 #define DBCHAINXACTS 26 346 #define DBFIPSFLAG 27 347 #define DBISOLATION 28 349 #define DBIDENTITY 30 351 #define DBDATESHORT 32 352 #define DBCLIENTCURSORS 33 354 #define DBQUOTEDIDENT 35 356 #define DBNUMOPTIONS 36 364 #define NOSUCHOPTION 2 366 #define MAXOPTTEXT 32 397 typedef int (*EHANDLEFUNC) (
DBPROCESS * dbproc,
int severity,
int dberr,
int oserr,
char *dberrstr,
char *oserrstr);
399 typedef int (*MHANDLEFUNC) (
DBPROCESS * dbproc, DBINT msgno,
int msgstate,
int severity,
char *msgtext,
char *srvname,
400 char *proc,
int line);
404 #define DBNOTIFICATION 2 406 #define DBINTERRUPT 4 414 #define NTBSTRINGBIND 2 415 #define VARYCHARBIND 3 416 #define VARYBINBIND 4 422 #define DATETIMEBIND 11 423 #define SMALLDATETIMEBIND 12 425 #define SMALLMONEYBIND 14 426 #define BINARYBIND 15 428 #define NUMERICBIND 17 429 #define DECIMALBIND 18 430 #define MAXBINDTYPES 19 432 #define DBPRCOLSEP 21 433 #define DBPRLINELEN 22 434 #define DBRPCRETURN 1 435 #define DBRPCDEFAULT 2 439 #define NO_MORE_ROWS -2 441 #define NO_MORE_RESULTS 2 447 #define DB_QUERYOUT 3 454 #define DBRPCRECOMPILE TDS_STATIC_CAST(DBSMALLINT, 0x0001) 455 #define DBRPCRESET TDS_STATIC_CAST(DBSMALLINT, 0x0002) 456 #define DBRPCCURSOR TDS_STATIC_CAST(DBSMALLINT, 0x0008) 458 DBBOOL db12hour(
DBPROCESS * dbprocess,
char *language);
461 RETCODE
dbaltbind(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
462 RETCODE dbaltbind_ps(
DBPROCESS * dbprocess,
int computeid,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
470 RETCODE
dbbind(
DBPROCESS * dbproc,
int column,
int vartype, DBINT varlen, BYTE * varaddr);
471 RETCODE dbbind_ps(
DBPROCESS * dbprocess,
int column,
int vartype, DBINT varlen, BYTE * varaddr,
DBTYPEINFO * typeinfo);
477 DBBOOL dbcharsetconv(
DBPROCESS * dbprocess);
484 #define DBCMDROW(x) dbcmdrow((x)) 485 DBBOOL dbcolbrowse(
DBPROCESS * dbprocess,
int colnum);
494 DBINT
dbconvert(
DBPROCESS * dbproc,
int srctype,
const BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen);
495 DBINT
dbconvert_ps(
DBPROCESS * dbprocess,
int srctype, BYTE * src, DBINT srclen,
int desttype, BYTE * dest, DBINT destlen,
499 #define DBCOUNT(x) dbcount((x)) 502 #define DBCURCMD(x) dbcurcmd((x)) 505 #define DBCURROW(x) dbcurrow((x)) 506 RETCODE dbcursor(DBCURSOR * hc, DBINT optype, DBINT bufno, BYTE * table, BYTE * values);
507 RETCODE dbcursorbind(DBCURSOR * hc,
int col,
int vartype, DBINT varlen, DBINT * poutlen, BYTE * pvaraddr,
DBTYPEINFO * typeinfo);
508 void dbcursorclose(DBCURSOR * hc);
509 RETCODE dbcursorcolinfo(DBCURSOR * hc, DBINT column, DBCHAR * colname, DBINT * coltype, DBINT * collen, DBINT * usertype);
510 RETCODE dbcursorfetch(DBCURSOR * hc, DBINT fetchtype, DBINT rownum);
511 RETCODE dbcursorinfo(DBCURSOR * hc, DBINT * ncols, DBINT * nrows);
512 DBCURSOR *dbcursoropen(
DBPROCESS * dbprocess, BYTE * stmt, SHORT scollopt, SHORT concuropt, USHORT nrows, DBINT * pstatus);
516 RETCODE dbdatechar(
DBPROCESS * dbprocess,
char *buf,
int datepart,
int value);
520 char *dateorder(
DBPROCESS * dbprocess,
char *language);
524 char *dbdayname(
DBPROCESS * dbprocess,
char *language,
int daynum);
527 #define DBDEAD(x) dbdead((x)) 533 #define DBFIRSTROW(x) dbfirstrow((x)) 534 RETCODE dbfree_xlate(
DBPROCESS * dbprocess, DBXLATE * xlt_tosrv, DBXLATE * clt_todisp);
536 void dbfreequal(
char *qualptr);
537 RETCODE dbfreesort(
DBPROCESS * dbprocess, DBSORTORDER * sortorder);
539 char *dbgetcharset(
DBPROCESS * dbprocess);
540 RETCODE dbgetloginfo(
DBPROCESS * dbprocess, DBLOGINFO ** loginfo);
541 int dbgetlusername(
LOGINREC * login, BYTE * name_buffer,
int buffer_len);
543 char *dbgetnatlanf(
DBPROCESS * dbprocess);
544 int dbgetoff(
DBPROCESS * dbprocess, DBUSMALLINT offtype,
int startfrom);
548 #define DBGETTIME dbgettime 554 #define DBIORDESC(x) dbiordesc((x)) 557 #define DBIOWDESC(x) dbiowdesc((x)) 560 #define DBISAVAIL(x) dbisavail((x)) 564 #define DBLASTROW(x) dblastrow((x)) 565 RETCODE dbload_xlate(
DBPROCESS * dbprocess,
char *srv_charset,
char *clt_name, DBXLATE ** xlt_tosrv, DBXLATE ** xlt_todisp);
566 DBSORTORDER *dbloadsort(
DBPROCESS * dbprocess);
590 RETCODE dbmnydigit(
DBPROCESS * dbprocess,
DBMONEY * m1, DBCHAR * value, DBBOOL * zero);
597 #define DBMORECMDS(x) dbmorecmds((x)) 602 RETCODE dbnpcreate(
DBPROCESS * dbprocess);
603 RETCODE dbnpdefine(
DBPROCESS * dbprocess, DBCHAR * procedure_name, DBSMALLINT namelen);
614 #define dbopen(x,y) tdsdbopen((x),(y), 1) 616 #define dbopen(x,y) tdsdbopen((x),(y), 0) 620 #ifdef PHP_SYBASE_DBOPEN 621 #undef PHP_SYBASE_DBOPEN 622 #define PHP_SYBASE_DBOPEN dbopen 625 int dbordercol(
DBPROCESS * dbprocess,
int order);
630 char *dbqual(
DBPROCESS * dbprocess,
int tabnum,
char *tabname);
632 DBINT dbreadpage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, BYTE * buf);
635 RETCODE dbrecvpassthru(
DBPROCESS * dbprocess, DBVOIDPTR * bufp);
636 RETCODE dbregdrop(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
638 RETCODE dbreghandle(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, INTFUNCPTR handler);
641 RETCODE dbregnowatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen);
642 RETCODE
dbregparam(
DBPROCESS * dbproc,
char *param_name,
int type, DBINT datalen, BYTE * data);
643 RETCODE dbregwatch(
DBPROCESS * dbprocess, DBCHAR * procnm, DBSMALLINT namelen, DBUSMALLINT options);
644 RETCODE dbregwatchlist(
DBPROCESS * dbprocess);
646 RETCODE dbresults_r(
DBPROCESS * dbproc,
int recursive);
654 #define DBROWS(x) dbrows((x)) 657 #define DBROWTYPE(x) dbrowtype((x)) 659 RETCODE
dbrpcparam(
DBPROCESS * dbproc,
char *paramname, BYTE status,
int type, DBINT maxlen, DBINT datalen, BYTE * value);
662 RETCODE
dbrpwset(
LOGINREC * login,
char *srvname,
char *password,
int pwlen);
663 RETCODE
dbsafestr(
DBPROCESS * dbproc,
const char *src, DBINT srclen,
char *dest, DBINT destlen,
int quotetype);
664 RETCODE *dbsechandle(DBINT type, INTFUNCPTR handler);
665 RETCODE dbsendpassthru(
DBPROCESS * dbprocess, DBVOIDPTR bufp);
668 void dbsetbusy(
DBPROCESS * dbprocess, DB_DBBUSY_FUNC busyfunc);
671 void dbsetidle(
DBPROCESS * dbprocess, DB_DBIDLE_FUNC idlefunc);
674 RETCODE dbsetloginfo(
LOGINREC * loginrec, DBLOGINFO * loginfo);
678 RETCODE
dbsetopt(
DBPROCESS * dbproc,
int option,
const char *char_param,
int int_param);
692 int dbstrbuild(
DBPROCESS * dbproc,
char *charbuf,
int bufsize,
char *text,
char *formats, ...);
693 int dbstrcmp(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
696 int dbstrsort(
DBPROCESS * dbprocess,
char *s1,
int l1,
char *s2,
int l2, DBSORTORDER * sort);
697 DBBOOL dbtabbrowse(
DBPROCESS * dbprocess,
int tabnum);
699 char *dbtabname(
DBPROCESS * dbprocess,
int tabnum);
700 char *dbtabsoruce(
DBPROCESS * dbprocess,
int colnum,
int *tabnum);
703 #define SYBEICONVIU 2400 704 #define SYBEICONVAVAIL 2401 705 #define SYBEICONVO 2402 706 #define SYBEICONVI 2403 707 #define SYBEICONV2BIG 2404 710 #define SYBETDSVER 2410 711 #define SYBESYNC 20001 712 #define SYBEFCON 20002 713 #define SYBETIME 20003 714 #define SYBEREAD 20004 715 #define SYBEBUFL 20005 716 #define SYBEWRIT 20006 717 #define SYBEVMS 20007 718 #define SYBESOCK 20008 719 #define SYBECONN 20009 720 #define SYBEMEM 20010 721 #define SYBEDBPS 20011 722 #define SYBEINTF 20012 723 #define SYBEUHST 20013 724 #define SYBEPWD 20014 725 #define SYBEOPIN 20015 726 #define SYBEINLN 20016 727 #define SYBESEOF 20017 728 #define SYBESMSG 20018 729 #define SYBERPND 20019 730 #define SYBEBTOK 20020 731 #define SYBEITIM 20021 732 #define SYBEOOB 20022 733 #define SYBEBTYP 20023 734 #define SYBEBNCR 20024 735 #define SYBEIICL 20025 736 #define SYBECNOR 20026 737 #define SYBENPRM 20027 738 #define SYBEUVDT 20028 739 #define SYBEUFDT 20029 740 #define SYBEWAID 20030 741 #define SYBECDNS 20031 742 #define SYBEABNC 20032 743 #define SYBEABMT 20033 744 #define SYBEABNP 20034 745 #define SYBEAAMT 20035 746 #define SYBENXID 20036 747 #define SYBERXID 20037 748 #define SYBEICN 20038 749 #define SYBENMOB 20039 750 #define SYBEAPUT 20040 751 #define SYBEASNL 20041 752 #define SYBENTLL 20042 753 #define SYBEASUL 20043 754 #define SYBERDNR 20044 755 #define SYBENSIP 20045 756 #define SYBEABNV 20046 757 #define SYBEDDNE 20047 758 #define SYBECUFL 20048 759 #define SYBECOFL 20049 760 #define SYBECSYN 20050 761 #define SYBECLPR 20051 762 #define SYBECNOV 20052 763 #define SYBERDCN 20053 764 #define SYBESFOV 20054 765 #define SYBEUNT 20055 766 #define SYBECLOS 20056 767 #define SYBEUAVE 20057 768 #define SYBEUSCT 20058 769 #define SYBEEQVA 20059 770 #define SYBEUDTY 20060 771 #define SYBETSIT 20061 772 #define SYBEAUTN 20062 773 #define SYBEBDIO 20063 774 #define SYBEBCNT 20064 775 #define SYBEIFNB 20065 776 #define SYBETTS 20066 777 #define SYBEKBCO 20067 778 #define SYBEBBCI 20068 779 #define SYBEKBCI 20069 780 #define SYBEBCRE 20070 781 #define SYBETPTN 20071 782 #define SYBEBCWE 20072 783 #define SYBEBCNN 20073 784 #define SYBEBCOR 20074 785 #define SYBEBCIS 20075 786 #define SYBEBCPI 20076 787 #define SYBEBCPN 20077 788 #define SYBEBCPB 20078 789 #define SYBEVDPT 20079 790 #define SYBEBIVI 20080 791 #define SYBEBCBC 20081 792 #define SYBEBCFO 20082 793 #define SYBEBCVH 20083 794 #define SYBEBCUO 20084 795 #define SYBEBCUC 20085 796 #define SYBEBUOE 20086 797 #define SYBEBUCE 20087 798 #define SYBEBWEF 20088 799 #define SYBEASTF 20089 800 #define SYBEUACS 20090 801 #define SYBEASEC 20091 802 #define SYBETMTD 20092 803 #define SYBENTTN 20093 804 #define SYBEDNTI 20094 805 #define SYBEBTMT 20095 806 #define SYBEORPF 20096 807 #define SYBEUVBF 20097 808 #define SYBEBUOF 20098 809 #define SYBEBUCF 20099 810 #define SYBEBRFF 20100 811 #define SYBEBWFF 20101 812 #define SYBEBUDF 20102 813 #define SYBEBIHC 20103 814 #define SYBEBEOF 20104 815 #define SYBEBCNL 20105 816 #define SYBEBCSI 20106 817 #define SYBEBCIT 20107 818 #define SYBEBCSA 20108 819 #define SYBENULL 20109 820 #define SYBEUNAM 20110 821 #define SYBEBCRO 20111 822 #define SYBEMPLL 20112 823 #define SYBERPIL 20113 824 #define SYBERPUL 20114 825 #define SYBEUNOP 20115 826 #define SYBECRNC 20116 827 #define SYBERTCC 20117 828 #define SYBERTSC 20118 829 #define SYBEUCRR 20119 830 #define SYBERPNA 20120 831 #define SYBEOPNA 20121 832 #define SYBEFGTL 20122 833 #define SYBECWLL 20123 834 #define SYBEUFDS 20124 835 #define SYBEUCPT 20125 836 #define SYBETMCF 20126 837 #define SYBEAICF 20127 838 #define SYBEADST 20128 839 #define SYBEALTT 20129 840 #define SYBEAPCT 20130 841 #define SYBEXOCI 20131 842 #define SYBEFSHD 20132 843 #define SYBEAOLF 20133 844 #define SYBEARDI 20134 845 #define SYBEURCI 20135 846 #define SYBEARDL 20136 847 #define SYBEURMI 20137 848 #define SYBEUREM 20138 849 #define SYBEURES 20139 850 #define SYBEUREI 20140 851 #define SYBEOREN 20141 852 #define SYBEISOI 20142 853 #define SYBEIDCL 20143 854 #define SYBEIMCL 20144 855 #define SYBEIFCL 20145 856 #define SYBEUTDS 20146 857 #define SYBEBUFF 20147 858 #define SYBEACNV 20148 859 #define SYBEDPOR 20149 860 #define SYBENDC 20150 861 #define SYBEMVOR 20151 862 #define SYBEDVOR 20152 863 #define SYBENBVP 20153 864 #define SYBESPID 20154 865 #define SYBENDTP 20155 866 #define SYBEXTN 20156 867 #define SYBEXTDN 20157 868 #define SYBEXTSN 20158 869 #define SYBENUM 20159 870 #define SYBETYPE 20160 871 #define SYBEGENOS 20161 872 #define SYBEPAGE 20162 873 #define SYBEOPTNO 20163 874 #define SYBEETD 20164 875 #define SYBERTYPE 20165 876 #define SYBERFILE 20166 877 #define SYBEFMODE 20167 878 #define SYBESLCT 20168 879 #define SYBEZTXT 20169 880 #define SYBENTST 20170 881 #define SYBEOSSL 20171 882 #define SYBEESSL 20172 883 #define SYBENLNL 20173 884 #define SYBENHAN 20174 885 #define SYBENBUF 20175 886 #define SYBENULP 20176 887 #define SYBENOTI 20177 888 #define SYBEEVOP 20178 889 #define SYBENEHA 20179 890 #define SYBETRAN 20180 891 #define SYBEEVST 20181 892 #define SYBEEINI 20182 893 #define SYBEECRT 20183 894 #define SYBEECAN 20184 895 #define SYBEEUNR 20185 896 #define SYBERPCS 20186 897 #define SYBETPAR 20187 898 #define SYBETEXS 20188 899 #define SYBETRAC 20189 900 #define SYBETRAS 20190 901 #define SYBEPRTF 20191 902 #define SYBETRSN 20192 903 #define SYBEBPKS 20193 904 #define SYBEIPV 20194 905 #define SYBEMOV 20195 906 #define SYBEDIVZ 20196 907 #define SYBEASTL 20197 908 #define SYBESEFA 20198 909 #define SYBEPOLL 20199 910 #define SYBENOEV 20200 911 #define SYBEBADPK 20201 912 #define SYBESECURE 20202 913 #define SYBECAP 20203 914 #define SYBEFUNC 20204 915 #define SYBERESP 20205 916 #define SYBEIVERS 20206 917 #define SYBEONCE 20207 918 #define SYBERPNULL 20208 919 #define SYBERPTXTIM 20209 920 #define SYBENEG 20210 921 #define SYBELBLEN 20211 922 #define SYBEUMSG 20212 923 #define SYBECAPTYP 20213 924 #define SYBEBNUM 20214 925 #define SYBEBBL 20215 926 #define SYBEBPREC 20216 927 #define SYBEBSCALE 20217 928 #define SYBECDOMAIN 20218 929 #define SYBECINTERNAL 20219 930 #define SYBEBTYPSRV 20220 931 #define SYBEBCSET 20221 932 #define SYBEFENC 20222 933 #define SYBEFRES 20223 934 #define SYBEISRVPREC 20224 935 #define SYBEISRVSCL 20225 936 #define SYBEINUMCL 20226 937 #define SYBEIDECCL 20227 938 #define SYBEBCMTXT 20228 939 #define SYBEBCPREC 20229 940 #define SYBEBCBNPR 20230 941 #define SYBEBCBNTYP 20231 942 #define SYBEBCSNTYP 20232 943 #define SYBEBCPCTYP 20233 944 #define SYBEBCVLEN 20234 945 #define SYBEBCHLEN 20235 946 #define SYBEBCBPREF 20236 947 #define SYBEBCPREF 20237 948 #define SYBEBCITBNM 20238 949 #define SYBEBCITBLEN 20239 950 #define SYBEBCSNDROW 20240 951 #define SYBEBPROCOL 20241 952 #define SYBEBPRODEF 20242 953 #define SYBEBPRONUMDEF 20243 954 #define SYBEBPRODEFID 20244 955 #define SYBEBPRONODEF 20245 956 #define SYBEBPRODEFTYP 20246 957 #define SYBEBPROEXTDEF 20247 958 #define SYBEBPROEXTRES 20248 959 #define SYBEBPROBADDEF 20249 960 #define SYBEBPROBADTYP 20250 961 #define SYBEBPROBADLEN 20251 962 #define SYBEBPROBADPREC 20252 963 #define SYBEBPROBADSCL 20253 964 #define SYBEBADTYPE 20254 965 #define SYBECRSNORES 20255 966 #define SYBECRSNOIND 20256 967 #define SYBECRSVIEW 20257 968 #define SYBECRSVIIND 20258 969 #define SYBECRSORD 20259 970 #define SYBECRSBUFR 20260 971 #define SYBECRSNOFREE 20261 972 #define SYBECRSDIS 20262 973 #define SYBECRSAGR 20263 974 #define SYBECRSFRAND 20264 975 #define SYBECRSFLAST 20265 976 #define SYBECRSBROL 20266 977 #define SYBECRSFROWN 20267 978 #define SYBECRSBSKEY 20268 979 #define SYBECRSRO 20269 980 #define SYBECRSNOCOUNT 20270 981 #define SYBECRSTAB 20271 982 #define SYBECRSUPDNB 20272 983 #define SYBECRSNOWHERE 20273 984 #define SYBECRSSET 20274 985 #define SYBECRSUPDTAB 20275 986 #define SYBECRSNOUPD 20276 987 #define SYBECRSINV 20277 988 #define SYBECRSNOKEYS 20278 989 #define SYBECRSNOBIND 20279 990 #define SYBECRSFTYPE 20280 991 #define SYBECRSINVALID 20281 992 #define SYBECRSMROWS 20282 993 #define SYBECRSNROWS 20283 994 #define SYBECRSNOLEN 20284 995 #define SYBECRSNOPTCC 20285 996 #define SYBECRSNORDER 20286 997 #define SYBECRSNOTABLE 20287 998 #define SYBECRSNUNIQUE 20288 999 #define SYBECRSVAR 20289 1000 #define SYBENOVALUE 20290 1001 #define SYBEVOIDRET 20291 1002 #define SYBECLOSEIN 20292 1003 #define SYBEBOOL 20293 1004 #define SYBEBCPOPT 20294 1005 #define SYBEERRLABEL 20295 1006 #define SYBEATTNACK 20296 1007 #define SYBEBBFL 20297 1008 #define SYBEDCL 20298 1009 #define SYBECS 20299 1010 #define SYBEBULKINSERT 20599 1014 #define DBTDS(a) dbtds(a) 1015 DBINT dbtextsize(
DBPROCESS * dbprocess);
1017 DBBINARY *dbtsnewval(
DBPROCESS * dbprocess);
1018 RETCODE dbtsput(
DBPROCESS * dbprocess, DBBINARY * newts,
int newtslen,
int tabnum,
char *tabname);
1021 DBBINARY *dbtxtsnewval(
DBPROCESS * dbprocess);
1022 RETCODE dbtxtsput(
DBPROCESS * dbprocess, DBBINARY newtxts,
int colnum);
1026 RETCODE dbwritepage(
DBPROCESS * dbprocess,
char *p_dbname, DBINT pageno, DBINT size, BYTE * buf);
1027 RETCODE
dbwritetext(
DBPROCESS * dbproc,
char *objname, DBBINARY * textptr, DBTINYINT textptrlen, DBBINARY * timestamp,
1028 DBBOOL log, DBINT size, BYTE * text);
1029 int dbxlate(
DBPROCESS * dbprocess,
char *src,
int srclen,
char *dest,
int destlen, DBXLATE * xlt,
int *srcbytes_used,
1030 DBBOOL srcend,
int status);
1040 #define DBSETLHOST(x,y) dbsetlname((x), (y), DBSETHOST) 1041 #define dbsetlhost(x,y) dbsetlname((x), (y), DBSETHOST) 1043 #define DBSETLUSER(x,y) dbsetlname((x), (y), DBSETUSER) 1044 #define dbsetluser(x,y) dbsetlname((x), (y), DBSETUSER) 1046 #define DBSETLPWD(x,y) dbsetlname((x), (y), DBSETPWD) 1047 #define dbsetlpwd(x,y) dbsetlname((x), (y), DBSETPWD) 1049 #define DBSETLHID(x,y) dbsetlname((x), (y), DBSETHID) 1051 #define DBSETLAPP(x,y) dbsetlname((x), (y), DBSETAPP) 1052 #define dbsetlapp(x,y) dbsetlname((x), (y), DBSETAPP) 1054 #define BCP_SETL(x,y) dbsetlbool((x), (y), DBSETBCP) 1055 #define DBSETNATLANG 7 1056 #define DBSETLNATLANG(x,y) dbsetlname((x), (y), DBSETNATLANG) 1057 #define dbsetlnatlang(x,y) dbsetlname((x), (y), DBSETNATLANG) 1058 #define DBSETNOSHORT 8 1059 #define DBSETLNOSHORT(x,y) dbsetlbool((x), (y), DBSETNOSHORT) 1061 #define DBSETLHIER(x,y) dbsetlshort((x), (y), DBSETHIER) 1062 #define DBSETCHARSET 10 1063 #define DBSETLCHARSET(x,y) dbsetlname((x), (y), DBSETCHARSET) 1064 #define DBSETPACKET 11 1065 #define DBSETLPACKET(x,y) dbsetllong((x), (y), DBSETPACKET) 1066 #define dbsetlpacket(x,y) dbsetllong((x), (y), DBSETPACKET) 1067 #define DBSETENCRYPT 12 1068 #define DBSETLENCRYPT(x,y) dbsetlbool((x), (y), DBSETENCRYPT) 1069 #define DBSETLABELED 13 1070 #define DBSETLLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED) 1071 #define BCP_SETLABELED(x,y) dbsetlbool((x), (y), DBSETLABELED) 1072 #define DBSETLVERSION(login, version) dbsetlversion((login), (version)) 1074 RETCODE
bcp_init(
DBPROCESS * dbproc,
const char *tblname,
const char *hfile,
const char *errfile,
int direction);
1078 RETCODE
bcp_bind(
DBPROCESS * dbproc, BYTE * varaddr,
int prefixlen, DBINT varlen, BYTE * terminator,
int termlen,
int type,
1082 RETCODE
bcp_colfmt(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1083 const BYTE * host_term,
int host_termlen,
int colnum);
1084 RETCODE
bcp_colfmt_ps(
DBPROCESS * dbproc,
int host_column,
int host_type,
int host_prefixlen, DBINT host_collen,
1085 BYTE * host_term,
int host_termlen,
int colnum,
DBTYPEINFO * typeinfo);
1088 int bcp_getbatchsize(
DBPROCESS * dbproc);
1097 void build_xact_string(
char *xact_name,
char *service_name, DBINT commid,
char *result);
1098 RETCODE remove_xact(
DBPROCESS * connect, DBINT commid,
int n);
1099 RETCODE abort_xact(
DBPROCESS * connect, DBINT commid);
1101 RETCODE commit_xact(
DBPROCESS * connect, DBINT commid);
1103 RETCODE scan_xact(
DBPROCESS * connect, DBINT commid);
1104 DBINT start_xact(
DBPROCESS * connect,
char *application_name,
char *xact_name,
int site_count);
1105 DBINT stat_xact(
DBPROCESS * connect, DBINT commid);
RETCODE dbsqlok(DBPROCESS *dbproc)
Wait for results of a query from the server.
Definition: dblib.c:4524
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:421
RETCODE dbmnymaxpos(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum positive DBMONEY value supported.
Definition: dblib.c:5035
DBBOOL dbwillconvert(int srctype, int desttype)
Test whether or not a datatype can be converted to another datatype.
Definition: dblib.c:2720
DBBOOL dbisopt(DBPROCESS *dbproc, int option, char *param)
Get value of an option.
Definition: dblib.c:5812
RETCODE dbaltlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in compute column.
Definition: dblib.c:6809
RETCODE dbsettime(int seconds)
Set maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:3892
RETCODE dbsetllong(LOGINREC *login, long value, int which)
Set an integer value in a LOGINREC structure.
Definition: dblib.c:792
RETCODE dbregexec(DBPROCESS *dbproc, DBUSMALLINT options)
Execute a registered procedure.
Definition: dblib.c:6607
DBINT dbconvert(DBPROCESS *dbproc, int srctype, const BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen)
Convert one datatype to another.
Definition: dblib.c:2133
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:2817
RETCODE dbmnycopy(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Copy a DBMONEY value.
Definition: dblib.c:5672
DBINT dbvarylen(DBPROCESS *dbproc, int column)
Determine whether a column can vary in size.
Definition: dblib.c:2978
RETCODE dbrows(DBPROCESS *dbproc)
Indicate whether a query returned rows.
Definition: dblib.c:3731
int dbiowdesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to write data coming to the server...
Definition: dblib.c:6920
RETCODE dbmnydec(DBPROCESS *dbproc, DBMONEY *mnyptr)
Subtract $0.0001 from a DBMONEY value.
Definition: dblib.c:5186
int dbiordesc(DBPROCESS *dbproc)
Get file descriptor of the socket used by a DBPROCESS to read data coming from the server...
Definition: dblib.c:6904
int dbspid(DBPROCESS *dbproc)
Get server process ID for a DBPROCESS.
Definition: dblib.c:5580
void dbsetifile(char *filename)
set name and location of the interfaces file FreeTDS should use to look up a servername.
Definition: dblib.c:2580
RETCODE dbsetlshort(LOGINREC *login, int value, int which)
Set an integer value in a LOGINREC structure.
Definition: dblib.c:824
RETCODE dbnextrow(DBPROCESS *dbproc)
Read result row into the row buffer and into any bound host variables.
Definition: dblib.c:1939
DBINT dbspr1rowlen(DBPROCESS *dbproc)
Determine size buffer required to hold the results returned by dbsprhead(), dbsprline(), and dbspr1row().
Definition: dblib.c:3115
BYTE * dbadata(DBPROCESS *dbproc, int computeid, int column)
Get address of compute column data.
Definition: dblib.c:4147
RETCODE dbrpcsend(DBPROCESS *dbproc)
Execute the procedure and free associated memory.
Definition: rpc.c:272
RETCODE dbmnymul(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2, DBMONEY *prod)
Multiply two DBMONEY values.
Definition: dblib.c:4903
RETCODE dbgetrow(DBPROCESS *dbproc, DBINT row)
Read a row from the row buffer.
Definition: dblib.c:1800
DBINT dblastrow(DBPROCESS *dbproc)
Get number of the last row in the row buffer.
Definition: dblib.c:6880
int dbretlen(DBPROCESS *dbproc, int retnum)
Get size of an output parameter filled by a stored procedure.
Definition: dblib.c:4489
DBBINARY * dbtxtimestamp(DBPROCESS *dbproc, int column)
Get text timestamp for a column in the current row.
Definition: dblib.c:6187
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition: dblib.c:2737
DBBOOL dbhasretstat(DBPROCESS *dbproc)
Determine if query generated a return status number.
Definition: dblib.c:4356
int dbaltop(DBPROCESS *dbproc, int computeid, int column)
Get aggregation operator for a compute column.
Definition: dblib.c:4176
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:6040
RETCODE dbmnysub(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2, DBMONEY *diff)
Subtract two DBMONEY values.
Definition: dblib.c:4877
RETCODE dbmnyadd(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2, DBMONEY *sum)
Add two DBMONEY values.
Definition: dblib.c:4850
void dbclose(DBPROCESS *dbproc)
Close a connection to the server and free associated resources.
Definition: dblib.c:1366
char * dbcolsource(DBPROCESS *dbproc, int colnum)
Get base database column name for a result set column.
Definition: dblib.c:2930
void dbclrbuf(DBPROCESS *dbproc, DBINT n)
Clear n rows from the row buffer.
Definition: dblib.c:2696
const char * dbprtype(int token)
Print a token value's name to a buffer.
Definition: dblib.c:6101
RETCODE dbanullbind(DBPROCESS *dbprocess, int computeid, int column, DBINT *indicator)
Tie a null-indicator to a compute result column.
Definition: dblib.c:2645
RETCODE dbsetnull(DBPROCESS *dbprocess, int bindtype, int bindlen, BYTE *bindval)
Define substitution values to be used when binding null values.
Definition: dblib.c:1833
RETCODE dbmnyndigit(DBPROCESS *dbproc, DBMONEY *mnyptr, DBCHAR *value, DBBOOL *zero)
Get the least significant digit of a DBMONEY value, represented as a character.
Definition: dblib.c:5083
RETCODE bcp_writefmt(DBPROCESS *dbproc, char *filename)
Write a format definition file.
Definition: bcp.c:2923
BYTE * dbgetuserdata(DBPROCESS *dbproc)
Get address of user-allocated data from a DBPROCESS.
Definition: dblib.c:5625
void dbrpwclr(LOGINREC *login)
Clear remote passwords from the LOGINREC structure.
Definition: dblib.c:5545
RETCODE bcp_options(DBPROCESS *dbproc, int option, BYTE *value, int valuelen)
Set "hints" for uploading a file.
Definition: bcp.c:648
RETCODE dbmny4zero(DBPROCESS *dbproc, DBMONEY4 *dest)
Zero a DBMONEY4 value.
Definition: dblib.c:5268
STATUS dbreadtext(DBPROCESS *dbproc, void *buf, DBINT bufsize)
Fetch part of a text or image value from the server.
Definition: dblib.c:6328
RETCODE dbmny4divide(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *quotient)
Divide two DBMONEY4 values.
Definition: dblib.c:5386
RETCODE bcp_columns(DBPROCESS *dbproc, int host_colcount)
Indicate how many columns are to be found in the datafile.
Definition: bcp.c:344
char * dbservcharset(DBPROCESS *dbprocess)
Get syscharset name of the server character set.
Definition: dblib.c:6694
char * dbchange(DBPROCESS *dbprocess)
See if a command caused the current database to change.
Definition: dblib.c:6658
RETCODE dbbind(DBPROCESS *dbproc, int column, int vartype, DBINT varlen, BYTE *varaddr)
Tie a host variable to a resultset column.
Definition: dblib.c:2502
RETCODE dbmny4mul(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *prod)
Multiply two DBMONEY4 values.
Definition: dblib.c:5358
int dbaltcolid(DBPROCESS *dbproc, int computeid, int column)
Get column ID of a compute column.
Definition: dblib.c:3981
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:538
RETCODE dbmny4minus(DBPROCESS *dbproc, DBMONEY4 *src, DBMONEY4 *dest)
Negate a DBMONEY4 value.
Definition: dblib.c:5243
void dbsetuserdata(DBPROCESS *dbproc, BYTE *ptr)
Associate client-allocated (and defined) data with a DBPROCESS.
Definition: dblib.c:5606
RETCODE dbsetdefcharset(char *charset)
Set the default character set.
Definition: dblib.c:6524
RETCODE bcp_batch(DBPROCESS *dbproc)
Commit a set of rows to the table.
Definition: bcp.c:2982
int dbnumrets(DBPROCESS *dbproc)
Get count of output parameters filled by a stored procedure.
Definition: dblib.c:4398
RETCODE dbdatecrack(DBPROCESS *dbproc, DBDATEREC *di, DBDATETIME *dt)
Break a DBDATETIME value into useful pieces.
Definition: dblib.c:5507
DBBINARY * dbtxptr(DBPROCESS *dbproc, int column)
Get text pointer for a column in the current row.
Definition: dblib.c:6213
RETCODE dbdatecmp(DBPROCESS *dbproc, DBDATETIME *d1, DBDATETIME *d2)
Compare DBDATETIME values, similar to strcmp(3).
Definition: dblib.c:5467
RETCODE dbmny4copy(DBPROCESS *dbprocess, DBMONEY4 *m1, DBMONEY4 *m2)
Copy a DBMONEY4 value.
Definition: dblib.c:5441
void dbprhead(DBPROCESS *dbproc)
Print result set headings to stdout.
Definition: dblib.c:3656
DBINT dbcolutype(DBPROCESS *dbprocess, int column)
Get user-defined datatype of a regular result column.
Definition: dblib.c:2766
RETCODE dbrpcinit(DBPROCESS *dbproc, char *rpcname, DBSMALLINT options)
Initialize a remote procedure call.
Definition: rpc.c:79
DBBOOL bcp_getl(LOGINREC *login)
See if BCP_SETL() was used to set the LOGINREC for BCP work.
Definition: bcp.c:734
RETCODE dbsprline(DBPROCESS *dbproc, char *buffer, DBINT buf_len, DBCHAR line_char)
Get formatted string for underlining dbsprhead() column names.
Definition: dblib.c:3533
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition: dblib.c:1294
RETCODE dbsetdeflang(char *language)
Set the default character set for an application.
Definition: dblib.c:3761
void dbrecftos(char *filename)
Record to a file all SQL commands sent to the server.
Definition: dblib.c:6435
RETCODE dbreglist(DBPROCESS *dbproc)
Get names of Open Server registered procedures.
Definition: dblib.c:6562
DBBOOL dbdead(DBPROCESS *dbproc)
Check if dbproc is an ex-parrot.
Definition: dblib.c:4745
RETCODE dbsetmaxprocs(int maxprocs)
Set maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3801
RETCODE dbsetlversion(LOGINREC *login, BYTE version)
Set TDS version for future connections.
Definition: dblib.c:876
int dbgetpacket(DBPROCESS *dbproc)
Get TDS packet size for the connection.
Definition: dblib.c:3777
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition: dblib.c:688
int dbmny4cmp(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2)
Compare two DBMONEY4 values.
Definition: dblib.c:5413
DBINT dbfirstrow(DBPROCESS *dbproc)
Get number of the first row in the row buffer.
Definition: dblib.c:6864
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition: dblib.c:1584
RETCODE dbnullbind(DBPROCESS *dbproc, int column, DBINT *indicator)
Tie a null-indicator to a regular result column.
Definition: dblib.c:2609
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:4337
STATUS dbsetrow(DBPROCESS *dbprocess, DBINT row)
Make a buffered row "current" without fetching it into bound variables.
Definition: dblib.c:1910
BYTE * dbbylist(DBPROCESS *dbproc, int computeid, int *size)
Get bylist for a compute row.
Definition: dblib.c:4686
STATUS dbrowtype(DBPROCESS *dbprocess)
Get returned row's type.
Definition: dblib.c:5852
RETCODE dbsetlname(LOGINREC *login, const char *value, int which)
Set the value of a string in a LOGINREC structure.
Definition: dblib.c:738
RETCODE bcp_done(DBPROCESS *dbproc)
Conclude the transfer of data from program variables.
Definition: bcp.c:3018
DBINT dbdatlen(DBPROCESS *dbproc, int column)
Get size of current row's data in a regular result column.
Definition: dblib.c:3027
int dbgetmaxprocs(void)
get maximum simultaneous connections db-lib will open to the server.
Definition: dblib.c:3871
RETCODE dbmny4add(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *sum)
Add two DBMONEY4 values.
Definition: dblib.c:5292
char * dbcolname(DBPROCESS *dbproc, int column)
Return name of a regular result column.
Definition: dblib.c:1767
int dbnumcols(DBPROCESS *dbproc)
Return number of regular columns in a result set.
Definition: dblib.c:1743
RETCODE dbmnydown(DBPROCESS *dbproc, DBMONEY *mnyptr, int divisor, int *remainder)
Divide a DBMONEY value by a positive integer.
Definition: dblib.c:5135
RETCODE dbmnyinc(DBPROCESS *dbproc, DBMONEY *mnyptr)
Add $0.0001 to a DBMONEY value.
Definition: dblib.c:5157
BYTE * dbdata(DBPROCESS *dbproc, int column)
Get address of data in a regular result column.
Definition: dblib.c:3055
DBINT dbcount(DBPROCESS *dbproc)
Get count of rows processed.
Definition: dblib.c:2676
int dbrettype(DBPROCESS *dbproc, int retnum)
Get datatype of a stored procedure's return parameter.
Definition: dblib.c:5918
RETCODE dbsqlsend(DBPROCESS *dbproc)
Transmit the command buffer to the server.
Definition: dblib.c:6714
const char * dbmonthname(DBPROCESS *dbproc, char *language, int monthnum, DBBOOL shortform)
Get name of a month, in some human language.
Definition: dblib.c:6629
int dbcurcmd(DBPROCESS *dbproc)
Get number of the row just returned.
Definition: dblib.c:5869
RETCODE dbmnydivide(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2, DBMONEY *quotient)
Divide two DBMONEY values.
Definition: dblib.c:4929
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:130
RETCODE dbmnyzero(DBPROCESS *dbproc, DBMONEY *dest)
Set a DBMONEY value to zero.
Definition: dblib.c:5013
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:6973
int dbnumalts(DBPROCESS *dbproc, int computeid)
Get count of columns in a compute row.
Definition: dblib.c:4627
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition: dblib.c:4808
RETCODE dbmnymaxneg(DBPROCESS *dbproc, DBMONEY *dest)
Get maximum negative DBMONEY value supported.
Definition: dblib.c:5057
RETCODE dbmnyminus(DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
Negate a DBMONEY value.
Definition: dblib.c:5215
RETCODE dbrpcparam(DBPROCESS *dbproc, char *paramname, BYTE status, int type, DBINT maxlen, DBINT datalen, BYTE *value)
Add a parameter to a remote procedure call.
Definition: rpc.c:158
RETCODE dbreginit(DBPROCESS *dbproc, DBCHAR *procedure_name, DBSMALLINT namelen)
Ready execution of a registered procedure.
Definition: dblib.c:6542
RETCODE dbprrow(DBPROCESS *dbproc)
Print a result set to stdout.
Definition: dblib.c:3238
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:4102
BYTE * dbretdata(DBPROCESS *dbproc, int retnum)
Get value of an output parameter filled by a stored procedure.
Definition: dblib.c:4460
DBINT dbretstatus(DBPROCESS *dbproc)
Fetch status value returned by query or remote procedure call.
Definition: dblib.c:4380
DBINT dbadlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in a compute column.
Definition: dblib.c:4007
DBINT dbcollen(DBPROCESS *dbproc, int column)
Get size of a regular result column.
Definition: dblib.c:2953
RETCODE dbcanquery(DBPROCESS *dbproc)
Cancel the query currently being retrieved, discarding all pending rows.
Definition: dblib.c:5694
DBTYPEINFO * dbcoltypeinfo(DBPROCESS *dbproc, int column)
Get precision and scale information for a regular result column.
Definition: dblib.c:2788
void dbloginfree(LOGINREC *login)
free the LOGINREC
Definition: dblib.c:716
const char * dbversion(void)
See which version of db-lib is in use.
Definition: dblib.c:6509
DBPROCESS * tdsdbopen(LOGINREC *login, const char *server, int msdblib)
Form a connection with the server.
Definition: dblib.c:1088
RETCODE dbspr1row(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print a regular result row to a buffer.
Definition: dblib.c:3153
RETCODE dbsetlbool(LOGINREC *login, int value, int which)
Set a boolean value in a LOGINREC structure.
Definition: dblib.c:851
int dbnumcompute(DBPROCESS *dbprocess)
Get count of COMPUTE clauses for a result set.
Definition: dblib.c:4660
RETCODE bcp_sendrow(DBPROCESS *dbproc)
Write data in host variables to the table.
Definition: bcp.c:1815
int dbmnycmp(DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2)
Compare two DBMONEY values.
Definition: dblib.c:4955
RETCODE dbsetopt(DBPROCESS *dbproc, int option, const char *char_param, int int_param)
Set db-lib or server option.
Definition: dblib.c:4203
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:6118
RETCODE dbinit(void)
Initialize db-lib.
Definition: dblib.c:643
RETCODE dbsprhead(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print result set headings to a buffer.
Definition: dblib.c:3592
DBINT dbcurrow(DBPROCESS *dbproc)
Get number of the row currently being read.
Definition: dblib.c:5835
RETCODE dbfcmd(DBPROCESS *dbproc, const char *fmt,...)
printf-like way to form SQL to send to the server.
Definition: dblib.c:1198
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition: bcp.c:574
RETCODE dbmnyinit(DBPROCESS *dbproc, DBMONEY *mnyptr, int trim, DBBOOL *negative)
Prepare a DBMONEY value for use with dbmnyndigit().
Definition: dblib.c:5109
int dbalttype(DBPROCESS *dbproc, int computeid, int column)
Get datatype for a compute column.
Definition: dblib.c:4037
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:3069
void dbfreebuf(DBPROCESS *dbproc)
Erase the command buffer, in case DBNOAUTOFREE was set with dbsetopt().
Definition: dblib.c:5725
RETCODE dbcancel(DBPROCESS *dbproc)
Cancel the current command batch.
Definition: dblib.c:3089
void dbexit(void)
Close server connections and free all related structures.
Definition: dblib.c:1435
int dbstrlen(DBPROCESS *dbproc)
Get size of the command buffer, in bytes.
Definition: dblib.c:5943
RETCODE dbmny4sub(DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *diff)
Subtract two DBMONEY4 values.
Definition: dblib.c:5324
RETCODE bcp_moretext(DBPROCESS *dbproc, DBINT size, BYTE *text)
Write some text or image data to the server.
Definition: bcp.c:2955
RETCODE bcp_exec(DBPROCESS *dbproc, DBINT *rows_copied)
Write a datafile to a table.
Definition: bcp.c:2065
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:309
RETCODE dbmnyscale(DBPROCESS *dbproc, DBMONEY *dest, int multiplier, int addend)
Multiply a DBMONEY value by a positive integer, and add an amount.
Definition: dblib.c:4991
int dbgettime(void)
Get maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:3919
RETCODE dbuse(DBPROCESS *dbproc, const char *name)
Change current database.
Definition: dblib.c:1322
Definition: bsqlodbc.c:94
DBINT dbconvert_ps(DBPROCESS *dbprocess, int srctype, BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen, DBTYPEINFO *typeinfo)
cf.
Definition: dblib.c:2457
RETCODE dbsetlogintime(int seconds)
Set maximum seconds db-lib waits for a server response to a login attempt.
Definition: dblib.c:3935
RETCODE dbrpwset(LOGINREC *login, char *srvname, char *password, int pwlen)
Add a remote password to the LOGINREC structure.
Definition: dblib.c:5564
RETCODE dbsetversion(DBINT version)
Specify a db-lib version level.
Definition: dblib.c:5643
RETCODE dbregparam(DBPROCESS *dbproc, char *param_name, int type, DBINT datalen, BYTE *data)
Describe parameter of registered procedure .
Definition: dblib.c:6585
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Definition: dblib.c:6678
RETCODE dbclropt(DBPROCESS *dbproc, int option, char *param)
Reset an option.
Definition: dblib.c:5759
char * dbretname(DBPROCESS *dbproc, int retnum)
Get name of an output parameter filled by a stored procedure.
Definition: dblib.c:4430
void dbsetavail(DBPROCESS *dbprocess)
Mark a DBPROCESS as "available".
Definition: dblib.c:6948
RETCODE dbcmdrow(DBPROCESS *dbproc)
See if the current command can return rows.
Definition: dblib.c:3956
RETCODE bcp_readfmt(DBPROCESS *dbproc, char *filename)
Read a format definition file.
Definition: bcp.c:2643
RETCODE dbmoretext(DBPROCESS *dbproc, DBINT size, BYTE *text)
Send chunk of a text/image value to the server.
Definition: dblib.c:6397
RETCODE dbaltutype(DBPROCESS *dbproc, int computeid, int column)
Get user-defined datatype of a compute column.
Definition: dblib.c:6786
RETCODE dbcmd(DBPROCESS *dbproc, const char *cmdstring)
Append SQL to the command buffer.
Definition: dblib.c:1238
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition: dblib.c:4827
char * dbgetchar(DBPROCESS *dbprocess, int n)
Get address of a position in the command buffer.
Definition: dblib.c:5962
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:6246
RETCODE dbstrcpy(DBPROCESS *dbproc, int start, int numbytes, char *dest)
Get a copy of a chunk of the command buffer.
Definition: dblib.c:5995
RETCODE dbpoll(DBPROCESS *dbproc, long milliseconds, DBPROCESS **ready_dbproc, int *return_reason)
See if a server response has arrived.
Definition: dblib.c:6844
RETCODE bcp_colptr(DBPROCESS *dbproc, BYTE *colptr, int table_column)
Override bcp_bind() by pointing to a different host variable.
Definition: bcp.c:697
RETCODE dbmorecmds(DBPROCESS *dbproc)
See if more commands are to be processed.
Definition: dblib.c:5886
int dbtds(DBPROCESS *dbprocess)
Get the TDS version in use for dbproc.
Definition: dblib.c:6469