Hi,
my job
td stage ----> trans-----> tdstage.
I have written custom query in the teradata connector stage(source).
select sum(reslt_1) from table group by master_trim_id.
result_1 decimal(16,2).
BUT job is failed. it is expexting decimal(18,2)
after useing cast function my job is running fine,
select cast(sum(reslt_1) as decimal(18,2) from table group by master_trim_id.
my question is datastage will take default length for decimal values?
and is there any other way to resolve this issue.?
query
Moderators: chulett, rschirm, roy
Re: query
Find what is the return type of SUM funcation. It is int and you declared the data type as decimal.
So you need to conversion and that worked when you use the cast.
This is my understanding.
So you need to conversion and that worked when you use the cast.
This is my understanding.
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It probably is simply allowing two extra digits of precision (without changing scale) on the premise that the sum will be larger than any of the individual elements of the sum and, as a rule of thumb, allowing the sum to be about 100 times larger than any other element. (And that at the lower bound of uncertainty.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.