A. Upgrading from Ingres 6.4 : Considerations for Ingres 6.4 : Application Preparation : Decimal Constant Semantics Change
 
Share this page                  
Decimal Constant Semantics Change
With the introduction of the DECIMAL data type, fixed-point literals such as 1.0 are now considered DECIMAL, rather than FLOAT.
Typically, this does not matter, as Ingres does appropriate type conversions. However, it is important when doing a CREATE TABLE . . . AS SELECT with a constant in the SELECT result list.
For example:
CREATE TABLE table_1
AS SELECT column_1, column_2, column_3=1.0
FROM table_2;
In Ingres 6.4, the column_3 is created as FLOAT8; in Ingres it is created as a DECIMAL(2,1) column. This may result in overflow in an application.
The recommended approach is to examine uses of fixed-point constant usage in applications and change them to floating point constants, or add an explicit FLOAT8 type conversion.
A less thorough but easier alternative is to set the environment variable II_NUMERIC_LITERAL to FLOAT, as follows:
setenv II_NUMERIC_LITERAL FLOAT
Ingres then interprets fixed-point constants as floats rather than decimals. If you decide to use II_NUMERIC_LITERAL, it will be necessary for every user of the applications to set II_NUMERIC_LITERAL in their environment.