%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/freetds/usr/share/man/man1/
Upload File :
Create Path :
Current File : //opt/alt/freetds/usr/share/man/man1/freebcp.1

." Text automatically generated by txt2man-1.4.7
.TH FreeTDS  "November 22, 2012" "0.91.81" "FreeTDS Utilities"
.SH NAME
\fBfreebcp \fP- bulk loading utility for Sybase and Microsoft databases
.SH SYNOPSIS
.nf
.fam C
\fBfreebcp\fP [[database.]owner.]object_name {in | [query]out} \fIdatafile\fP 
{ \fB-c\fP | \fB-n\fP | \fB-f\fP \fIformatfile\fP }
[\fB-b\fP \fIbatchsize\fP] [\fB-F\fP \fIfirstrow\fP] [\fB-L\fP \fIlastrow\fP] [\fB-e\fP \fIerrfile\fP] 
[\fB-I\fP \fIinterfaces\fP] [\fB-m\fP \fImaxerrors\fP] [\fB-t\fP \fIfield_term\fP] [\fB-r\fP \fIrow_term\fP] 
[\fB-h\fP \fIhints\fP] [\fB-T\fP \fItextsize\fP] [\fB-A\fP \fIpacket_size\fP] [\fB-O\fP \fIoptions\fP]
[\fB-S\fP \fIservername\fP] [\fB-U\fP \fIusername\fP] [\fB-P\fP \fIpassword\fP] [\fB-EdVv\fP]
.fam T
.fi
.SH DESCRIPTION
\fBfreebcp\fP is a utility program distributed with FreeTDS. 
\fBfreebcp\fP replicates (in part at least) the functionality
of the "bcp" utility programs distributed by Sybase and Microsoft.
.PP
\fBfreebcp\fP makes use of the db-lib bcp API provided by FreeTDS. This 
API is also available to application developers.
.PP
The manual pages or online help for Sybase or SQL Server can be 
referenced for more detailed information on "bcp" functionality.
.SH TABLES AND FILES
.TP
.B
database
The database of the object being copied.  Optional
if the table/view is in the default database for
\fIusername\fP. 
.TP
.B
owner
The owner of the object being copied. Optional if 
\fIusername\fP or the database owner is the owner 
of the table.
.TP
.B
object_name
Usually, object_name is the name of the database 
table you wish to access. It can also be a view (and, 
subject to constraints, it is sometimes possible to 
load a view). It can also be an SQL query, cf. queryout, 
below. 
.TP
.B
in | [query]out
The direction of the bulk copy operation. 'in' 
indicates data are to be copied from a host
file into a database table; 'out' indicates data
are to be copied from a database table to a host 
file. 'queryout' indicates that table_name is in fact a query, 
rather than a database object. \fBfreebcp\fP will execute the 
query and write the results to a file. (It is a good idea
to have the query return one and only one result set.)
.TP
.B
\fIdatafile\fP
The name of an operating system file.
.SH OPTIONS
.TP
.B
\fB-c\fP
The host data file is (or will be) in "character" format,
i.e., a text file. Encoding is determined by the 
client charset attribute in freetds.conf.
.TP
.B
\fB-n\fP
The host data file is in "native" format.
This is a format that \fBfreebcp\fP will be able to process,
but is not portable or readable.
.TP
.B
\fB-f\fP \fIformatfile\fP
The format of the host data file is described 
by \fIformatfile\fP. The layout of \fIformatfile\fP
is identical to that understood by the Sybase and
Microsoft bcp utilities,
but is too complicated to describe here.
.TP
.B
\fB-b\fP \fIbatchsize\fP
The number of rows per batch of data copied. Batching 
applies only when you are bulk copying into the
database. Each batch of data is effectively 'committed'
into the database. The default value for \fIbatchsize\fP is 1000. 
.TP
.B
\fB-F\fP \fIfirstrow\fP
The first row to copy from the input file or
database table. The default is the first row, row 1. 
.TP
.B
\fB-L\fP \fIlastrow\fP
The last row to copy from an input file  or
database table. The default is the last row. 
.TP
.B
\fB-r\fP \fIrow_term\fP
The row terminator for a character file. 
May be more than one character.
Default is newline ('\\n'). Cf. \fB-c\fP, above.
.TP
.B
\fB-t\fP \fIfield_term\fP
The field terminator for character file. Also known as a 
column delimiter. May be more than one character.
Default is tab ('\\t'). Cf. \fB-c\fP, above.
.TP
.B
\fB-m\fP \fImaxerrors\fP
Stop after encountering maxerror errors. Default 10.
.TP
.B
\fB-e\fP \fIerrfile\fP
Write errors to error_file. For uploads. 
Includes line and column information, and the row data.
.TP
.B
\fB-S\fP \fIservername\fP
The name of the Database Server to which to connect. 
.TP
.B
\fB-U\fP \fIusername\fP
A database login name. If \fIusername\fP is not provided, a domain
login is attempted for TDS 7+ connections.
.TP
.B
\fB-P\fP \fIpassword\fP
A database \fIpassword\fP.
.TP
.B
\fB-E\fP
Write the data in \fIdatafile\fP to the table's IDENTITY 
column. Without this flag, the identity data present in
the \fIdatafile\fP will be ignored, and new IDENTITY values
will be generated for the imported rows. 
.TP
.B
\fB-d\fP
Turn off any logging. (Unintuitive, perhaps.)
.TP
.B
\fB-O\fP \fIoptions\fP
SQL text to set connection \fIoptions\fP prior to the bcp operation.
If \fIoptions\fP is a valid filename, the SQL is read from 
the file instead. Sometimes needed for queryout. 
Example: "\fB-O\fP 'SET QUOTED_IDENTIFIER ON'"
.TP
.B
\fB-I\fP \fIinterfaces\fP
The name and location of the \fIinterfaces\fP file to 
search when connecting to servername. Overrides freetds.conf.
.TP
.B
\fB-h\fP \fIhints\fP
Set bcp \fIhints\fP. For valid values, 
cf. \fBbcp_options\fP() in the FreeTDS Reference Manual.
.TP
.B
\fB-T\fP \fItextsize\fP
For text or image columns, set the maximum number of 
characters to request from the server. Defaults to the 
setting in freetds.conf. If not specified anywhere, defaults
to the full size of the data.
.TP
.B
\fB-A\fP \fIpacket_size\fP
Set the size of a TDS packet to \fIpacket_size\fP. 
Not sure why you would want to do this, except as an
experiment. 
.TP
.B
\fB-v\fP \fB-V\fP
Print the version information and exit. 
.SH ENVIRONMENT
.TP
.B
DSQUERY
default \fIservername\fP
.SH NOTES
When connecting to a Sybase database server, it is required that the
TDS 5.0 protocol be used. When connecting to a Microsoft SQL Server
2000 database server, the TDS 7.1 protocol is required.
.PP
Theoretically both Sybase and Microsoft support the TDS 4.2 protocol,
but in reality they implement the bcp portion of TDS 4.2 differently.
FreeTDS has no way of knowing which type of server it's connected to,
hence TDS protocol 4.2 is not supported.
.SH HISTORY
\fBfreebcp\fP first appeared in FreeTDS 0.60
.SH AUTHORS
The \fBfreebcp\fP utility was written by Bill Thompson
(thompbil@exchange.uk.ml.com)
.SH BUGS
Currently, there is no support for text data types in \fBfreebcp\fP, when
SQL Server 2000 is the target database.

Zerion Mini Shell 1.0