Hi all.
I am doing sum of columns decimal(15,2) But i am getting warning
AG_GLData,0: APT_Decimal::operator=: the source decimal has even precision, but non-zero in the leading nybble, or is too large for the destination decimal.
For that i have tried changing target length to decimal(17,2) also decimal(19,4).But this doesn't worked.It looks as if there is problem in putting the decimal value in target field after all processing as it is fixed width field.So what should i do for that case.
Problem in aggregating decimal value
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 407
- Joined: Mon Jun 27, 2005 8:54 am
- Location: Walker, Michigan
- Contact:
Re: Problem in aggregating decimal value
I tried too. It doesn't work. I would call this a bug as it lets you select the target decimal length by selecting the subtype "Decimal output". However, when you change this (at least in my case) the job completes successfully and nothing gets loaded. Always nice.
I was able to get to work by using a convoluted modify stage (at least as far as lock of documention is concerned and mapping capabilities via drag-drop like other stages) to modify the incoming decimal from a decimal(15,2) to a decimal(19,2) before sending to aggregate. In aggregate stage I selected subtype "Decimal Output" for the SUM option and enterered (19,2) as (8,2) for some reason seems to be a default that does not work. That worked.
To use modify, basically input the same schema you currently have in the input of the stage into the output of the stage and for the columns causing issues that are decimal(15,2) change to decimal(19,2) in the output (just output).
In stage, properites, enter a specification for each column to be changed to a decimal(19,2).
Just doing,
mydec1=mydec1
mydec2=mydec2
seemed to work for me.
I was able to get to work by using a convoluted modify stage (at least as far as lock of documention is concerned and mapping capabilities via drag-drop like other stages) to modify the incoming decimal from a decimal(15,2) to a decimal(19,2) before sending to aggregate. In aggregate stage I selected subtype "Decimal Output" for the SUM option and enterered (19,2) as (8,2) for some reason seems to be a default that does not work. That worked.
To use modify, basically input the same schema you currently have in the input of the stage into the output of the stage and for the columns causing issues that are decimal(15,2) change to decimal(19,2) in the output (just output).
In stage, properites, enter a specification for each column to be changed to a decimal(19,2).
Just doing,
mydec1=mydec1
mydec2=mydec2
seemed to work for me.