Run that Block and you will get an integer overflow exception. Use a Temp var 
for the division and it runs OK. 
---------------------------------------------------------------------------------------------------------------

                 Key: CORE-5303
                 URL: http://tracker.firebirdsql.org/browse/CORE-5303
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 2.5.3
         Environment: FB 2.5.3 Windows 7
            Reporter: Alfonso Presa


Thanks in advance and kind regards, 

Al

execute block
as
declare variable TOT_CANT numeric(18,4);
declare variable TOT_PRECIO numeric(18,4);
declare variable TOT_UTILIDAD numeric(18,4);
declare variable CANT_DESCARGA_TIPO_5 numeric(18,4);
declare variable TMP numeric(18,4);
begin
  TOT_PRECIO = 372204; TOT_CANT = 63; CANT_DESCARGA_TIPO_5 = 4000;

         --TMP = (:TOT_PRECIO / :TOT_CANT);
         TOT_PRECIO = :TOT_PRECIO + :CANT_DESCARGA_TIPO_5 * (:TOT_PRECIO / 
:TOT_CANT);
         TOT_UTILIDAD = :TOT_UTILIDAD + :CANT_DESCARGA_TIPO_5 * (:TOT_UTILIDAD 
/ :TOT_CANT);
         TOT_CANT = :TOT_CANT + :CANT_DESCARGA_TIPO_5;
end

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to