Change Data Processing

In addition to, or instead of, updating a destination table, SQDR can be configured to invoke a user-supplied stored procedure to process the Change Data information for purposes of auditing or "push" notifications. The stored procedure can reside either in the SQDR control database or the destination database, and can be used to perform a business process task such as inserting a message into a message system such as IBM WebSphere MQ or Microsoft Message Queuing (MSMQ), sending an email, or logging changes in a database table for auditing purposes.

The Stelo-supplied SQL stored procedure SQLOGGER (dbo.SQLOGGER for SQL Server and SQDR.SQLOGGER for Db2 LUW) can be used as a model for your own stored procedure. SQLOGGER resides in the SQDR control database and is used to populate the ir_keylog control table, which is a log of the communication between the SQDR Plus system and the client system (running SQDR) as it relates to the application of changes to the destination table (DDL and DML).

Another stored procedure example illustrates the use of a Java stored procedure to write change data to a text file - see Change Data Processing - Java example.

The stored procedure is configured in the Group Properties Advanced tab; you can choose whether to receive complete data (with the exception of large LOB fields) or just the keys associated with the change.  If Errors-Only is selected, then data is provided when an error occurs.

Change Data Processing is in addition to other Apply functions (i.e. maintaining the destination tables with change data).

In addition, see the script IR_Keylog.sql in the Tools subdirectory and the following technical documents: