Striim 3.10.3 documentation

Adding user-defined data to WAEvent streams

Use the PutUserData function in a CQ to add an element to the WAEvent USERDATA map. Elements in USERDATA may be inserted into DatabaseWriter output as described in Modifying output using ColumnMap or used to partition KafkaWriter output among multiple partitions as discussed in Enhancing your Oracle to Kafka application.

The following example would add the sixth element (counting from zero) in the WAEvent data array to USERDATA as the field "city":

INSERT INTO OracleSourceWithPartitionKey
SELECT putUserData(x, 'city',data[5])
FROM OracleSourcre_ChangeDataStream x;

You may add multiple fields, separated by commas:

SELECT putUserData(x, 'city',data[5], 'state',data[6])

For examples of how to use Userdata elements in TQL, see Modifying output using ColumnMap and the discussions of PartitionKey in Kafka Writer and S3 Writer.

To remove an element from USERDATA, use the removeUserData function (you may specify multiple elements, separated by commas):

CREATE CQ RemoveUserData
INSERT INTO OracleSourceWithPartitionKey
SELECT removeUserData(x, 'city')
FROM OracleSourcre_ChangeDataStream x;

To remove all elements from the USERDATA map, use the clearUserData function:

CREATE CQ ClearUserData
INSERT INTO OracleSourceWithPartitionKey
SELECT clearUserData(x)
FROM OracleSourcre_ChangeDataStream x;