leading zeros in export of decimal field

leading zeros in export of decimal field

 

  

This is a post I put on groups.google.com yesterday.
This is probably a better arena. Hope this is okay.

==============================================
Hello! The issue I am having is that when I export a
decimal column
out of DB2 UDB 8.1.5 I get a "+" and leading zeros to
round out the
field (see example below). I have a quick and dirty
perl one-liner to
fix this, but even after scouring the export
documentation and
searching the web, I cannot find a parameter to turn
this off (except
to get rid of the +). I did see a "db2 values cast"
command but it is
not very well documented either.

Has anyone run into this issue before and knows how to
deal with it?

Thank you in advance,

Kermit Lowry
kermit dot lowry [AT] kp dot org

create table txn(cust_id integer not null, value
decimal(19,2) not
null)
in userspace1;

db2 "select * from txn"

CUST_ID VALUE
----------- ---------------------
1 10.20

db2 export to k.del of del "select * from txn"

cat k.del
1,+00000000000000010.20

perl -pe 's/\+0+([1-9]\d*\.\d*)/$1/g;' k.del

1,10.20

__________________________________
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com
DB2 & UDB email list listserv db2-l LazyDBA home page