freebcp.h
enum states
{
GET_NEXTARG,
GET_MAXERRORS,
GET_FORMATFILE,
GET_ERRORFILE,
GET_FIRSTROW,
GET_LASTROW,
GET_BATCHSIZE,
GET_FIELDTERM,
GET_ROWTERM,
GET_USER,
GET_PASS,
GET_INTERFACESFILE,
GET_SERVER,
GET_DISPLAYCHARSET,
GET_DATAFILECHARSET,
GET_LANGUAGE,
GET_PACKETSIZE,
GET_CLIENTCHARSET,
GET_TEXTSIZE,
GET_SYBASEDIR,
GET_FROMLABEL,
GET_TOLABEL,
GET_HINT
};
typedef struct pd
{
char *dbobject;
char dbdirection[10];
DBINT direction;
char *hostfilename;
char *formatfile;
char *errorfile;
char *interfacesfile;
int firstrow;
int lastrow;
int batchsize;
int maxerrors;
int textsize;
char *fieldterm;
int fieldtermlen;
char *rowterm;
int rowtermlen;
char *user;
char *pass;
char *server;
char *dbname;
char *hint;
char *options;
char *charset;
int packetsize;
int mflag;
int fflag;
int eflag;
int Fflag;
int Lflag;
int bflag;
int nflag;
int cflag;
int tflag;
int rflag;
int Uflag;
int Iflag;
int Sflag;
int Pflag;
int Tflag;
int Aflag;
int Eflag;
char *inputfile;
char *outputfile;
}
BCPPARAMDATA;
pd
Definition: datacopy.c:62
bcp_readfmt
RETCODE bcp_readfmt(DBPROCESS *dbproc, const char filename[])
Read a format definition file.
Definition: bcp.c:1678
dbsetifile
void dbsetifile(char *filename)
set name and location of the interfaces file FreeTDS should use to look up a servername.
Definition: dblib.c:2711
tds.h
Main include file for libtds.
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
DBSETLCHARSET
#define DBSETLCHARSET(x, y)
Set the client character set in the login packet.
Definition: sybdb.h:1276
DBSETLPACKET
#define DBSETLPACKET(x, y)
Set the packet size in the login packet for new connections.
Definition: sybdb.h:1278
LOGINREC
Definition: bsqlodbc.c:100
DBSETLUSER
#define DBSETLUSER(x, y)
Set the username in the login packet.
Definition: sybdb.h:1251
dberrhandle
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition: dblib.c:5121
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
dbresults
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition: dblib.c:1694
bcp_control
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
Definition: bcp.c:544
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
BCP_SETL
#define BCP_SETL(x, y)
Enable (or prevent) bcp operations for connections made with a login.
Definition: sybdb.h:1264
dbcmd
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
Definition: dblib.c:1373
dbopen
DBPROCESS * dbopen(LOGINREC *login, const char *server)
Normally not used.
Definition: dbopen.c:36
dbcoltype
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition: dblib.c:2970
dbmsghandle
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition: dblib.c:5140
dbinit
RETCODE dbinit(void)
Initialize db-lib.
Definition: dblib.c:660
dbsqlexec
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition: dblib.c:1419
sybdb.h
Primary include file for db-lib applications.
tdsdump_open
int tdsdump_open(const char *filename)
Create and truncate a human readable dump file for the TDS traffic.
Definition: log.c:131
dbfcmd
RETCODE dbfcmd(DBPROCESS *dbproc, const char *fmt,...)
printf-like way to form SQL to send to the server.
Definition: dblib.c:1334
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:1254
dbloginfree
void dbloginfree(LOGINREC *login)
free the LOGINREC
Definition: dblib.c:737
bcp_exec
RETCODE bcp_exec(DBPROCESS *dbproc, DBINT *rows_copied)
Write a datafile to a table.
Definition: bcp.c:1617
tds_dblib_dbprocess
Definition: dblib.h:123
dbnumcols
int dbnumcols(DBPROCESS *dbproc)
Return number of regular columns in a result set.
Definition: dblib.c:1848
DBSETLAPP
#define DBSETLAPP(x, y)
Set the (client) application name in the login packet.
Definition: sybdb.h:1261
dblogin
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition: dblib.c:705