Exact Numerics in Gpre - Functional Specification

Description

This document describes the gpre support part for the Exact numeric. Gpre will generate appropriate host variables, blrs and dyns depending on the dialect to support 64 bit integers.

User Interface/Usability

Columns declared as NUMERIC(n,m) or DECIMAL(n,m), where 10<=n<=18, will be treated in special way based on the sql dialect, compile time server and database ods version. Gpre will generate the correct dyn and blr whenever it sees such a column definition. Host variable definitions will also have to change. The following table summarizes gpre's behavior.

Compile time server version Compile time database ods version Sql dialect gpre's interpretation
< 6.0 < 10.0 1, 2, 3 similar to V5. i.e. double
==6.0 ==10.0 1 similar to V5. i.e. double
    2 Error : Ambiguous type
    3 ISC_INT64

Migration Issues

As the above table shows, Columns declared as NUMERIC(n,m) or DECIMAL(n,m), where 10<=n<=18 behaves differently. If a host variable is based on such a column, then in an earlier version of gpre it would be termed as double. for e.g..

BASED ON ATABLE.ACOLUMN aX; would translate into double aX;

The same is true in 6.0 gpre if the sql dialect is 1. However if the dialect is 3 then it would be ISC_INT64 aX;

The same is true in 6.0 gpre if the sql dialect is 1. However if the dialect is 3 then it would be ISC_INT64 aX;