The Informix database interfaces support the Informix datatypes listed in the following table in DataWindow objects and embedded SQL.
Blob |
LVarChar |
Boolean |
Money |
Byte (a maximum of 2^31 bytes) |
NChar |
Char |
NVarChar |
Clob |
Real |
Date |
Serial |
DateTime |
Serial8 |
Decimal |
SmallInt (2 bytes) |
Float |
Text (a maximum of 2^31 bytes) |
Int8 |
Time |
Integer (4 bytes) |
VarChar (1 to 255 bytes) |
Interval |
|
Datatype conversion
When you retrieve or update columns, PowerBuilder converts data appropriately between the Informix datatype and the PowerScript datatype. Keep in mind, however, that similarly or identically named Informix and PowerScript datatypes do not necessarily have the same definitions.
For information about the definitions of PowerScript datatypes, see Datatypes in PowerScript Reference.
The DateTime datatype is a contiguous sequence of boxes. Each box represents a component of time that you want to record. The syntax is:
DATETIME largest_qualifier TO smallest_qualifier
PowerBuilder defaults to Year TO Fraction(5).
For a list of qualifiers, see your Informix documentation.
To create your own variation of the DateTime datatype:
-
In the Database painter, create a table with a DateTime column.
For instructions on creating a table, see the section called “Working with tables” in Users Guide.
-
In the Columns view, select Pending Syntax from the Objects or pop-up menu.
The Columns view displays the pending changes to the table definition. These changes execute only when you click the Save button to save the table definition.
-
Select Copy from the Edit or pop-up menu or click the Copy button.
The SQL syntax (or the portion you selected) is copied to the clipboard.
-
In the ISQL view, modify the DateTime syntax and execute the CREATE TABLE statement.
For instructions on using the ISQL view, see Users Guide.
The Informix database interfaces also support a time datatype. The time datatype is a subset of the DateTime datatype. The time datatype uses only the time qualifier boxes.