# include/sybdb.h File Reference

Primary include file for db-lib applications. More...

`#include "tds_sysdep_public.h"`

Go to the source code of this file.

## Classes

struct | DBCOL
struct | DBDATETIME
struct | DBDATETIME4
struct | DBMONEY
struct | DBMONEY4
struct | DBNUMERIC
struct | dbstring
struct | dbtypeinfo
struct | DBVARYBIN
struct | DBVARYCHAR
struct | tds_microsoft_dbdaterec
struct | tds_sybase_dbdaterec

## Defines

#define | BCP_SETL(x, y) dbsetlbool((x), (y), DBSETBCP)
| Enable (or prevent) bcp operations for connections made with a login.
#define | BCP_SETLABELED(x, y) dbsetlbool((x), (y), DBSETLABELED)
#define | BCPBATCH 4
#define | BCPFIRST 2
#define | BCPHINTS 6
#define | BCPKEEPIDENTITY 8
#define | BCPLABELED 5
#define | BCPLAST 3
#define | BCPMAXERRS 1
#define | BIGINTBIND 30
#define | BINARYBIND 15
#define | BITBIND 16
#define | BUF_FULL -3
#define | CHARBIND 0
#define | DATETIMEBIND 11
#define | DB_IN 1
#define | DB_OUT 2
#define | DB_QUERYOUT 3
#define | DBARITHABORT 6
#define | DBARITHIGNORE 4
#define | DBAUTH 29
#define | DBBOTH 2
#define | DBBROWSE 8
#define | DBBUFFER 14
#define | DBCHAINXACTS 26
#define | DBCLIENTCURSORS 33
#define | DBCMDNONE 0
#define | DBCMDPEND 1
#define | DBCMDROW(x) dbcmdrow((x))
| Sybase macro mapping to the Microsoft (lower-case) function.
#define | DBCMDSENT 2
#define | DBCONFIRM 12
#define | DBCOUNT(x) dbcount((x))
| Sybase macro mapping to the Microsoft (lower-case) function.
#define | DBCURCMD(x) dbcurcmd((x))
| Sybase macro mapping to the Microsoft (lower-case) function.
#define | DBCURROW(x) dbcurrow((x))
| Sybase macro mapping to the Microsoft (lower-case) function.
#define | DBDATEFIRST 25
#define | DBDATEFORMAT 19
#define | DBDATESHORT 32
#define | DBDEAD(x) dbdead((x))
| Sybase macro mapping to the Microsoft (lower-case) function.
#define | DBDOUBLE 1
#define | DBERRLVL 11
#define | DBESTIMATE 1
#define | DBFIPSFLAG 27
#define | DBFIRSTROW(x) dbfirstrow((x))
| Sybase macro mapping to the Microsoft (lower-case) function.
#define | DBGETTIME dbgettime
#define | DBIDENTITY 30
#define | DBINTERRUPT 4
#define | DBIORDESC(x) dbiordesc((x))
| Sybase macro, maps to the internal (lower-case) function.
#define | DBIOWDESC(x) dbiowdesc((x))
| Sybase macro, maps to the internal (lower-case) function.
#define | DBISAVAIL(x) dbisavail((x))
| Sybase macro mapping to the Microsoft (lower-case) function.
#define | DBISOLATION 28
#define | DBLASTROW(x) dblastrow((x))
| Sybase macro mapping to the Microsoft (lower-case) function.
#define | DBLFCONVERT 24
#define | DBMAXNAME 30
#define | DBMAXNUMLEN 33
#define | DBMORECMDS(x) dbmorecmds((x))
| Sybase macro mapping to the Microsoft (lower-case) function.
#define | DBNATLANG 18
#define | DBNOAUTOFREE 15
#define | DBNOCOUNT 5
#define | DBNOERR -1
#define | DBNOEXEC 3
#define | DBNOIDCOL 31
#define | DBNOSAVE 0
#define | DBNOTIFICATION 2
#define | DBNUMOPTIONS 36
#define | DBOFFSET 9
#define | dbopen(x, y) tdsdbopen((x),(y), 0)
#define | DBPADOFF 0
#define | DBPADON 1
#define | DBPARSEONLY 0
#define | DBPRCOLSEP 21
#define | DBPRCOLSEP 21
#define | DBPRLINELEN 22
#define | DBPRLINELEN 22
#define | DBPRLINESEP 23
#define | DBPRPAD 20
#define | DBQUOTEDIDENT 35
#define | DBRESULT 1
#define | DBROWCOUNT 16
#define | DBROWS(x) dbrows((x))
| Sybase macro mapping to the Microsoft (lower-case) function.
#define | DBROWTYPE(x) dbrowtype((x))
| Sybase macro mapping to the Microsoft (lower-case) function.
#define | DBRPCCURSOR TDS_STATIC_CAST(DBSMALLINT, 0x0008)
#define | DBRPCDEFAULT 2
#define | DBRPCRECOMPILE TDS_STATIC_CAST(DBSMALLINT, 0x0001)
#define | DBRPCRESET TDS_STATIC_CAST(DBSMALLINT, 0x0002)
#define | DBRPCRETURN 1
#define | DBSAVE 1
#define | DBSETAPP 5
#define | DBSETBCP 6
#define | DBSETCHARSET 10
#define | DBSETDBNAME 14
#define | DBSETENCRYPT 12
#define | DBSETHOST 1
#define | DBSETLABELED 13
#define | dbsetlapp(x, y) dbsetlname((x), (y), DBSETAPP)
#define | DBSETLAPP(x, y) dbsetlname((x), (y), DBSETAPP)
| Set the (client) application name in the login packet.
#define | DBSETLCHARSET(x, y) dbsetlname((x), (y), DBSETCHARSET)
| Set the client character set in the login packet.
#define | DBSETLDBNAME(x, y) dbsetlname((x), (y), DBSETDBNAME)
#define | DBSETLENCRYPT(x, y) dbsetlbool((x), (y), DBSETENCRYPT)
| Enable (or not) network password encryption for Sybase servers version 10.0 or above.
#define | dbsetlhost(x, y) dbsetlname((x), (y), DBSETHOST)
#define | DBSETLHOST(x, y) dbsetlname((x), (y), DBSETHOST)
| Set the (client) host name in the login packet.
#define | DBSETLLABELED(x, y) dbsetlbool((x), (y), DBSETLABELED)
| Alternative way to set login packet fields.
#define | dbsetlnatlang(x, y) dbsetlname((x), (y), DBSETNATLANG)
| Set the language the server should use for messages.
#define | DBSETLNATLANG(x, y) dbsetlname((x), (y), DBSETNATLANG)
| Set the language the server should use for messages.
#define | dbsetlpacket(x, y) dbsetllong((x), (y), DBSETPACKET)
| Set the packet size in the login packet for new connections.
#define | DBSETLPACKET(x, y) dbsetllong((x), (y), DBSETPACKET)
| Set the packet size in the login packet for new connections.
#define | dbsetlpwd(x, y) dbsetlname((x), (y), DBSETPWD)
#define | DBSETLPWD(x, y) dbsetlname((x), (y), DBSETPWD)
| Set the password in the login packet.
#define | DBSETLSECURE(x) dbsetlbool((x), (1), DBSETBCP)
#define | dbsetluser(x, y) dbsetlname((x), (y), DBSETUSER)
#define | DBSETLUSER(x, y) dbsetlname((x), (y), DBSETUSER)
| Set the username in the login packet.
#define | DBSETLVERSION(login, version) dbsetlversion((login), (version))
| maps to the Microsoft (lower-case) function.
#define | DBSETNATLANG 7
#define | DBSETPACKET 11
#define | DBSETPWD 3
#define | DBSETTIME 34
#define | DBSETUSER 2
#define | DBSHOWPLAN 2
#define | DBSINGLE 0
#define | DBSTAT 10
#define | DBSTORPROCID 13
#define | DBTDS(a) dbtds(a)
| Sybase macro, maps to the internal (lower-case) function.
#define | DBTDS_2_0 1
#define | DBTDS_3_4 2
#define | DBTDS_4_0 3
#define | DBTDS_4_2 4
#define | DBTDS_4_6 5
#define | DBTDS_4_9_5 6
#define | DBTDS_5_0 7
#define | DBTDS_7_0 8
#define | DBTDS_7_1 9
#define | DBTDS_7_2 10
#define | DBTDS_8_0 9
#define | DBTDS_9_0 10
#define | DBTDS_UNKNOWN 0
| DBTDS_xxx are returned by DBTDS() The integer values of the constants are poorly chosen.
#define | DBTEXTLIMIT 7
#define | DBTEXTSIZE 17
#define | DBTIMEOUT 3
#define | DBTXPLEN 16
#define | DBTXTSLEN 8
#define | DBVER42 DBVERSION_42
#define | DBVER60 DBVERSION_70
#define | DBVERSION_100 2
#define | DBVERSION_42 3
#define | DBVERSION_46 1
#define | DBVERSION_70 4
#define | DBVERSION_71 5
#define | DBVERSION_72 6
#define | DBVERSION_80 DBVERSION_71
#define | DBVERSION_UNKNOWN 0
| DBVERSION_xxx are used with dbsetversion().
#define | DECIMALBIND 18
#define | FAIL 0
#define | FALSE 0
#define | FLT8BIND 9
#define | INT_CANCEL 2
#define | INT_CONTINUE 1
#define | INT_EXIT 0
#define | INT_TIMEOUT 3
#define | INTBIND 8
#define | MAXBINDTYPES 31
#define | MAXOPTTEXT 32
#define | MONEYBIND 13
#define | MORE_ROWS -1
#define | NO_MORE_RESULTS 2
#define | NO_MORE_ROWS -2
#define | NOSUCHOPTION 2
#define | NTBSTRINGBIND 2
#define | NUMERICBIND 17
#define | OFF 0
#define | ON 1
#define | REALBIND 10
#define | REG_ROW -1
#define | SMALLBIND 7
#define | SMALLDATETIMEBIND 12
#define | SMALLMONEYBIND 14
#define | STRINGBIND 1
#define | SUCCEED 1
#define | SYBAOPAVG 0x4f
#define | SYBAOPAVGU 0x50
#define | SYBAOPCHECKSUM_AGG 0x72
#define | SYBAOPCNT 0x4b
#define | SYBAOPCNT_BIG 0x09
#define | SYBAOPCNTU 0x4c
#define | SYBAOPMAX 0x52
#define | SYBAOPMIN 0x51
#define | SYBAOPSTDEV 0x30
#define | SYBAOPSTDEVP 0x31
#define | SYBAOPSUM 0x4d
#define | SYBAOPSUMU 0x4e
#define | SYBAOPVAR 0x32
#define | SYBAOPVARP 0x33
#define | SYBBINARY SYBBINARY
#define | SYBBIT SYBBIT
#define | SYBBITN SYBBITN
#define | SYBCHAR SYBCHAR
#define | SYBDATETIME SYBDATETIME
#define | SYBDATETIME4 SYBDATETIME4
#define | SYBDATETIMN SYBDATETIMN
#define | SYBDECIMAL SYBDECIMAL
#define | SYBEAAMT 20035
#define | SYBEABMT 20033
#define | SYBEABNC 20032
#define | SYBEABNP 20034
#define | SYBEABNV 20046
#define | SYBEACNV 20148
#define | SYBEADST 20128
#define | SYBEAICF 20127
#define | SYBEALTT 20129
#define | SYBEAOLF 20133
#define | SYBEAPCT 20130
#define | SYBEAPUT 20040
#define | SYBEARDI 20134
#define | SYBEARDL 20136
#define | SYBEASEC 20091
#define | SYBEASNL 20041
#define | SYBEASTF 20089
#define | SYBEASTL 20197
#define | SYBEASUL 20043
#define | SYBEATTNACK 20296
#define | SYBEAUTN 20062
#define | SYBEBADPK 20201
#define | SYBEBADTYPE 20254
#define | SYBEBBCI 20068
#define | SYBEBBFL 20297
#define | SYBEBBL 20215
#define | SYBEBCBC 20081
#define | SYBEBCBNPR 20230
#define | SYBEBCBNTYP 20231
#define | SYBEBCBPREF 20236
#define | SYBEBCFO 20082
#define | SYBEBCHLEN 20235
#define | SYBEBCIS 20075
#define | SYBEBCIT 20107
#define | SYBEBCITBLEN 20239
#define | SYBEBCITBNM 20238
#define | SYBEBCMTXT 20228
#define | SYBEBCNL 20105
#define | SYBEBCNN 20073
#define | SYBEBCNT 20064
#define | SYBEBCOR 20074
#define | SYBEBCPB 20078
#define | SYBEBCPCTYP 20233
#define | SYBEBCPI 20076
#define | SYBEBCPN 20077
#define | SYBEBCPOPT 20294
#define | SYBEBCPREC 20229
#define | SYBEBCPREF 20237
#define | SYBEBCRE 20070
#define | SYBEBCRO 20111
#define | SYBEBCSA 20108
#define | SYBEBCSET 20221
#define | SYBEBCSI 20106
#define | SYBEBCSNDROW 20240
#define | SYBEBCSNTYP 20232
#define | SYBEBCUC 20085
#define | SYBEBCUO 20084
#define | SYBEBCVH 20083
#define | SYBEBCVLEN 20234
#define | SYBEBCWE 20072
#define | SYBEBDIO 20063
#define | SYBEBEOF 20104
#define | SYBEBIHC 20103
#define | SYBEBIVI 20080
#define | SYBEBNCR 20024
#define | SYBEBNUM 20214
#define | SYBEBOOL 20293
#define | SYBEBPKS 20193
#define | SYBEBPREC 20216
#define | SYBEBPROBADDEF 20249
#define | SYBEBPROBADLEN 20251
#define | SYBEBPROBADPREC 20252
#define | SYBEBPROBADSCL 20253
#define | SYBEBPROBADTYP 20250
#define | SYBEBPROCOL 20241
#define | SYBEBPRODEF 20242
#define | SYBEBPRODEFID 20244
#define | SYBEBPRODEFTYP 20246
#define | SYBEBPROEXTDEF 20247
#define | SYBEBPROEXTRES 20248
#define | SYBEBPRONODEF 20245
#define | SYBEBPRONUMDEF 20243
#define | SYBEBRFF 20100
#define | SYBEBSCALE 20217
#define | SYBEBTMT 20095
#define | SYBEBTOK 20020
#define | SYBEBTYP 20023
#define | SYBEBTYPSRV 20220
#define | SYBEBUCE 20087
#define | SYBEBUCF 20099
#define | SYBEBUDF 20102
#define | SYBEBUFF 20147
#define | SYBEBUFL 20005
#define | SYBEBULKINSERT 20599
#define | SYBEBUOE 20086
#define | SYBEBUOF 20098
#define | SYBEBWEF 20088
#define | SYBEBWFF 20101
#define | SYBECAP 20203
#define | SYBECAPTYP 20213
#define | SYBECDNS 20031
#define | SYBECDOMAIN 20218
#define | SYBECINTERNAL 20219
#define | SYBECLOS 20056
#define | SYBECLOSEIN 20292
#define | SYBECLPR 20051
#define | SYBECNOR 20026
#define | SYBECNOV 20052
#define | SYBECOFL 20049
#define | SYBECONN 20009
#define | SYBECRNC 20116
#define | SYBECRSAGR 20263
#define | SYBECRSBROL 20266
#define | SYBECRSBSKEY 20268
#define | SYBECRSBUFR 20260
#define | SYBECRSDIS 20262
#define | SYBECRSFLAST 20265
#define | SYBECRSFRAND 20264
#define | SYBECRSFROWN 20267
#define | SYBECRSFTYPE 20280
#define | SYBECRSINV 20277
#define | SYBECRSINVALID 20281
#define | SYBECRSMROWS 20282
#define | SYBECRSNOBIND 20279
#define | SYBECRSNOCOUNT 20270
#define | SYBECRSNOFREE 20261
#define | SYBECRSNOIND 20256
#define | SYBECRSNOKEYS 20278
#define | SYBECRSNOLEN 20284
#define | SYBECRSNOPTCC 20285
#define | SYBECRSNORDER 20286
#define | SYBECRSNORES 20255
#define | SYBECRSNOTABLE 20287
#define | SYBECRSNOUPD 20276
#define | SYBECRSNOWHERE 20273
#define | SYBECRSNROWS 20283
#define | SYBECRSNUNIQUE 20288
#define | SYBECRSORD 20259
#define | SYBECRSRO 20269
#define | SYBECRSSET 20274
#define | SYBECRSTAB 20271
#define | SYBECRSUPDNB 20272
#define | SYBECRSUPDTAB 20275
#define | SYBECRSVAR 20289
#define | SYBECRSVIEW 20257
#define | SYBECRSVIIND 20258
#define | SYBECS 20299
#define | SYBECSYN 20050
#define | SYBECUFL 20048
#define | SYBECWLL 20123
#define | SYBEDBPS 20011
#define | SYBEDCL 20298
#define | SYBEDDNE 20047
#define | SYBEDIVZ 20196
#define | SYBEDNTI 20094
#define | SYBEDPOR 20149
#define | SYBEDVOR 20152
#define | SYBEECAN 20184
#define | SYBEECRT 20183
#define | SYBEEINI 20182
#define | SYBEEQVA 20059
#define | SYBEERRLABEL 20295
#define | SYBEESSL 20172
#define | SYBEETD 20164
#define | SYBEEUNR 20185
#define | SYBEEVOP 20178
#define | SYBEEVST 20181
#define | SYBEFCON 20002
#define | SYBEFENC 20222
#define | SYBEFGTL 20122
#define | SYBEFMODE 20167
#define | SYBEFRES 20223
#define | SYBEFSHD 20132
#define | SYBEFUNC 20204
#define | SYBEGENOS 20161
#define | SYBEICN 20038
#define | SYBEICONV2BIG 2404
#define | SYBEICONVAVAIL 2401
#define | SYBEICONVI 2403
#define | SYBEICONVIU 2400
#define | SYBEICONVO 2402
#define | SYBEIDCL 20143
#define | SYBEIDECCL 20227
#define | SYBEIFCL 20145
#define | SYBEIFNB 20065
#define | SYBEIICL 20025
#define | SYBEIMCL 20144
#define | SYBEINLN 20016
#define | SYBEINTF 20012
#define | SYBEINUMCL 20226
#define | SYBEIPV 20194
#define | SYBEISOI 20142
#define | SYBEISRVPREC 20224
#define | SYBEISRVSCL 20225
#define | SYBEITIM 20021
#define | SYBEIVERS 20206
#define | SYBEKBCI 20069
#define | SYBEKBCO 20067
#define | SYBELBLEN 20211
#define | SYBEMEM 20010
#define | SYBEMOV 20195
#define | SYBEMPLL 20112
#define | SYBEMVOR 20151
#define | SYBENBUF 20175
#define | SYBENBVP 20153
#define | SYBENDC 20150
#define | SYBENDTP 20155
#define | SYBENEG 20210
#define | SYBENEHA 20179
#define | SYBENHAN 20174
#define | SYBENLNL 20173
#define | SYBENMOB 20039
#define | SYBENOEV 20200
#define | SYBENOTI 20177
#define | SYBENOVALUE 20290
#define | SYBENPRM 20027
#define | SYBENSIP 20045
#define | SYBENTLL 20042
#define | SYBENTST 20170
#define | SYBENTTN 20093
#define | SYBENULL 20109
#define | SYBENULP 20176
#define | SYBENUM 20159
#define | SYBENXID 20036
#define | SYBEONCE 20207
#define | SYBEOOB 20022
#define | SYBEOPIN 20015
#define | SYBEOPNA 20121
#define | SYBEOPTNO 20163
#define | SYBEOREN 20141
#define | SYBEORPF 20096
#define | SYBEOSSL 20171
#define | SYBEPAGE 20162
#define | SYBEPOLL 20199
#define | SYBEPORT 2500
#define | SYBEPRTF 20191
#define | SYBEPWD 20014
#define | SYBERDCN 20053
#define | SYBERDNR 20044
#define | SYBEREAD 20004
#define | SYBERESP 20205
#define | SYBERFILE 20166
#define | SYBERPCS 20186
#define | SYBERPIL 20113
#define | SYBERPNA 20120
#define | SYBERPND 20019
#define | SYBERPNULL 20208
#define | SYBERPTXTIM 20209
#define | SYBERPUL 20114
#define | SYBERTCC 20117
#define | SYBERTSC 20118
#define | SYBERTYPE 20165
#define | SYBERXID 20037
#define | SYBESECURE 20202
#define | SYBESEFA 20198
#define | SYBESEOF 20017
#define | SYBESFOV 20054
#define | SYBESLCT 20168
#define | SYBESMSG 20018
#define | SYBESOCK 20008
#define | SYBESPID 20154
#define | SYBESYNC 20001
#define | SYBETDSVER 2410
#define | SYBETEXS 20188
#define | SYBETIME 20003
#define | SYBETMCF 20126
#define | SYBETMTD 20092
#define | SYBETPAR 20187
#define | SYBETPTN 20071
#define | SYBETRAC 20189
#define | SYBETRAN 20180
#define | SYBETRAS 20190
#define | SYBETRSN 20192
#define | SYBETSIT 20061
#define | SYBETTS 20066
#define | SYBETYPE 20160
#define | SYBEUACS 20090
#define | SYBEUAVE 20057
#define | SYBEUCPT 20125
#define | SYBEUCRR 20119
#define | SYBEUDTY 20060
#define | SYBEUFDS 20124
#define | SYBEUFDT 20029
#define | SYBEUHST 20013
#define | SYBEUMSG 20212
#define | SYBEUNAM 20110
#define | SYBEUNOP 20115
#define | SYBEUNT 20055
#define | SYBEURCI 20135
#define | SYBEUREI 20140
#define | SYBEUREM 20138
#define | SYBEURES 20139
#define | SYBEURMI 20137
#define | SYBEUSCT 20058
#define | SYBEUTDS 20146
#define | SYBEUVBF 20097
#define | SYBEUVDT 20028
#define | SYBEVDPT 20079
#define | SYBEVERDOWN 100
#define | SYBEVMS 20007
#define | SYBEVOIDRET 20291
#define | SYBEWAID 20030
#define | SYBEWRIT 20006
#define | SYBEXOCI 20131
#define | SYBEXTDN 20157
#define | SYBEXTN 20156
#define | SYBEXTSN 20158
#define | SYBEZTXT 20169
#define | SYBFLT8 SYBFLT8
#define | SYBFLTN SYBFLTN
#define | SYBIMAGE SYBIMAGE
#define | SYBINT1 SYBINT1
#define | SYBINT2 SYBINT2
#define | SYBINT4 SYBINT4
#define | SYBINT8 SYBINT8
#define | SYBINTN SYBINTN
#define | SYBMONEY SYBMONEY
#define | SYBMONEY4 SYBMONEY4
#define | SYBMONEYN SYBMONEYN
#define | SYBNTEXT SYBNTEXT
#define | SYBNUMERIC SYBNUMERIC
#define | SYBNVARCHAR SYBNVARCHAR
#define | SYBREAL SYBREAL
#define | SYBTEXT SYBTEXT
#define | SYBVARBINARY SYBVARBINARY
#define | SYBVARCHAR SYBVARCHAR
#define | SYBVOID SYBVOID
#define | TDS_STATIC_CAST(type, a) ((type)(a))
#define | TINYBIND 6
#define | TRUE 1
#define | VARYBINBIND 4
#define | VARYCHARBIND 3

## Typedefs

typedef int | BOOL
typedef unsigned char | BYTE
typedef DBWAITFUNC(* | DB_DBBUSY_FUNC )(void *dbproc)
typedef int(* | DB_DBCHKINTR_FUNC )(void *dbproc)
typedef int(* | DB_DBHNDLINTR_FUNC )(void *dbproc)
typedef void(* | DB_DBIDLE_FUNC )(DBWAITFUNC dfunc, void *dbproc)
typedef tds_sysdep_int64_type | DBBIGINT
typedef unsigned char | DBBINARY
typedef unsigned char | DBBIT
typedef unsigned char | DBBOOL
typedef char | DBCHAR
typedef void | DBCURSOR
typedef struct tds_sybase_dbdaterec | DBDATEREC
typedef DBNUMERIC | DBDECIMAL
typedef tds_sysdep_real64_type | DBFLT8
typedef tds_sysdep_int32_type | DBINT
typedef void | DBLOGINFO
typedef struct tds_dblib_dbprocess | DBPROCESS
typedef tds_sysdep_real32_type | DBREAL
typedef tds_sysdep_int16_type | DBSMALLINT
typedef void | DBSORTORDER
typedef struct dbstring | DBSTRING
typedef unsigned char | DBTINYINT
typedef struct dbtypeinfo | DBTYPEINFO
typedef unsigned tds_sysdep_int16_type | DBUSMALLINT
typedef void * | DBVOIDPTR
typedef int(* | DBWAITFUNC )(void)
typedef void | DBXLATE
typedef int(* | EHANDLEFUNC )(DBPROCESS *dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr)
typedef int(* | INTFUNCPTR )(void *,...)
typedef struct tds_dblib_loginrec | LOGINREC
typedef int(* | MHANDLEFUNC )(DBPROCESS *dbproc, DBINT msgno, int msgstate, int severity, char *msgtext, char *srvname, char *proc, int line)
typedef int | RETCODE
typedef short | SHORT
typedef int | STATUS
typedef unsigned short | USHORT

## Enumerations

enum | { SYBCHAR = 47, SYBCHAR = 47 }
enum | { MAXCOLNAMELEN = 512 }
enum | CI_TYPE { CI_REGULAR = 1, CI_ALTERNATE = 2, CI_CURSOR = 3 }

## Functions

RETCODE | bcp_batch (DBPROCESS *dbproc)
| Commit a set of rows to the table.
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.
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.
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 numeric and decimal columns.
RETCODE | bcp_collen (DBPROCESS *dbproc, DBINT varlen, int table_column)
| Set the length of a host variable to be written to a table.
RETCODE | bcp_colptr (DBPROCESS *dbproc, BYTE *colptr, int table_column)
| Override bcp_bind() by pointing to a different host variable.
RETCODE | bcp_columns (DBPROCESS *dbproc, int host_colcount)
| Indicate how many columns are to be found in the datafile.
RETCODE | bcp_control (DBPROCESS *dbproc, int field, DBINT value)
| Set BCP options for uploading a datafile.
RETCODE | bcp_done (DBPROCESS *dbproc)
| Conclude the transfer of data from program variables.
RETCODE | bcp_exec (DBPROCESS *dbproc, DBINT *rows_copied)
| Write a datafile to a table.
int | bcp_getbatchsize (DBPROCESS *dbproc)
DBBOOL | bcp_getl (LOGINREC *login)
| See if BCP_SETL() was used to set the LOGINREC for BCP work.
RETCODE | bcp_init (DBPROCESS *dbproc, const char *tblname, const char *hfile, const char *errfile, int direction)
| Prepare for bulk copy operation on a table.
RETCODE | bcp_options (DBPROCESS *dbproc, int option, BYTE *value, int valuelen)
| Set "hints" for uploading a file.
RETCODE | bcp_readfmt (DBPROCESS *dbproc, const char filename[])
| Read a format definition file.
RETCODE | bcp_sendrow (DBPROCESS *dbproc)
| Write data in host variables to the table.
BYTE * | dbadata (DBPROCESS *dbproc, int computeid, int column)
| Get address of compute column data.
DBINT | dbadlen (DBPROCESS *dbproc, int computeid, int column)
| Get size of data in a compute column.
RETCODE | dbaltbind (DBPROCESS *dbprocess, int computeid, int column, int vartype, DBINT varlen, BYTE *varaddr)
| Bind a compute column to a program variable.
RETCODE | dbaltbind_ps (DBPROCESS *dbprocess, int computeid, int column, int vartype, DBINT varlen, BYTE *varaddr, DBTYPEINFO *typeinfo)
int | dbaltcolid (DBPROCESS *dbproc, int computeid, int column)
| Get column ID of a compute column.
RETCODE | dbaltlen (DBPROCESS *dbproc, int computeid, int column)
| Get size of data in compute column.
int | dbaltop (DBPROCESS *dbproc, int computeid, int column)
| Get aggregation operator for a compute column.
int | dbalttype (DBPROCESS *dbproc, int computeid, int column)
| Get datatype for a compute column.
RETCODE | dbaltutype (DBPROCESS *dbproc, int computeid, int column)
| Get user-defined datatype of a compute column.
RETCODE | dbanullbind (DBPROCESS *dbprocess, int computeid, int column, DBINT *indicator)
| Tie a null-indicator to a compute result column.
RETCODE | dbbind (DBPROCESS *dbproc, int column, int vartype, DBINT varlen, BYTE *varaddr)
| Tie a host variable to a resultset column.
RETCODE | dbbind_ps (DBPROCESS *dbprocess, int column, int vartype, DBINT varlen, BYTE *varaddr, DBTYPEINFO *typeinfo)
int | dbbufsize (DBPROCESS *dbprocess)
BYTE * | dbbylist (DBPROCESS *dbproc, int computeid, int *size)
| Get `bylist` for a compute row.
RETCODE | dbcancel (DBPROCESS *dbproc)
| Cancel the current command batch.
RETCODE | dbcanquery (DBPROCESS *dbproc)
| Cancel the query currently being retrieved, discarding all pending rows.
char * | dbchange (DBPROCESS *dbprocess)
| See if a command caused the current database to change.
DBBOOL | dbcharsetconv (DBPROCESS *dbprocess)
void | dbclose (DBPROCESS *dbproc)
| Close a connection to the server and free associated resources.
void | dbclrbuf (DBPROCESS *dbproc, DBINT n)
| Clear n rows from the row buffer.
RETCODE | dbclropt (DBPROCESS *dbproc, int option, const char param[])
| Reset an option.
RETCODE | dbcmd (DBPROCESS *dbproc, const char cmdstring[])
| `Append` SQL to the command buffer.
RETCODE | dbcmdrow (DBPROCESS *dbproc)
| See if the current command can return rows.
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).
DBINT | dbcollen (DBPROCESS *dbproc, int column)
| Get size of a regular result column.
char * | dbcolname (DBPROCESS *dbproc, int column)
| Return name of a regular result column.
char * | dbcolsource (DBPROCESS *dbproc, int colnum)
| Get base database column name for a result set column.
int | dbcoltype (DBPROCESS *dbproc, int column)
| Get the datatype of a regular result set column.
DBTYPEINFO * | dbcoltypeinfo (DBPROCESS *dbproc, int column)
| Get precision and scale information for a regular result column.
DBINT | dbcolutype (DBPROCESS *dbprocess, int column)
| Get user-defined datatype of a regular result column.
DBINT | dbconvert (DBPROCESS *dbproc, int srctype, const BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen)
| Convert one datatype to another.
DBINT | dbconvert_ps (DBPROCESS *dbprocess, int srctype, BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen, DBTYPEINFO *typeinfo)
| cf.
DBINT | dbcount (DBPROCESS *dbproc)
| Get count of rows processed.
int | dbcurcmd (DBPROCESS *dbproc)
| Get number of the row just returned.
DBINT | dbcurrow (DBPROCESS *dbproc)
| Get number of the row currently being read.
BYTE * | dbdata (DBPROCESS *dbproc, int column)
| Get address of data in a regular result column.
RETCODE | dbdatecmp (DBPROCESS *dbproc, DBDATETIME *d1, DBDATETIME *d2)
| Compare DBDATETIME values, similar to strcmp(3).
RETCODE | dbdatecrack (DBPROCESS *dbproc, DBDATEREC *di, DBDATETIME *dt)
| Break a DBDATETIME value into useful pieces.
DBINT | dbdatlen (DBPROCESS *dbproc, int column)
| Get size of current row's data in a regular result column.
DBBOOL | dbdead (DBPROCESS *dbproc)
| Check if dbproc is an ex-parrot.
EHANDLEFUNC | dberrhandle (EHANDLEFUNC handler)
| Set an error handler, for messages from db-lib.
void | dbexit (void)
| Close server connections and free all related structures.
RETCODE | dbfcmd (DBPROCESS *dbproc, const char *fmt,...)
| `printf-like` way to form SQL to send to the server.
DBINT | dbfirstrow (DBPROCESS *dbproc)
| See if a server response has arrived.
void | dbfreebuf (DBPROCESS *dbproc)
| Erase the command buffer, in case `DBNOAUTOFREE` was set with dbsetopt().
char * | dbgetchar (DBPROCESS *dbprocess, int n)
| Get address of a position in the command buffer.
char * | dbgetcharset (DBPROCESS *dbprocess)
int | dbgetlusername (LOGINREC *login, BYTE *name_buffer, int buffer_len)
int | dbgetmaxprocs (void)
| get maximum simultaneous connections db-lib will open to the server.
char * | dbgetnatlanf (DBPROCESS *dbprocess)
int | dbgetpacket (DBPROCESS *dbproc)
| Get TDS packet size for the connection.
RETCODE | dbgetrow (DBPROCESS *dbproc, DBINT row)
| Read a row from the row buffer.
int | dbgettime (void)
| Get maximum seconds db-lib waits for a server response to query.
BYTE * | dbgetuserdata (DBPROCESS *dbproc)
| Get address of user-allocated data from a `DBPROCESS`.
DBBOOL | dbhasretstat (DBPROCESS *dbproc)
| Determine if query generated a return status number.
RETCODE | dbinit (void)
| Initialize db-lib.
int | dbiordesc (DBPROCESS *dbproc)
| Get file descriptor of the socket used by a `DBPROCESS` to read data coming from the server. (!).
int | dbiowdesc (DBPROCESS *dbproc)
| Get file descriptor of the socket used by a `DBPROCESS` to write data coming to the server. (!).
DBBOOL | dbisavail (DBPROCESS *dbprocess)
BOOL | dbiscount (DBPROCESS *dbproc)
| Indicates whether or not the count returned by dbcount is real (Microsoft-compatibility feature).
DBBOOL | dbisopt (DBPROCESS *dbproc, int option, const char param[])
| Get value of an option.
DBINT | dblastrow (DBPROCESS *dbproc)
| Get number of the last row in the row buffer.
LOGINREC * | dblogin (void)
| Allocate a `LOGINREC` structure.
void | dbloginfree (LOGINREC *login)
| free the `LOGINREC`
RETCODE | dbmny4add (DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *sum)
| Add two DBMONEY4 values.
int | dbmny4cmp (DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2)
| Compare two DBMONEY4 values.
RETCODE | dbmny4copy (DBPROCESS *dbprocess, DBMONEY4 *m1, DBMONEY4 *m2)
| Copy a DBMONEY4 value.
RETCODE | dbmny4minus (DBPROCESS *dbproc, DBMONEY4 *src, DBMONEY4 *dest)
| Negate a DBMONEY4 value.
RETCODE | dbmny4sub (DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *diff)
| Subtract two DBMONEY4 values.
RETCODE | dbmny4zero (DBPROCESS *dbproc, DBMONEY4 *dest)
| Zero a DBMONEY4 value.
int | dbmnycmp (DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2)
| Compare two DBMONEY values.
RETCODE | dbmnycopy (DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
| Copy a DBMONEY value.
RETCODE | dbmnydec (DBPROCESS *dbproc, DBMONEY *mnyptr)
| Subtract $0.0001 from a DBMONEY value.
RETCODE | dbmnyinc (DBPROCESS *dbproc, DBMONEY *mnyptr)
| Add $0.0001 to a DBMONEY value.
RETCODE | dbmnymaxneg (DBPROCESS *dbproc, DBMONEY *dest)
| Get maximum negative DBMONEY value supported.
RETCODE | dbmnymaxpos (DBPROCESS *dbproc, DBMONEY *dest)
| Get maximum positive DBMONEY value supported.
RETCODE | dbmnyminus (DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
| Negate a DBMONEY value.
RETCODE | dbmnysub (DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2, DBMONEY *diff)
RETCODE | dbmnyzero (DBPROCESS *dbproc, DBMONEY *dest)
| Set a DBMONEY value to zero.
const char * | dbmonthname (DBPROCESS *dbproc, char *language, int monthnum, DBBOOL shortform)
| Get name of a month, in some human language.
RETCODE | dbmorecmds (DBPROCESS *dbproc)
| See if more commands are to be processed.
RETCODE | dbmoretext (DBPROCESS *dbproc, DBINT size, const BYTE text[])
| Send chunk of a text/image value to the server.
MHANDLEFUNC | dbmsghandle (MHANDLEFUNC handler)
| Set a message handler, for messages from the server.
char * | dbname (DBPROCESS *dbproc)
| Get name of current database.
RETCODE | dbnextrow (DBPROCESS *dbproc)
| Read result row into the row buffer and into any bound host variables.
RETCODE | dbnullbind (DBPROCESS *dbproc, int column, DBINT *indicator)
| Tie a null-indicator to a regular result column.
int | dbnumalts (DBPROCESS *dbproc, int computeid)
| Get count of columns in a compute row.
int | dbnumcols (DBPROCESS *dbproc)
| Return number of regular columns in a result set.
int | dbnumcompute (DBPROCESS *dbprocess)
| Get count of `COMPUTE` clauses for a result set.
int | dbnumrets (DBPROCESS *dbproc)
| Get count of output parameters filled by a stored procedure.
DBPROCESS * | dbopen (LOGINREC *login, const char *server)
| Normally not used.
void | dbprhead (DBPROCESS *dbproc)
| Print result set headings to stdout.
RETCODE | dbprrow (DBPROCESS *dbproc)
| Print a result set to stdout.
const char * | dbprtype (int token)
| Print a token value's name to a buffer.
STATUS | dbreadtext (DBPROCESS *dbproc, void *buf, DBINT bufsize)
| Fetch part of a text or image value from the server.
void | dbrecftos (const char filename[])
| Record to a file all SQL commands sent to the server.
RETCODE | dbresults (DBPROCESS *dbproc)
| Set up query results.
RETCODE | dbresults_r (DBPROCESS *dbproc, int recursive)
BYTE * | dbretdata (DBPROCESS *dbproc, int retnum)
| Get value of an output parameter filled by a stored procedure.
int | dbretlen (DBPROCESS *dbproc, int retnum)
| Get size of an output parameter filled by a stored procedure.
char * | dbretname (DBPROCESS *dbproc, int retnum)
| Get name of an output parameter filled by a stored procedure.
DBINT | dbretstatus (DBPROCESS *dbproc)
| Fetch status value returned by query or remote procedure call.
int | dbrettype (DBPROCESS *dbproc, int retnum)
| Get datatype of a stored procedure's return parameter.
RETCODE | dbrows (DBPROCESS *dbproc)
| Indicate whether a query returned rows.
STATUS | dbrowtype (DBPROCESS *dbprocess)
| Get returned row's type.
RETCODE | dbrpcinit (DBPROCESS *dbproc, const char rpcname[], DBSMALLINT options)
| Initialize a remote procedure call.
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.
RETCODE | dbrpcsend (DBPROCESS *dbproc)
| Execute the procedure and free associated memory.
RETCODE | dbsafestr (DBPROCESS *dbproc, const char *src, DBINT srclen, char *dest, DBINT destlen, int quotetype)
| safely quotes character values in SQL text.
RETCODE * | dbsechandle (DBINT type, INTFUNCPTR handler)
char * | dbservcharset (DBPROCESS *dbprocess)
| Get `syscharset` name of the server character set.
void | dbsetavail (DBPROCESS *dbprocess)
| Mark a `DBPROCESS` as "available".
void | dbsetbusy (DBPROCESS *dbprocess, DB_DBBUSY_FUNC busyfunc)
RETCODE | dbsetdefcharset (char *charset)
void | dbsetidle (DBPROCESS *dbprocess, DB_DBIDLE_FUNC idlefunc)
void | dbsetifile (char *filename)
| set name and location of the `interfaces` file FreeTDS should use to look up a servername.
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.
RETCODE | dbsetlbool (LOGINREC *login, int value, int which)
| Set a boolean value in a `LOGINREC` structure.
RETCODE | dbsetllong (LOGINREC *login, long value, int which)
| Set an integer value in a `LOGINREC` structure.
RETCODE | dbsetlname (LOGINREC *login, const char *value, int which)
| Set the value of a string in a `LOGINREC` structure.
RETCODE | dbsetlogintime (int seconds)
| Set maximum seconds db-lib waits for a server response to a login attempt.
RETCODE | dbsetlversion (LOGINREC *login, BYTE version)
| Set TDS version for future connections.
RETCODE | dbsetmaxprocs (int maxprocs)
| Set maximum simultaneous connections db-lib will open to the server.
RETCODE | dbsetnull (DBPROCESS *dbprocess, int bindtype, int bindlen, BYTE *bindval)
| Define substitution values to be used when binding null values.
RETCODE | dbsetopt (DBPROCESS *dbproc, int option, const char *char_param, int int_param)
| Set db-lib or server option.
STATUS | dbsetrow (DBPROCESS *dbprocess, DBINT row)
| Make a buffered row "current" without fetching it into bound variables.
RETCODE | dbsettime (int seconds)
| Set maximum seconds db-lib waits for a server response to query.
void | dbsetuserdata (DBPROCESS *dbproc, BYTE *ptr)
| Associate client-allocated (and defined) data with a `DBPROCESS`.
RETCODE | dbsetversion (DBINT version)
| Specify a db-lib version level.
int | dbspid (DBPROCESS *dbproc)
| Get server process ID for a `DBPROCESS`.
RETCODE | dbspr1row (DBPROCESS *dbproc, char *buffer, DBINT buf_len)
| Print a regular result row to a buffer.
DBINT | dbspr1rowlen (DBPROCESS *dbproc)
| Determine size buffer required to hold the results returned by dbsprhead(), dbsprline(), and dbspr1row().
RETCODE | dbsprhead (DBPROCESS *dbproc, char *buffer, DBINT buf_len)
| Print result set headings to a buffer.
RETCODE | dbsprline (DBPROCESS *dbproc, char *buffer, DBINT buf_len, DBCHAR line_char)
| Get formatted string for underlining dbsprhead() column names.
RETCODE | dbsqlexec (DBPROCESS *dbproc)
| send the SQL command to the server and wait for an answer.
RETCODE | dbsqlok (DBPROCESS *dbproc)
| Wait for results of a query from the server.
RETCODE | dbsqlsend (DBPROCESS *dbproc)
| Transmit the command buffer to the server.
int | dbstrbuild (DBPROCESS *dbproc, char *charbuf, int bufsize, char *text, char *formats,...)
| Build a printable string from text containing placeholders for variables.
RETCODE | dbstrcpy (DBPROCESS *dbproc, int start, int numbytes, char *dest)
| Get a copy of a chunk of the command buffer.
int | dbstrlen (DBPROCESS *dbproc)
| Get size of the command buffer, in bytes.
RETCODE | dbtablecolinfo (DBPROCESS *dbproc, DBINT column, DBCOL *pdbcol)
| describe table column attributes with a single call (Freetds-only API function modelled on dbcolinfo)
int | dbtds (DBPROCESS *dbprocess)
| Get the TDS version in use for dbproc.
DBINT | dbtextsize (DBPROCESS *dbprocess)
DBBINARY * | dbtxptr (DBPROCESS *dbproc, int column)
| Get text pointer for a column in the current row.
DBBINARY * | dbtxtimestamp (DBPROCESS *dbproc, int column)
| Get text timestamp for a column in the current row.
DBBINARY * | dbtxtsnewval (DBPROCESS *dbprocess)
RETCODE | dbtxtsput (DBPROCESS *dbprocess, DBBINARY newtxts, int colnum)
RETCODE | dbuse (DBPROCESS *dbproc, const char *name)
| Change current database.
DBINT | dbvarylen (DBPROCESS *dbproc, int column)
| Determine whether a column can vary in size.
const char * | dbversion (void)
| See which version of db-lib is in use.
DBBOOL | dbwillconvert (int srctype, int desttype)
| Test whether or not a datatype can be converted to another datatype.
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.
DBBOOL | DRBUF (DBPROCESS *dbprocess)
DBPROCESS * | tdsdbopen (LOGINREC *login, const char *server, int msdblib)
| Form a connection with the server.

## Variables

static const void *const | no_unused_sybdb_h_warn [] = { rcsid_sybdb_h, no_unused_sybdb_h_warn }
static const char | rcsid_sybdb_h [] = "$Id: sybdb.h,v 1.100.2.1 2011-06-06 12:31:45 freddy77 Exp $"

## Detailed Description

Primary include file for db-lib applications.

Declares macros, functions, enumerated types, and defined tokens used by the db-lib API.

## Function Documentation

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).

Parameters:

  | dbproc | contains all information needed by db-lib to manage communications with the server.
  | type | must be CI_REGULAR or CI_ALTERNATE (CI_CURSOR is defined by the vendor, but is not yet implemented).
  | column | Nth in the result set, starting from 1.
  | computeid | (ignored)
  | pdbcol | address of structure to be populated by this function.

Returns:
  SUCCEED or FAIL.

See also:
  dbcolbrowse(), dbqual(), dbtabbrowse(), dbtabcount(), dbtabname(), dbtabsource(), dbtsnewlen(), dbtsnewval(), dbtsput().

Todo:
  Support cursor rows.

DBPROCESS* dbopen | ( | LOGINREC * | login,
|  | const char * | server |
| ) |  |  |

Normally not used.

The function is linked in only if the --enable-sybase-compat configure option is used. Cf. sybdb.h dbopen() macros, and dbdatecrack().

All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines