Subject Re: [IBO] IB_WISQL problem (maybe) - the code
Author Helen Borrie
At 02:36 PM 05-04-01 +0100, you wrote:
>Ok, so this list (or is it Yahoogroups) trims off attachments....

That is by design - it avoids the problem we were having with list members unknowingly posting viruses to the list...

>This was lifted straight off the source pane of the procedures tab in
>the WISQL browser.

This looks like a repeating error in the code:

update fifthpercentile set DEPRECIATION = (select sum(DEPRECIATION)
from incomestatement
where
incomestatement.prd = :curpnum)*0.05
where period = :curpnum;

Needs to be

update fifthpercentile set DEPRECIATION = (select sum(DEPRECIATION)
from incomestatement
where
incomestatement.prd = :curpnum)*0.05 ) <-- missing right bracket
where period = :curpnum;

Also, I think there is potential for these subselects (1) to be non-scalar and/or (2) for there to be a data type mismatch occurring as a result of performing the multiplication and/or (3) for no match to occur because of precision problems, i.e. you could be trying to operate on NULLs.

Clues, anyway....

Helen



All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________