HPlogo Up and Running with ALLBASE/SQL: HP 3000 and HP 9000 Computer Systems > Chapter 7 Comparing ALLBASE/SQL with TurboIMAGE

Mapping of Data Types

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

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 7-1 Mapping of TurboIMAGE and ALLBASE/SQL Data Types

TurboIMAGE Data TypeALLBASE/SQL Data TypeDescription
I,JSMALLINT16-bit integer
I2,J2INTEGER32-bit integer
K1,K2INTEGERRequires conversion from binary to integer
PnDECIMAL(n-1,0)Packed decimal
R4FLOATConversion from HP 3000 real to IEEE real
U(n), X(n)CHAR(n)Byte character string
ZnDECIMAL(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.

Feedback to webmaster