How to configure the Data Event poller to use a view as the source table

How to configure the Data Event poller to use a view as the source table

book

Article ID: KB0070865

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks Plug-in for Database 8.x

Description

The Data Event poller utilizes the trigger to copy records from the source table to the publishing table when there is an insert/update/delete operation happens to the source table. Due to the inherent limitations of triggers not being applicable to views, the DataEvent poller doesn't support using a view when fetching the schema. Therefore, please follow the below steps to configure the Data Event poller when using a view as the source table:

Environment

Product: TIBCO ActiveMatrix BusinessWorks Plug-in for Database Version: 8.x OS: All Supported Operating Systems

Resolution

1 If the view is generated from one source table, the user can select the original source table when fetching the schema. Please select only the columns that are used by the view at the edit table page.
2 If the view is generated from multiple source tables or the user doesn't want to expose the original source table name in the plugin configuration, the user must create a dummy table that has the exact same columns as the view, and then select the dummy table when fetching the schema.
3 Please select "Publish by Reference" at the option page, and select the view as the "Referred Object".
4 Please select "Generate Trigger" on the "General" tab of the Data Event Poller activity.
5 Open the generated trigger script file. Change the dummy table name to the name of one of the source tables.

After the above configuration, the user can delete the dummy table. In runtime, when there is an insert/update/delete operation happens to the source tables, the primary key will be copied to the publishing table. The plugin will retrieve the primary key from the publishing table and then use the primary key to retrieve the record from the View.

Issue/Introduction

How to configure the Data Event poller to use a view as the source table