OpenEdge ABL to JavaScript data type mappings
- Last Updated: June 25, 2019
- 3 minute read
- OpenEdge
- Version 13.0
- Documentation
A JSDO communicates with an OpenEdge application server through a Data Object Service to marshal ABL data for parameters (and return values) of ABL routines that pass the following ABL data types: ProDataSets, temp-tables, arrays, and primitive values. The JSDO provides this ABL data to the mobile app programmer as JavaScript data. For more information on ABL data types, see the reference entry on data types in OpenEdge Development: ABL Reference. For more information on the format and use of JavaScript data types, you can review sources on the web, such as http://www.w3schools.com/js/js_datatypes.asp. For more information on JSDOs and how they communicate with an OpenEdge application server through a Data Object Service, see progress.data.JSDO class.
The following table shows the mappings between the supported ABL data
types in an OpenEdge Data Object resource and the JavaScript data types of corresponding
table fields and invocation method parameter values in a JSDO. These data type conversions
happen in the server-side Data Object when the JSDO invokes a resource operation that
exchanges data between the JSDO and its OpenEdge resource using the fill( ), saveChanges( ), or any invocation
method.
?) maps to the JavaScript null value when sent from the OpenEdge Data Object resource to
the JSDO, and a JSDO data item or invocation method input parameter value that is set to
null maps to the ABL Unknown value (?) when sent from the JSDO to the OpenEdge Data Object resource.
The ABL BLOB and CLOB
are only allowed as fields of temp-table parameters, and their respective equivalents,
MEMPTR and LONGCHAR, are
only allowed as scalar parameters or as elements of Array
parameters.| ABL data type | JavaScript data type |
|---|---|
BLOB1
|
string (Base64 encoded) |
CHARACTER
|
string
|
CLOB1
|
string
|
COM-HANDLE
|
number
|
DATASET2
|
An Object that
maps to a ProDataSet and contains one or more Object instances, each of which maps to an ABL temp-table in the
ProDataSet (see TEMP-TABLE) |
DATE3
|
string (ISO 8601 formatted string of the form
"yyyy-mm-dd") |
DATETIME3
|
string (ISO 8601 formatted string of the form
"yyyy-mm-ddThh:mm:ss.sss") |
DATETIME-TZ3
|
string (ISO 8601 formatted string of the form
"yyyy-mm-ddThh:mm:ss.sss+hh:mm") |
DECIMAL
|
number
|
primitive
EXTENT2
|
Where primitive
is an ABL primitive data type (not a DATASET or
TEMP-TABLE), maps to an Array of the JavaScript primitive data type that maps to the
corresponding ABL primitive data type |
HANDLE
|
number
|
INT64
|
number
|
INTEGER
|
number
|
LOGICAL
|
boolean (true or
false) |
LONGCHAR4
|
string
|
MEMPTR4
|
string (Base64 encoded) |
RAW
|
Not supported |
RECID
|
Not supported |
ROWID
|
string (Base64 encoded) |
TEMP-TABLE2
|
An Object that
contains a single Array of Object instances, where each Object in the Array maps to a record
in the corresponding temp-table |
Date and time conversions
In the JSDO, all ABL DATE, DATETIME, and DATETIME-TZ data
types are mapped to a string in the ISO 8601 format shown
in the previous table. This format supports all the necessary functionality for these data
types (date, time, and time zone data). However, if you read and convert (Output) this string from the JSDO
to a JavaScript Date object, or write (Input) the value of a JavaScript Date object to the
JSDO as a similarly ISO 8601-formatted string, the JSDO
processes the value differently based on the original ABL data type in the OpenEdge
resource, as shown in the following table:
| ABL data type | Process |
|---|---|
DATE |
Output: Client time zone
is used. Time is set to 0 (midnight). Input: Time and time zone information is ignored. |
DATETIME |
Output: Client time zone
is used. Input: Time zone information is ignored |
DATETIME-TZ |
Output and Input: Date, time, and time zone is preserved. |
Date objects.