HP 3000 Manuals

Mapping of Data Types [ Up and Running with ALLBASE/SQL ] MPE/iX 5.0 Documentation


Up and Running with ALLBASE/SQL

Mapping of Data Types 

Both TurboIMAGE and ALLBASE/SQL have data types that do not map exactly
to a type in the other system.  But a satisfactory mapping with
appropriate conversions can easily be done for most TurboIMAGE data
types.

Basic Mapping 

Table 5-1 shows the mapping of the most common data types from TurboIMAGE
to ALLBASE/SQL:

          Table 5-1.  Mapping of TurboIMAGE and ALLBASE/SQL Data Types 

----------------------------------------------------------------------------------------------
|                              |                              |                              |
|          TurboIMAGE          |         ALLBASE/SQL          |         Description          |
|          Data Type           |          Data Type           |                              |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| I,J                          | SMALLINT                     | 16-bit integer               |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| I2,J2                        | INTEGER                      | 32-bit integer               |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| K1,K2                        | INTEGER                      | Requires conversion from     |
|                              |                              | binary to integer            |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| P n                          | DECIMAL( n-1,0)              | Packed decimal               |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| R4                           | FLOAT                        | Conversion from HP 3000 real |
|                              |                              | to IEEE real                 |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| U( n), X( n)                 | CHAR( n)                     | Byte character string        |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| Z n                          | DECIMAL( n,0)                | Requires conversion from     |
|                              |                              | zoned decimal to packed      |
|                              |                              | decimal                      |
|                              |                              |                              |
----------------------------------------------------------------------------------------------

Compound Items 

TurboIMAGE compound items are not compatible with ALLBASE/SQL data types,
because ALLBASE/SQL does not accomodate arrays.  In ALLBASE/SQL, you need
to create a separate column description for each member of the compound.

Null Handling 

TurboIMAGE does not support null values.  Thus, a null value is often
represented as an empty string or as zero (for numeric values).

In ALLBASE/SQL, a special data type NULL can be used to indicate the
absence of a value; NULL is distinct from 0 or from an empty string,
which are like any other values.  If columns are not permitted to contain
nulls in ALLBASE/SQL, you must define the column as NOT NULL when you
create the table.



MPE/iX 5.0 Documentation