Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bulk Copy Question?

Status
Not open for further replies.

pmcmicha

Technical User
May 25, 2000
353
I need to grab some tables from a db2 database and have the "|" symbol as a delimiter between each field. Could someone please help out with the syntax for db2?

Thanks in advance.
 
Hi pmcmicha,
You need to put the | in quotes:

SELECT FNAME, "|", SURNAME, "|", ADDRL1, "|", ADDRL2
FROM ......

hth
Marc
 
We do bulk copies and use export files from DB2. Using the EXPORT utility the following statement will created a delimited ASCII file with the | as a column delimiter:

db2 "EXPORT to /work/bcpdata/outputfilename of DEL MODIFIED By coldel0x7C MESSAGES /work/bcpdata/output_msg.dat select * from tablename"

The parameter coldel is what sets the column delimiter. The "0x7C" is the hexidecimal value for the pipe | character.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top