How Different Data Typing Rules Affect PC API Users [ HP ALLBASE/SQL PC API User's Guide ] MPE/iX 5.0 Documentation
HP ALLBASE/SQL PC API User's Guide
How Different Data Typing Rules Affect PC API Users
When the application is connected to an ALLBASE/SQL DBEnvironment, in
most cases you can use either SQLBase or ALLBASE/SQL data type
declarations without encountering errors. Many data types are completely
compatible.
In most cases, PC API is able to translate the SQLBase data type into its
ALLBASE/SQL equivalent, when the database function call is passed to the
HP 3000 server. Likewise, PC API translates the ALLBASE/SQL data type
into its SQLBase equivalent when the result of the function call is
passed back to the Gupta C/API.
This chapter documents only those cases where the differences in the data
types could cause some degree of impact on the application. In a few
cases, the SQLBase data type is not supported by ALLBASE/SQL. Fields
declared as unsupported data types must be changed to a data type
supported by ALLBASE/SQL. In other cases, the maximum size of the SQLBase
data type is not the same as the maximum size of the same ALLBASE/SQL
data type. When the maximum sizes vary, you may need to change the
application to accommodate size differences.
Table 5-1 lists each data type defined by ALLBASE/SQL and SQLBase and
their differences in compatibility. The remainder of the chapter
discusses these differences in more detail.
Table 5-1. SQLBase and ALLBASE/SQL Data Type Differences
----------------------------------------------------------------------------------------------
| | | |
| SQLBase Data Type | ALLBASE/SQL Equivalent | Differences |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| CHAR | CHAR | SQLBase maximum length = 254 |
| | | bytes; ALLBASE/SQL maximum length |
| | | = 3996 bytes |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| VARCHAR | VARCHAR | SQLBase maximum length = 254 |
| | | bytes; ALLBASE/SQL maximum length |
| | | = 3996 bytes |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| LONG VARCHAR | VARCHAR | SQLBase unlimited length; |
| | | ALLBASE/SQL maximum length = 3996 |
| | | bytes |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| LONG | VARCHAR | SQLBASE unlimited length; |
| | | ALLBASE/SQL maximum length = 3996 |
| | | bytes |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| NUMBER | not valid | Treated as an error when connected |
| | | to ALLBASE/SQL |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| DECIMAL | DECIMAL | None |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| | NUMERIC | NUMERIC is valid synonym for |
| | | DECIMAL in ALLBASE/SQL only |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| INTEGER | INTEGER | None |
| | | |
----------------------------------------------------------------------------------------------
Table 5-1. SQLBase and ALLBASE/SQL Data Type Differences (cont.)
----------------------------------------------------------------------------------------------
| | | |
| SQLBase Data Type | ALLBASE/SQL Equivalent | Differences |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| INT | INT | None |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| SMALLINT | SMALLINT | None |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| FLOAT | FLOAT | Differences in precision |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| REAL | FLOAT | PC API does not support REAL as a |
| | | synonym for FLOAT |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| DOUBLE PRECISION | DOUBLE PRECISION | Differences in precision |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| DATETIME | DATETIME | Data represented differently; |
| | | differences in results of |
| | | mathematical expressions |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| TIMESTAMP | DATETIME | Data represented differently |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| DATE | DATE | Data represented differently |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| TIME | TIME | Data represented differently |
| | | |
----------------------------------------------------------------------------------------------
The following ALLBASE/SQL data types have no equivalent SQLBase data
types and are unsupported by either SQLBase or PC API:
* INTERVAL
* BINARY
* VARBINARY
* LONG BINARY
* LONG VARBINARY
MPE/iX 5.0 Documentation