Copying in data with a format file

To copy data back into Adaptive Server using the saved pub_fmt format file, run the following command:

bcp pubs2..publishers in pub_out -fpub_fmt

You can use the pub_fmt file to copy any data with the same format into Adaptive Server. If you have a similar data file with different delimiters, you can change the delimiters in the format file.

Similarly, you can edit the format file to reflect any changes to the field lengths, as long as all fields have the same length. For example, the moresales file contains:

804213-L-9 Jan 21 1993 12:00AM
804255-N-8 Mar 12 1993 12:00AM
804291-T-4 Mar 23 1993 12:00AM
804291-W-9 Mar 23 1993 12:00AM

Edit the sal_fmt format file to read as follows:

10.0
3
1		SYBCHAR 0 4 "" 1 stor_id
2		SYBCHAR 0 7 "" 2 ord_num
3		SYBCHAR 0 21 "\n" 3 date

Then enter the following command:

The system responds as follows:

Starting copy...
4 rows copied.
 Clock Time (ms.): total = 1 Avg = 0 (116000.00 rows per sec.)