FreeTDS API

freebcp.h
1 enum states
2 {
3 GET_NEXTARG,
4 GET_MAXERRORS,
5 GET_FORMATFILE,
6 GET_ERRORFILE,
7 GET_FIRSTROW,
8 GET_LASTROW,
9 GET_BATCHSIZE,
10 GET_FIELDTERM,
11 GET_ROWTERM,
12 GET_USER,
13 GET_PASS,
14 GET_INTERFACESFILE,
15 GET_SERVER,
16 GET_DISPLAYCHARSET,
17 GET_DATAFILECHARSET,
18 GET_LANGUAGE,
19 GET_PACKETSIZE,
20 GET_CLIENTCHARSET,
21 GET_TEXTSIZE,
22 GET_SYBASEDIR,
23 GET_FROMLABEL,
24 GET_TOLABEL,
25 GET_HINT
26 };
27
28 typedef struct pd
29 {
30 char *dbobject;
31 char dbdirection[10];
32 DBINT direction;
33 char *hostfilename;
34 char *formatfile;
35 char *errorfile;
36 char *interfacesfile;
37 int firstrow;
38 int lastrow;
39 int batchsize;
40 int maxerrors;
41 int textsize;
42 char *fieldterm;
43 int fieldtermlen;
44 char *rowterm;
45 int rowtermlen;
46 char *user;
47 char *pass;
48 char *server;
49 char *dbname;
50 char *hint;
51 char *options;
52 char *charset;
53 int packetsize;
54 int mflag;
55 int fflag;
56 int eflag;
57 int Fflag;
58 int Lflag;
59 int bflag;
60 int nflag;
61 int cflag;
62 int tflag;
63 int rflag;
64 int Uflag;
65 int Iflag;
66 int Sflag;
67 int Pflag;
68 int Tflag;
69 int Aflag;
70 int Eflag;
71 char *inputfile;
72 char *outputfile;
73 }
74 BCPPARAMDATA;
dbsqlexec
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition: dblib.c:1424
sybdb.h
Primary include file for db-lib applications.
dbnumcols
int dbnumcols(DBPROCESS *dbproc)
Return number of regular columns in a result set.
Definition: dblib.c:1852
dbcmd
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
Definition: dblib.c:1378
tds.h
Main include file for libtds.
dbopen
DBPROCESS * dbopen(LOGINREC *login, const char *server)
Normally not used.
Definition: dbopen.c:36
tdsdump_open
int tdsdump_open(const char *filename)
Create and truncate a human readable dump file for the TDS traffic.
Definition: log.c:112
bcp_options
RETCODE bcp_options(DBPROCESS *dbproc, int option, BYTE *value, int valuelen)
Set "hints" for uploading a file.
Definition: bcp.c:622
DBSETLPWD
#define DBSETLPWD(x, y)
Set the password in the login packet.
Definition: sybdb.h:1253
dbmsghandle
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition: dblib.c:5144
bcp_init
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:167
dbsetifile
void dbsetifile(char *filename)
set name and location of the interfaces file FreeTDS should use to look up a servername.
Definition: dblib.c:2715
dbinit
RETCODE dbinit(void)
Initialize db-lib.
Definition: dblib.c:665
bcp_colfmt
RETCODE bcp_colfmt(DBPROCESS *dbproc, int host_colnum, int host_type, int host_prefixlen, DBINT host_collen, const BYTE *host_term, int host_termlen, int table_colnum)
Specify the format of a datafile prior to writing to a table.
Definition: bcp.c:377
DBSETLAPP
#define DBSETLAPP(x, y)
Set the (client) application name in the login packet.
Definition: sybdb.h:1260
DBSETLCHARSET
#define DBSETLCHARSET(x, y)
Set the client character set in the login packet.
Definition: sybdb.h:1275
dbloginfree
void dbloginfree(LOGINREC *login)
free the LOGINREC
Definition: dblib.c:742
dberrhandle
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition: dblib.c:5125
tds_dblib_dbprocess
Definition: dblib.h:123
dbresults
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition: dblib.c:1698
dblogin
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition: dblib.c:710
bcp_readfmt
RETCODE bcp_readfmt(DBPROCESS *dbproc, const char filename[])
Read a format definition file.
Definition: bcp.c:1679
pd
Definition: datacopy.c:62
bcp_control
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition: bcp.c:544
dbcoltype
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition: dblib.c:2974
bcp_exec
RETCODE bcp_exec(DBPROCESS *dbproc, DBINT *rows_copied)
Write a datafile to a table.
Definition: bcp.c:1618
DBSETLUSER
#define DBSETLUSER(x, y)
Set the username in the login packet.
Definition: sybdb.h:1250
bcp_columns
RETCODE bcp_columns(DBPROCESS *dbproc, int host_colcount)
Indicate how many columns are to be found in the datafile.
Definition: bcp.c:301
BCP_SETL
#define BCP_SETL(x, y)
Enable (or prevent) bcp operations for connections made with a login.
Definition: sybdb.h:1263
DBSETLPACKET
#define DBSETLPACKET(x, y)
Set the packet size in the login packet for new connections.
Definition: sybdb.h:1277
dbfcmd
RETCODE dbfcmd(DBPROCESS *dbproc, const char *fmt,...)
printf-like way to form SQL to send to the server.
Definition: dblib.c:1339
LOGINREC
Definition: bsqlodbc.c:100