Mapping with functions - connect_cdc_sqdata - Latest

Connect CDC (SQData) Apply engine

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
Connect > Connect CDC (SQData)
Version
Latest
Language
English
Product name
Connect CDC (SQData)
Title
Connect CDC (SQData) Apply engine
Copyright
2024
First publish date
2000
Last edition
2024-07-30
Last publish date
2024-07-30T20:19:56.898694

Mapping with functions is similar to straight mapping, except that one or more functions manipulate the source data before it is mapped to the target Description.

As with straight mapping, mapping with functions must be performed within the SELECT sub-command.

The following examples illustrate how you can use functions to accomplish some commonly used mapping scenarios.

Example 1

Concatenating Multiple Source Fields into a Single Target Field

Concatenate SOURCE_FIELD1 and SOURCE_FIELD2 and map the result to TARGET_FIELD1 using the STRING function.
PROCESS INTO OUTPUT_DATASTORE
SELECT
    TARGET_FIELD1   = STRING(SOURCE_FIELD1,   SOURCE_FIELD2)
FROM INPUT_DATASTORE;

Example 2

Adding Multiple Numeric Fields and Storing the Result in a Target Field

Add SOURCE_FIELD1 and SOURCE_FIELD2 together and map them to TARGET_FIELD1 using the ADD function. Add SOURCE_FIELD2 and SOURCE_FIELD3 together and map them to TARGET_FIELD2 using the plus sign (+) operator.
PROCESS INTO OUTPUT_DATASTORE
SELECT
{
   TARGET_FIELD1   = ADD(SOURCE_FIELD1, SOURCE_FIELD2)
   TARGET_FIELD2   = SOURCE_FIELD2 + SOURCE_FIELD3
}
FROM INPUT_DATASTORE;

Example 3

Extract a Portion of a Source Field Before Mapping it to a Target Field

Extract the first three characters of SOURCE_FIELD1 and map them to TARGET_FIELD1. Extract the last three (3) characters of SOURCE_FIELD2 map them to TARGET_FIELD2.
PROCESS INTO OUTPUT_DATASTORE
SELECT
{
   TARGET_FIELD1 = LEFT(SOURCE_FIELD1, 3)
   TARGET_FIELD2 = RIGHT(SOURCE_FIELD2, 3)
}
FROM INPUT_DATASTORE;

Example 4

Translate a Source Field Before Mapping it to a Target Field

Convert the binary data in SOURCE_FIELD1 (3 bytes) to its hexadecimal value and map the result to TARGET_FIELD1.
PROCESS INTO OUTPUT_DATASTORE
SELECT
   TARGET_FIELD1 = B2X(SOURCE_FIELD1, 3)
FROM INPUT_DATASTORE;