Every column in a table has a name and a data type. The data type tells Informix how much physical storage to set aside for the column and the form in which the data is stored. This section includes information about Informix data types, null values, and data conversions.
Here are the data types that the Informix engine supports.
| CHAR(n) | NVARCHAR(m,n) |
| NCHAR(n) | TEXT |
| VARCHAR(m,n) | BYTE |
| DECIMAL | REAL |
| MONEY | SMALLFLOAT |
| NUMERIC | SERIAL |
| FLOAT | SMALLINT |
| DOUBLE PRECISION | INT8 |
| INTEGER | SERIAL8 |
| DATE | INTERVAL |
| DATETIME |
Informix has a special value that is called NULL. An Informix NULL value means an absence of information and is analogous to a SAS missing value. When SAS/ACCESS reads an Informix NULL value, it interprets it as a SAS missing value.
If you do not indicate a default value for an Informix column, the default value is NULL. You can specify the keywords NOT NULL after the data type of the column when you create an Informix table to prevent NULL values from being stored in the column. When you create an Informix table with SAS/ACCESS, you can use the DBNULL= data set option to indicate whether NULL is a valid value for specified columns.
For more information about how SAS handles NULL values, see Potential Result Set Differences When Processing Null Data.
To control how the DBMS handles SAS missing character values, use the NULLCHAR= and NULLCHARVAL= data set options.
This table shows the default formats that SAS/ACCESS Interface to Informix assigns to SAS variables when using the LIBNAME statement to read from an Informix table. These default formats are based on Informix column attributes. To override these default data types, use the DBTYPE= data set option on a specific data set.
|
Informix Column Type |
Default SAS Format |
|---|---|
|
CHAR(n) |
$n |
|
DATE |
DATE9. |
|
DATETIME3 |
DATETIME24.5 |
|
DECIMAL |
m+2.n |
|
DOUBLE PRECISION |
none |
|
FLOAT |
none |
|
INTEGER |
none |
|
INT82 |
none |
|
INTERVAL |
$n |
|
MONEY |
none |
|
NCHAR(n) |
$n NLS support required |
|
NUMERIC |
none |
|
NVARCHAR(m,n)1 |
$m NLS support required |
|
REAL |
none |
|
SERIAL |
none |
|
SERIAL82 |
none |
|
SMALLFLOAT |
none |
|
SMALLINT |
none |
|
TEXT1 |
$n |
|
VARCHAR(m,n)1 |
$m |
| 1 Supported only by Informix online databases. | |
| 2 The precision of an INT8 or SERIAL8 is 15 digits. | |
| 3 If the Informix field qualifier specifies either HOUR, MINUTE, SECOND, or FRACTION as the largest unit, the value is converted to a SAS TIME value. All other values (such as YEAR , MONTH , or DAY) are converted to a SAS DATETIME value. | |
The following table shows the default Informix data types that SAS/ACCESS applies to SAS variable formats during output operations when you use the LIBNAME statement.
|
SAS Variable Format |
Informix Data Type |
|
|---|---|---|
|
$w. |
CHAR(w). |
|
|
w. with SAS format name of NULL |
DOUBLE |
|
|
w.d with SAS format name of NULL |
DOUBLE |
|
|
all other numerics |
DOUBLE |
|
|
datetimew.d |
DATETIME YEAR TO FRACTION(5) |
|
|
datew. |
DATE |
|
|
time. |
DATETIME HOUR TO SECOND |
|
The SQL pass-through facility uses the same default conversion formats as the LIBNAME statement. For conversion tables, see LIBNAME Statement Data Conversions.