psCheckBulkCopyFile

Description

     This program compares your Sybase BCP load file against the
Sybase's table's column and index definitions to see whether or not
your file will load properly into the table.   Each field in your
BCP load file is checked for compatibility with its column data type.
Also, field combinations are checked for uniqueness if the table
has unique indexes.  If the table has a clustered index which disallows
duplicates, then this program checks for row duplicates.
     The purpose of this program is to quickly scan your BCP load file
for errors.  You could let the BCP program do it as well, but BCP
can take hours longer because your data is being written into Sybase
at the same time.  Also, once BCP finds an error, Sybase rejects your
transaction batch and many times BCP will not tell you
exactly what record in your file is bad.

 

Syntax

psCheckBulkCopyFile -Sserver -Uusername -Ppassword -Ddatabase
-Wowner -Ntable -Binput_bcp_file -boutput_bcp_file
-Ainput_column_delimiter -aoutput_column_delimiter
-Yinput_row_terminator -youtput_row_terminator
-mmax_record_len -xmax_image_len
-Flog -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

-b

Name of the output BCP load file [optional]

-A

Input column delimiter string [|]

-a

Output column delimiter string [Input column delimiter string]

-Y

Input row terminator string [defaults to operating system record terminator]

-y

Output row terminator string [defaults to input row terminator]

-m

Maximum record size [100000]

-x

Maximum image/text size [100000]

-F

Log file [standard output]

-O

Options

 

Options

w

Remove leading and trailing white spaces from BCP load file

i

Explicit identity values are in the BCP load file

n

Do not check for duplicates

r

Write bad records to the log file

 

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.

 

Notes

     If you do not specify a column delimiter and row terminator, this
program assumes your text file has tab delimiters and standard operating
system record terminators (a newline character (\n) in UNIX.)
If you specify a delimiter or terminator, enclose your string in
single quotes.  A single quote (') will allow you to also use the '$'
character.   As for special white space characters, I only decode the
following because Sybase's bcp only understands these:
         \t      tab
         \n      newline
         \r      return
A backslash proceeding any other character renders the character.
If you specify a number, then I assume that number represents the ASCII
code for the delimiter or terminator.   Avoid the number '0', i.e., null.  If
your records contain embedded nulls, you have more problems than you realize.
    Note the very powerful option of -b, -a and -y.  Used together,
you can translate the column delimiters and row terminators in your input
file to something totally different.   The -b option, in particular, acts
as a filter.  By using -b to specify an output file, this program will
generate a new bcp file which contains only good records and new delimiters.

 

Go to DBPowerSuite 7.9 List of Programs.


Updated: Thu Jun 18 21:12:26 2009