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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXPORT IN ASCII FORMAT 2

Status
Not open for further replies.

Ann28

MIS
Apr 2, 2004
97
US
Hello everyone!

I am using DB2 8.2 on AIX.

I am trying to export the table in ASCII (TEXT) format.
I have a basic export statement to export the data file delimited by spaces.

Code:
export to "c:\temp\HRS" of del modified by nochardel   decplusblank striplzeros

THANK YOU FOR YOUR HELP!
Ann [ponytails]
 
Ann,

you haven't said what your problem is. I notice you haven't included a select statement to tell export which data you wish to export. Is it that?

Greg
 
Greg -

There are no problems with this statement
It exports the data delimited with ",".

Can I export the data in text (.txt) format?

Thanks,
Ann
 
Ann,

I don't know of any direct option but if you create a file of sql:
echo "select * from tab1;" > file1.sql

Then invoke:
db2 +p -x -zfile2.sql < file1.sql

You will get an ASCII file without delimiters, but there will be spaces between fixed-length fields.

Brian
 
Thanks, Brian but I really need something w/o spaces for the mailing file
Ann
 
Ann

Why not generate your delimited file or the one with spaces an remove the spaces or delimiters using something like:

> sed 's/find/replace/g' file.t > filenew.t
for ',' delimited files:
> sed 's/,//g' test.t > testnew.t
to remove spaces: (be careful, all spaces will be removed):
> sed 's/ //g' test.t > testnew.t

that works great for me on AIX.



Juliane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top