psBCP

Description

     This program loads your Sybase BCP data file into a table.  As
it loads, it checks each field in each record of your file to see
whether it is compatibile with its corresponding column data type.
It checks *before* it copies the data to Adaptive Server.  If there is a
problem with any field, this program tells you the record number where
the problem occurred, and then immediately ends with a *non-zero*
exit code.   If this program does not detect any problems either by
its own algorithms or by messages returned from Sybase's APIs or Adaptive
Server, then this program ends with a 0 (successful) exit code.
A single error will cause psBCP to exit with a non-zero code.
      For data type errors, psBCP always tells you the
offending line number.  If you are getting duplicate row errors, psBCP
can only give you the offending range of records.  The range of
records matches the size of the batch (-b).  If you make your batch
size 1, then you will know the exact number of the duplicate record.
      Another advantage of this program over bcp, is that while
rows are being copied, you can automatically have the database
checkpointed or have its log dumped with truncate_only.   These
operations will occur after each batch so long as you have the
permission to do it.  This program opens 2 connections to the Adaptive
Server.  One to do the bulk copy, the other to do checkpoints,
dump transaction logs and everything else.
      This program copies while it checks.  If you just want to check
your file, run psCheckBulkCopyFile instead.  psCheckBulkCopyFile
checks types and ranges for each of your file's columns as well as
checks for duplicate rows and indices.  As opposed to psBCP
psCheckBulkCopyFile does not send data to the SQL Server.

 

Syntax

psBCP -Sserver -Uusername -Ppassword -Ddatabase
-Wowner -Ntable -Binput_bcp_file -Hheader_rows -bbatch_size -Crows_to_cache
-Acolumn_delimiter_string -Yrow_terminator_string
-Lleading_character_to_remove -Ttrailing_character_to_remove
-Rreplacment_character_for_embedded_space
-mmax_record_len -xmax_image_len
-Flog -Ee-mail_address -Ooptions

 

Arguments

-S

Sybase Server Name

-U

Sybase User Name

-P

Sybase User's Password

-D

Sybase Database

-W

Table belongs to this 'owner'

-N

Table having pattern 'name'

-B

Name of the input BCP load file [standard input]

-b

Number of rows in a single xact batch [the entire file]

-C

Number of rows to cache [1000]

-H

Header records to ignore [0]

-A

Column delimiter string [ | ]

-Y

Row terminator string [operating system default record terminator]

-L

Leading character to remove

-T

Trailing character to remove

-R

Replacement character for an embedded space in a text field

-m

Maximum record size [4096]

-x

Maximum image size [100000]

-F

Log file [standard output]

-E

E-mail address to report errors

-O

Options

 

Options

s

Turn off statistics reporting

t

Truncate table first

c

Checkpoint after each batch

d

Dump transaction log with truncate_only after each batch

i

Explicit identity values are in the BCP load file

w

Remove leading and trailing white spaces except for the delimiter from BCP file

q

Remove quotes from text fields

u

Update statistics at the end

a

Update 'all' statistics at the end

 

Environment Variables Behind the Scenes

DSQUERY

When -S is not specified.

SYB_USER

When -U is not specified.

SYB_PASS

When -P is not specified.

SYB_DATABASE

When -D is not specified.

PS_SYSMSG_FILE

Name of the tool's messages file.

 

Go to DBPowerSuite 7.9 List of Programs.


Updated: Thu Jun 18 21:12:26 2009