ASA Programming Guide
The Open Client Interface
Data type mappings
Some data types have different ranges in Adaptive Server Anywhere than in Open Client. In such cases, overflow errors can occur during retrieval or insertion of data.
The following table lists Open Client application data types that can be mapped to Adaptive Server Anywhere data types, but with some restriction in the range of possible values.
In most cases, the Open Client data type is mapped to an Adaptive Server Anywhere data type that has a greater range of possible values. As a result, it is possible to pass a value to Adaptive Server Anywhere that will be accepted and stored in a database, but one that is too large to be fetched by an Open Client application.
Data type | Open Client lower range | Open Client upper range | ASA lower range | ASA upper range |
---|---|---|---|---|
MONEY | -922 377 203 685 477.5808 | 922 377 203 685 477.5807 | -1e15 + 0.0001 | 1e15 - 0.0001 |
SMALLMONEY | -214 748.3648 | 214 748.3647 | -214 748.3648 | 214 748.3647 |
DATETIME | Jan 1, 1753 | Dec 31, 9999 | Jan 1, 0001 | Dec 31, 9999 |
SMALLDATETIME | Jan 1, 1900 | June 6, 2079 | March 1, 1600 | Dec 31, 7910 |
For example, the Open Client MONEY and SMALLMONEY data types do not span the entire numeric range of their underlying Adaptive Server Anywhere implementations. Therefore, it is possible to have a value in an Adaptive Server Anywhere column which exceeds the boundaries of the Open Client data type MONEY. When the client fetches any such offending values via Adaptive Server Anywhere, an error is generated.
The Adaptive Server Anywhere implementation of the Open Client TIMESTAMP data type, when such a value is passed in Adaptive Server Anywhere, is different from that of Adaptive Server Enterprise. In Adaptive Server Anywhere, the value is mapped to the Adaptive Server Anywhere DATETIME data type. The default value is NULL in Adaptive Server Anywhere and no guarantee is made of its uniqueness. By contrast, Adaptive Server Enterprise ensures that the value is monotonically increasing in value, and so, is unique.
By contrast, the Adaptive Server Anywhere TIMESTAMP data type contains year, month, day, hour, minute, second, and fraction of second information. In addition, the DATETIME data type has a greater range of possible values than the Open Client data types that are mapped to it by Adaptive Server Anywhere.