Issue with DecimalToDecimal
Posted: Mon Nov 07, 2011 11:54 am
I need to calculate the value for a nullable column by doing some division and the derivation uses stage variables. The target column in the oracle table is of
Varchar(25) though. The input for calculation is read from a fixed width file.
Since the data type of the output column in target table is Varchar(25), how will I deal with this.
I tried to define the output column as Decimal(8,5) and did the above derivation. In that case, all records are displayed with value as 000.00000.
I tried to do a DecimalToString on top of DecimalToDecimal and made the output column as varchar 25. In that case, null value id written to the table.
When I tried DecimalToDecimal(inputcol[28,15] / 10000000000.0) and tried to write to a sequential file with column definition as Decimal(8,5), value is getting calculated correctly and loaded correctly.`
What could be the issue here? Please let me know your inputs.
Varchar(25) though. The input for calculation is read from a fixed width file.
The derivation for stage variable does not result in a null value.If stgVar1 = 1 Then DecimalToDecimal(inputcol[1,15] / 10000000000.0) Else If stgvar1= 2 Then DecimalToDecimal(inputcol[1,15] / 10000.0)
Else If stgvar1 = 3 Then DecimalToDecimal(inputcol[1,15] / 10) Else ""
Since the data type of the output column in target table is Varchar(25), how will I deal with this.
I tried to define the output column as Decimal(8,5) and did the above derivation. In that case, all records are displayed with value as 000.00000.
I tried to do a DecimalToString on top of DecimalToDecimal and made the output column as varchar 25. In that case, null value id written to the table.
When I tried DecimalToDecimal(inputcol[28,15] / 10000000000.0) and tried to write to a sequential file with column definition as Decimal(8,5), value is getting calculated correctly and loaded correctly.`
What could be the issue here? Please let me know your inputs.