Convert a record to a json notation.
Category
Format
Syntax
TO_JSON(datastore alias, record_alias, [, AFTER | BEFORE ])
Parameters and Descriptions
| Parameter | Description |
|---|---|
| datastore alias | The alias of an input datastore. |
| AFTER | Select the after image. This is the default. |
| BEFORE | Select the before image. Use this parameter to update records for a cdc input datastore. |
Example (Apply Engine)
Convert an input record to a JSON‑formatted string.
OUT_JSON = TO_JSON(IN_DS, IN_REC)This converts the after image of IN_REC from the input datastore IN_DS into a UTF‑8 encoded JSON string and assigns it to the target field OUT_JSON.
Example (Before image)
Convert the before image of a record from a CDC input datastore.
OUT_JSON = TO_JSON(CDC_DS, CDC_REC, BEFORE)Use BEFORE when the Apply Engine is processing change data and the prior state of the record is required.