Language Reference Guide : 2. Language Elements : Data Types
 
Share this page                  
Data Types
When you explicitly declare a variable, you must assign a data type to it. A simple variable can be any of the following supported data types:
Ingres DBMS Intrinsic Data Type
OpenROAD Intrinsic Data Type
OpenROAD System Class
OpenROAD Built-in Scalar Object
Client-side Coercion
Server-side Coercion
char
char
StringObject
yes
yes
character
char
StringObject
yes
yes
varchar
varchar
StringObject
yes
yes
character varying
varchar
StringObject
yes
yes
long varchar
not supported
LongVcharObject
no
no
clob
not supported
LongVcharObject
no
no
character large object
not supported
LongVcharObject
no
no
char large object
not supported
LongVcharObject
no
no
nchar
nchar*
StringObject
yes
yes
nvarchar
nvarchar*
StringObject
yes
yes
long nvarchar
not supported
yes
yes
nclob
not supported
no
no
nchar large object
not supported
no
no
national character large object
not supported
no
no
integer
integer, integer4
IntegerObject
yes
yes
integer4
integer, integer4
IntegerObject
yes
yes
smallint
smallint, integer2
IntegerObject
yes
yes
integer2
smallint, integer2
IntegerObject
yes
yes
bigint
integer8
none
yes
yes
integer8
integer8
IntegerObject
yes
yes
tinyint
integer1
yes
yes
integer1
integer1
IntegerObject
yes
yes
decimal
decimal
DecimalObject
yes
yes
float
float, float8
FloatObject
yes
yes
float8
float, float8
FloatObject
yes
yes
double precision
float, float8
FloatObject
yes
yes
float4
float4, real
FloatObject
yes
yes
real
float4, real
FloatObject
yes
yes
date
date
DateObject
yes
yes
ansidate
not supported
no
yes
ingresdate
date
DateObject
yes
yes
time
not supported
no
yes
time with time zone
not supported
no
yes
time without time zone
not supported
no
yes
time with local time zone
not supported
no
yes
timestamp
not supported
yes**
yes
timestamp with time zone
not supported
yes**
yes
timestamp without time zone
not supported
yes**
yes
interval year to month
not supported
no
yes
interval day to second
not supported
no
yes
money
money
MoneyObject
yes
yes
object key
not supported
no
no
table key
not supported
no
no
byte
not supported
no
no
byte varying
not supported
no
no
long byte
not supported
LongByteObject
no
no
blob
not supported
LongByteObject
no
no
binary long object
not supported
LongByteObject
no
no
numeric
numeric
no
no
dec
decimal
DecimalObject
no
no
boolean
not supported
no
yes
*OpenROAD transparent Unicode support negates the need for nchar and nvarchar data types to be used in OpenROAD 4GL applications. The nchar and nvarchar data types, introduced in OpenROAD 5.0, can be used only in a limited number of ways. The varchar data type with UTF8 encoding is all that is needed for Unicode support; to prevent nchar and nvarchar data types from being used accidentally, setthe environment variable, II_W4GL_ALLOW_NVARCHAR, to FALSE. If the variable is set to TRUE (the default), the nchar and nvarchar data types may be declared and used in OpenROAD 4GL applications. For more information about II_W4GL_ALLOW_NVARCHAR, see the Workbench User Guide.
Another environment variable, II_W4GL_PASS_NVARCHAR_AS_WCHAR, if set to TRUE, will pass any user 3GL procedure parameters of the data type nvarchar as wide chars to the user 3GL procedure. If it is set to FALSE, nvarchars will be coerced to chars before passing them to the user 3GL procedure. The default is FALSE. For more information about II_W4GL_PASS_NVARCHAR_AS_WCHAR, see the Workbench User Guide.
**Loss of precision
For more information about a specific data type, such as the length, see Storage Formats of Data Types. If you are using Enterprise Access, see the Enterprise Access documentation regarding data type specifics.
A reference or array variable can be any named user class or system class. For information about creating a named user class, see the Workbench User Guide.
By default, all data types are nullable. You can use the not null clause to declare a data type non-nullable. However, a class data type is always nullable.