Hi ,
I have one requirement where I need to convert string to decimal tried different ways by searching in the forum but nothing worked out.
Here is the example
From Source I am getting Varchar(10) and target datatype is decimal(8,2)
Source: +001000.22
Expected :- +001000.22
If the source is -001000.22
Expected in the target :- -001000.22
I tried StringTodecimal function in the transformer and applied a peek stage and viewed the data it looks okey but when I check in the db2 database it just populate as "1000."
Could anyone guide me where I would have gone wrong?
Thanks
String to decimal
Moderators: chulett, rschirm, roy
Re: String to decimal
Start diagnosing the problem by answering the following questions:
How is the column defined within the database?
How are you viewing the data that has been loaded into the database? Using the db's client software (or other), or view data (or similar) within DataStage? Have you tried other methods of viewing the data?
How are you loading the data to the database? What stage, write method, column definition?
Are you receiving any warnings regarding truncation/precision within the job logs?
What happens to the data between transformation (StringToDecimal) and being loaded to the database and then viewed? Verify the datatype at each step along the way.
Regards,
How is the column defined within the database?
How are you viewing the data that has been loaded into the database? Using the db's client software (or other), or view data (or similar) within DataStage? Have you tried other methods of viewing the data?
How are you loading the data to the database? What stage, write method, column definition?
Are you receiving any warnings regarding truncation/precision within the job logs?
What happens to the data between transformation (StringToDecimal) and being loaded to the database and then viewed? Verify the datatype at each step along the way.
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.