Subject | RE: [ib-support] RC2 and integers |
---|---|
Author | Roger Pullen |
Post date | 2002-01-08T13:55:23Z |
OOPS - should have been this:
Have narrowed it down to this BEFORE_UPDATE trigger
on a sample database:
declare variable total integer;
declare variable owner integer;
declare variable vat_rate numeric(9,2);
begin
vat_rate = 1 + (17.50 / 100);
owner = cast((150.99 * 10000) as integer);
total = cast((150.99 * vat_rate * 10000) as integer);
if (owner > total) then
TEST_TABLE.COL2 = "N";
else
TEST_TABLE.COL2 = "Y";
The above works on the original Borland IB6
but fails on RC2 with overflow errors
If I alter the vat_rate to:
declare variable vat_rate numeric(15,2);
it is OK - so probably not directly to do with integers
but something has changed
Regards
Roger P
-----Original Message-----
From: Paul Reeves [mailto:paul@...]
Sent: 08 January 2002 09:45
To: ib-support@yahoogroups.com
Subject: Re: [ib-support] RC2 and integers
Roger Pullen wrote:
Have you got a reproducable test case?
Paul
--
Paul Reeves
http://www.ibphoenix.com
taking InterBase further
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Have narrowed it down to this BEFORE_UPDATE trigger
on a sample database:
declare variable total integer;
declare variable owner integer;
declare variable vat_rate numeric(9,2);
begin
vat_rate = 1 + (17.50 / 100);
owner = cast((150.99 * 10000) as integer);
total = cast((150.99 * vat_rate * 10000) as integer);
if (owner > total) then
TEST_TABLE.COL2 = "N";
else
TEST_TABLE.COL2 = "Y";
The above works on the original Borland IB6
but fails on RC2 with overflow errors
If I alter the vat_rate to:
declare variable vat_rate numeric(15,2);
it is OK - so probably not directly to do with integers
but something has changed
Regards
Roger P
-----Original Message-----
From: Paul Reeves [mailto:paul@...]
Sent: 08 January 2002 09:45
To: ib-support@yahoogroups.com
Subject: Re: [ib-support] RC2 and integers
Roger Pullen wrote:
>I've looked into this some more and I can't see where the problem might be.
> Just testing an original IB6 db on RC2
>
> Has there been a change in integer datatypes?
>
> An SP which multiplied a numeric(9,2) by 10000
> and cast it as an integer now fails with an
> overflow. If I reduce the 10000 to 100 it is OK
>
> Works OK on real IB6
>
Have you got a reproducable test case?
Paul
--
Paul Reeves
http://www.ibphoenix.com
taking InterBase further
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/