Re: [firebird-support] query Integer overflow

2019-06-23 Thread 'Mr. John' mr_joh...@yahoo.com [firebird-support]
thanks for the tip Dimitry On Sunday, June 23, 2019, 11:38:04 AM GMT+3, Dimitry Sibiryakov s...@ibphoenix.com [firebird-support] wrote: 23.06.2019 5:41, 'Mr. John' mr_joh...@yahoo.com [firebird-support] wrote: > The calculation is on a SP code and I need it there   Then get rid of

Re: [firebird-support] query Integer overflow

2019-06-23 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
23.06.2019 5:41, 'Mr. John' mr_joh...@yahoo.com [firebird-support] wrote: > The calculation is on a SP code and I need it there Then get rid of IIF and decide at which moment you need round intermediate values. Then cast the values to types with smaller precision. -- WBR, SD.

Re: [firebird-support] query Integer overflow

2019-06-23 Thread 'Mr. John' mr_joh...@yahoo.com [firebird-support]
it is workingthanks On Sunday, June 23, 2019, 10:00:20 AM GMT+3, Mark Rotteveel m...@lawinegevaar.nl [firebird-support] wrote:   On 23-6-2019 05:59, 'Mr. John' mr_joh...@yahoo.com [firebird-support] wrote: > > > the error is gone if I cast one of the values as integer (at this

Re: [firebird-support] query Integer overflow

2019-06-23 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 23-6-2019 05:59, 'Mr. John' mr_joh...@yahoo.com [firebird-support] wrote: > > > the error is gone if I cast one of the values as integer (at this moment > there is no decimal needed for that field): > > >   CAST (b.P_TV_E AS INTEGER) > instead of >  b.P_TV_E > > >  SELECT   b.cant* 

Re: [firebird-support] query Integer overflow

2019-06-22 Thread 'Mr. John' mr_joh...@yahoo.com [firebird-support]
the error is gone if I cast one of the values as integer (at this moment there is no decimal needed for that field):    CAST (b.P_TV_E AS INTEGER)   instead of  b.P_TV_E    SELECT   b.cant*  IIF(b.PR_EAT_T<>0, b.PR_EAT_T-b.PR_EAT_T   *  CAST (b.P_TV_E AS INTEGER)   /(100+   CAST (b.P_TV_E AS

Re: [firebird-support] query Integer overflow

2019-06-22 Thread 'Mr. John' mr_joh...@yahoo.com [firebird-support]
The calculation is on a SP code and I need it there,worked for couple years..until that valuesthanks On Sunday, June 23, 2019, 12:42:42 AM GMT+3, Dimitry Sibiryakov s...@ibphoenix.com [firebird-support] wrote: 22.06.2019 21:47, 'Mr. John' mr_joh...@yahoo.com [firebird-support]

Re: [firebird-support] query Integer overflow

2019-06-22 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
22.06.2019 21:47, 'Mr. John' mr_joh...@yahoo.com [firebird-support] wrote: > I'm facing with this error on FB 2.5.8(latest stable version)/ W10 x64 My advice is "never perform calculations (especially multiplication and division) in SQL". Your expression has result of type NUMERIC(18,14)

[firebird-support] query Integer overflow

2019-06-22 Thread 'Mr. John' mr_joh...@yahoo.com [firebird-support]
HiI'm facing with this error on FB 2.5.8(latest stable version)/ W10 x64: Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements.Integer overflow.  The result of an integer operation caused the most significant bit of the result to