Subject Re: Query giving "Unsuccessful execution caused by system error"
Author andrew_s_vaz
Hi Alexandre,

> What the type of the involved fields ?
>
> If they are numeric(x,y) (or decimal) you are getting problem
because the lot of multiplications and divisions, that is leading to
an overflow on the decimals...
>
> Try casting those columns to double precision.
>

I think it's the sum equation also, but I'm sure that I'm not doing
any illegal math (divide 0 and stuff like that). It is working in the
other app.

The types of data are:

ITRPORCCOB DECIMAL(14,4),
ITRHON DECIMAL(14,4),
ITRMULTHON DECIMAL(14,4),
ITRDESCONTOTAB DECIMAL(14,4),
ITRVLRINDXFAT DECIMAL(14,4),
ITRMULTTAB SMALLINT

as I need to work with BCD types. ITRMULTTAB is only a multiplier, so
it's a smallint.

Are my definitions of BCD right? DECIMAL(14,4)?


Thanks
Andrew