- The Main body of the processing portion of the script.
- Initiates a processing loop beginning with the first record of the source datastore until the last record has been processed.
- The main processing section has three (3) commands:
- PROCESS INTO - The PROCESS INTO Command is used only once in the Apply Engine script. It initiates a processing loop beginning with the first record of the source datastore that continues until the last record from the source datastore has been processed.
- SELECT … FROM- Pair of commands (always used together) that defines the processing loop. Contains source-to-target mapping and transformation logic (if any), often implemented by calling named procedures (CALLPROC).
- UNION- Allows for “chaining” of multiple SELECT-FROM pairs [optional]
PROCESS INTO
PROCESS INTO identifies the target datastore(s) that will be acted upon by the script and is used in conjunction with the FOR <action> parameter specified in the DATASTORE command for the target datastore which explicitly states how the data will be applied to the target.
The PROCESS INTO command normally contains a single SELECT command, using this syntax:
PROCESS INTO <target_datastore(s)>
SELECT
{
Mapping logic and/or procedure calls go here
}
FROM <source_datastore>
where <target_datastore(s)>
is the name of a single target datastore or a comma-separated list of target datastores.
Syntax
PROCESS INTO <target_datastore> [, <target_datastore>]
SELECT [UNION];
SELECT
The SELECT sub-command performs the primary processing within the Apply Engine. This sub-command has the ability to perform the following:
- Reads records from a source datastore, returning the fields listed within the sub-command. This functionality is similar to the SQL SELECT command.
- Specifies the target fields that will be updated in one or more target datastores.
- Specifies the source to target field mapping where the results will be written to one or more target datastores.
- Enables the use of Apply Engine functions that can be used for business logic, data transformation, filtering, etc.
Syntax
SELECT
SELECT *
SELECT <source_field> [, <source_field>]
SELECT <source_field> [, <source_field>] <target_field> [, <target_field>]
SELECT <source_field> [, <source_field>] <field_alias> [, <field_alias>]
SELECT <function_set> [, <function_set>] <target_field> [, <target_field>]
SELECT <function_set> [, <function_set>] <field_alias> [, <field_alias>]
FROM source_datastore | NOTHING
;
UNION
The UNION sub-command chains multiple SELECT sub commands together within a the main Process Command to perform ‘multi-step’ processing within an Apply Engine script. When the UNION sub-command is used, the second SELECT sub-command is executed after the first SELECT sub-command has completed.
Syntax
UNION
SELECT [UNION];