This issue you can solve as i tried below...But i think you should stick
with original Decimal point as during Import this might help DB2 to
understand that the column definition is of Decimal(19,2)...I didn't try
Importing the data by myself...
Command:
J:\ db2 export to c:\k.del of del "select * from employee"
Output in file:
276354,"John Doe", "x875463", +00000080.99,"scottsdale office", 45
Command:
J:\db2 export to c:\k.del of del "select
objid,empname,login_id,decimal(salary_rate,5,2).site_name,age from
Employee"
Output in file:
276354,"John Doe", "x875463", +080.99,"scottsdale office", 45
Hope this will help
|---------+--------------------------------------->
| | Kermit Lowry <[Email Address Removed] | |
| | |
| | Thursday March 18, 2004 09:24 AM |
| | |
|---------+--------------------------------------->
>---------------------------------------------------------------------------------------------------|
| |
| To: [Email Address Removed] |
| cc: |
| Subject: 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
---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
Get today's cartoon: http://www.LazyDBA.com
To unsubscribe, e-mail: db2udbdba-[Email Address Removed] additional commands, e-mail: db2udbdba-[Email Address Removed]DB2 & UDB email list listserv db2-l LazyDBA home page