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

How do I load a char field in text file into a decimal(7,2) field?

Status
Not open for further replies.

hmoe

Programmer
Mar 10, 2006
9
US
I have a file that I'm trying to load into Teradata. The field is defined as a char(7) in the .layout and I need to load it into a decimal(7,2) field in Teradata. I thought a definition of (7,2) means 5 digits before and two digits after the decimal. My data isn't appearing correctly in the table after the load.

example:

the field in the file is 0001567.
in the table it looks like 1567.00 rather than 15.67

Can someone please help?
 
Teradata is looking for the decimal point in your input field, but it's missing.

In MultiLoad/TPump try "cast('0001234' as dec(7,0)) / 100.00" in your DML LABEL.

IMHO you can't do that in FastLoad...

Dieter
 
Thanks for the tip. The DBA looked at it and altered the table and added a format statement on the column in the table. CHG_BCK_AMT DECIMAL(7,2) FORMAT 'ZZZZ9V99' NOT NULL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top