Copying in data with field lengths  Copying in data with a format file

Chapter 4: Using bcp to Transfer Data to and from Adaptive Server

Copying in data with delimiters

In the following example, bcp copies data from the file newpubs into the table pubs2..publishers. In the newpubs file, each field in a row ends with a tab character (\t) and each row ends with a newline terminator (\n), as follows:

1111  Stone Age Books             Boston       MA
2222  Harley & Davidson           Washington   DC
3333  Infodata Algosystems        Berkeley     CA

Since newpubs contains all character data, you can use the character command-line flag and specify the terminators with command line options:





Copyright © 2005. Sybase Inc. All rights reserved. Copying in data with a format file

View this book as PDF