Subject Re: [ib-support] Help with procedure
Author Daniel Rail
Hi,

At April 23, 2003, 22:48, Helen Borrie wrote:

> The procedure itself looks OK except for two things (see notes 1) and 2)
> below) but I think there is potential for the *detail data* which you are
> using in the calculation to be not as you assume it is.

> Notes about the stored procedure:
> 1) Don't use SUSPEND in loops that don't return output to the client.
> 2) You don't need to test NOT NULL return values for null, so these lines
> will use processing cycles unnecessarily:
> IF (TPRICE IS NULL) THEN TPRICE=0;
> IF (TCOST IS NULL) THEN TCOST=0;

Helen, both lines are needed, because the fields that they are applied
to(in the UPDATE statement) have the constraint NOT NULL. And, that
would generate an error. I do agree that SUSPEND doesn't belong in
this particular stored procedure.

--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)