Read( ) method (JsonObject)
- Last Updated: October 30, 2020
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
Uses the data from a ProDataSet, temp-table, or buffer handle to generate a JsonObject. The current contents of the JsonObject are removed.
Return type: LOGICAL
Access: PUBLIC
Applies to: Progress.Json.ObjectModel.JsonObject class
Syntax
|
- pds-handle
- A HANDLE to either a static ProDataSet or dynamic ProDataSet
to be used as the source for setting the JsonObject. If this value
is the Unknown value (
?), a JsonError is raised. - tt-handle
- A HANDLE to either a static temp-table or dynamic temp-table
to be used as the source for setting the JsonObject. If this value
is the Unknown value (
?) a JsonError is raised. - buffer-handle
- A HANDLE to either a static temp-table buffer or dynamic temp-table
buffer to be used as the source for setting the JsonObject. If this value
is the Unknown value (
?), a JsonError is raised.Note: The value of the JsonObject is based on the one row in the buffer, not the entire table. This behavior differs fromWRITE-JSON( )andWRITE-XML( ). Those methods process the entire table associated with the buffer. - omit-initial-values
- A LOGICAL expression where TRUE directs the AVM to exclude temp-table
fields containing their initial values from the JSON object, and FALSE
directs the AVM to include all temp-table field data in the JSON. The
default value is FALSE. If you specify the Unknown value (
?), the method uses the default value of FALSE.When working with large ProDataSets, omitting fields containing their initial values can yield smaller JSON values, more efficient network transfers, and performance gains with the
JsonObject( )constructor.This behavior applies both to temp-table fields that have the default initial value for its data type, and for fields that have an initial value set with the ABL INITIAL option. When a temp-table handle is passed to
JsonObject:Read( ), the JsonObject is set to a single property. - read-before-image
- A LOGICAL expression where TRUE directs the AVM to include ProDataSet
before-image data and error information in the JSON object. The
default value is FALSE. If you specify the Unknown value (
?), the method uses the default value of FALSE.
Notes
- You cannot execute the method on a database buffer.
- When executing the method, there is no guarantee as to the contents of the buffers involved after the method finishes executing.
Example
The following example shows a temp-table definition
passed to JsonObject:Read( ):
|
The following is the resultant JSON construct
tree, myLongchar:
|