Read JSON into a data object with defined schema
- Last Updated: June 13, 2019
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
The READ-JSON( ) method functions in one of
two ways, depending on whether or not its target ABL data object has a defined schema. The
most predictable results come when you read JSON data into a data object with a defined
schema. In this case, the AVM uses the names to match the ABL ProDataSet, temp-tables, and
fields to the JSON objects and name/value pairs. It ignores JSON data for any unmatched data
object or field. The AVM raises an error if a matching JSON value does not match the
corresponding ABL field's data type.
The following procedure reads the JSON data that was output by write-json-pds2.p into a ProDataSet that uses a subset of the fields in the original temp-table. It then writes the new ProDataSet out as JSON to another file:
|
When you compare the JSON files, you see that only the data that fit into the new ProDataSet made it from dsOrderLog2.json to dsOrderLog3.json.