Uniface Data Types
Data types are classifications for data containers, such as fields, variables, parameters, and return values. They define the characteristics of the data and determine how the data is handled during processing and storage. Uniface has scalar data types and reference data types.
Uniface performs implicit type conversion when required. For more information, see Type Conversion.
Scalar Data Types
Scalar data types define single units of data, such as a number, date, or string of characters. When storing data, Uniface scalar data types are matched to DBMS-specific data types (known as storage formats) via packing codes. Packing codes are mappings between Uniface data types and DBMS storage formats. When writing a field, Uniface passes the data and a valid packing code to the DBMS connector, which uses the packing code to determine the appropriate storage format for storing the data in the target DBMS.
Data Type | Packing Code |
Allowed Values | Remarks |
---|---|---|---|
boolean | B | T or
F , 1 or 0 |
For more information, see boolean. |
date | D | Integer representing a date in the format ccyymmdd | For more information, see date. |
datetime | E | Integer representing a date and time in the format ccyymmddhhnnss | Combined date and Time. For more information, see datetime. |
float | F | Number with a floating decimal point | Floating decimal point to allow high precision data and calculations. For more information, see float. |
image | I | Binary data for an image | For more information, see image. |
lineardate | LD | Integer from 0 through
3652425 |
Linear Date represents a number of days. For more information, see lineardate. |
lineardatetime | LE | Number from 0 through
10000 |
Linear Date and Time represents a number of days. Partial days (hours, minutes, seconds) can be expressed as a fraction of a day. For more information, see lineardatetime. |
lineartime | LT | Integer from 0 through
24 |
Linear Time represents a number of hours. For more information, see lineartime. |
numeric | N | Number to a maximum of 9 decimal places,
including + , - , and decimal point . |
For more information, see numeric. |
raw | R | Binary data | For more information, see raw. |
string | S | Any characters in the UTF-8 character set, or an empty string. | For more information, see string. |
time | T | Integer representing a date in the format hhnnss | For more information, see time. |
xmlstream | XM | Well-formed XML data |
For more information, see xmlstream. |
Reference Data Types
Reference data types define a pointer to a specific type of data structure held in memory; they do not contain the data itself.
Data Type | Allowed Values | Restrictions |
---|---|---|
entity
|
All occurrences of the specified entity | entity and
occurrence are:
For more information, see entity and occurrence . |
occurrence
|
Current occurrence of the specified entity | |
handle
|
Reference to a component instance | Allowed only for variables and parameters, and for non-database fields. For more information, see Handles and handle. |
struct
|
Reference to a Struct; used for complex, dynamic data | Allowed only for variables and parameters, and for partner operations. For more information, see Structs and struct. |
Any Data Type
The any data type is a special case, in that a container with this data type can be assigned a value of any other data type, at which point it takes on the data type of its value.
The any data type can only be used in component variables, global variables, and in the parameters of Global ProcScripts and entries.
For more information, see any.
Specifying Data Types
When defining fields and global variables, you can select the data type in the Data Type property.
When and component variables In ProcScript, you can specify a data type when defining parameters and variables in params and variables blocks, or when defining a return value for a user-defined function (using returns). For example:
operation doThis params string pInput : IN endparms variables numeric vCounter endvariables ... do something ... end