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;
dbopen
DBPROCESS * dbopen(LOGINREC *login, const char *server)
Normally not used.
Definition: dbopen.c:36
dbmsghandle
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition: dblib.c:5121
tds.h
dbsqlexec
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition: dblib.c:1401
dbfcmd
RETCODE dbfcmd(DBPROCESS *dbproc, const char *fmt,...)
printf-like way to form SQL to send to the server.
Definition: dblib.c:1316
tds_dblib_dbprocess
Definition: dblib.h:120
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:164
dbcmd
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
Definition: dblib.c:1355
bcp_readfmt
RETCODE bcp_readfmt(DBPROCESS *dbproc, const char filename[])
Read a format definition file.
Definition: bcp.c:1625
sybdb.h
Primary include file for db-lib applications.
dberrhandle
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition: dblib.c:5102
dbcoltype
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition: dblib.c:2951
bcp_control
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition: bcp.c:539
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:372
dbinit
RETCODE dbinit(void)
Initialize db-lib.
Definition: dblib.c:665
bcp_options
RETCODE bcp_options(DBPROCESS *dbproc, int option, BYTE *value, int valuelen)
Set "hints" for uploading a file. A FreeTDS-only function.
Definition: bcp.c:613
dbresults
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition: dblib.c:1675
bcp_columns
RETCODE bcp_columns(DBPROCESS *dbproc, int host_colcount)
Indicate how many columns are to be found in the datafile.
Definition: bcp.c:296
dbnumcols
int dbnumcols(DBPROCESS *dbproc)
Return number of regular columns in a result set.
Definition: dblib.c:1829
pd
Definition: datacopy.c:61
dbloginfree
void dbloginfree(LOGINREC *login)
free the LOGINREC
Definition: dblib.c:742
dblogin
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition: dblib.c:710
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_exec
RETCODE bcp_exec(DBPROCESS *dbproc, DBINT *rows_copied)
Write a datafile to a table.
Definition: bcp.c:1564
LOGINREC
Definition: bsqlodbc.c:99
dbsetifile
void dbsetifile(char *filename)
set name and location of the interfaces file FreeTDS should use to look up a servername.
Definition: dblib.c:2692