Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
IBM InfoSphere Replication Server and Data Event Publisher

You're reading from  IBM InfoSphere Replication Server and Data Event Publisher

Product type Book
Published in Aug 2010
Publisher Packt
ISBN-13 9781849681544
Pages 344 pages
Edition 1st Edition
Languages
Concepts
Authors (2):
Pav Kumar-Chatterjee Pav Kumar-Chatterjee
Profile icon Pav Kumar-Chatterjee
Pav Kumar Chatterjee Pav Kumar Chatterjee
Profile icon Pav Kumar Chatterjee
View More author details

Table of Contents (12) Chapters

IBM InfoSphere Replication Server and Data Event Publisher
Credits
About the Author
About the Reviewer
1. Preface
1. Q Replication Overview 2. Q Replication Components 3. The DB2 Database Layer 4. WebSphere MQ for the DBA 5. The ASNCLP Command Interface 6. Administration Tasks 7. Monitoring and Reporting

Q replication filtering and transformations


Let's first look at what is possible when it comes to filtering rows and columns, and then move on to look at transformations.

Filtering rows/columns

Let's first look at row filtering. It is only possible to filter rows for replication in a unidirectional scenario, and this is done in the Q subscription. For an example, see the Creating a Q subscription section of Chapter 6.

What about the number of columns we want to replicate—can we replicate just a subset of the source table columns? For the latest release of code, we can subset the columns to be replicated. Note that we cannot replicate more columns than are defined at the target table or target stored procedure and that the column names must still match, which is shown in the following diagram:

For unidirectional replication only, the target table can have more columns than the source table as shown in the following diagram, but these "non-source" columns cannot be part of the target table key and must be defined as NULLABLE or NOT NULL WITH DEFAULT, as shown next.

Any filtering of rows or columns in unidirectional replication is specified at Q subscription definition time. At this time, we can specify:

  • Which columns to replicate and how they map to columns at the target table (or to parameters in a stored procedure)

  • A search condition to determine which rows from the source table are replicated

As stated at the beginning of this chapter, Q replication is built for speed with transformations not being a major factor. However, although Q replication does not have the transformation capabilities of SQL Replication, it does have some transformation capabilities, which are described in the following sections.

Before and After SQL—alternatives

In Q replication, there is no concept of before and after SQL, as there is in SQL Replication. In a unidirectional setup, we can use SQL expressions to transform data between the source and target tables. We can map multiple source columns to a single target column, or to create other types of computed columns at the target. An example is shown in the Q subscription for unidirectional replication section of Chapter 5 .

Stored procedure processing

If we want to perform transformations with Q replication, then we need to use stored procedure processing. This allows us to call external routines to perform all the transformations we want. The Replication to a stored procedure section of Appendix A shows an example of how to set up Q replication to a stored procedure.

We now move on to look at conflict detection in a Q replication environment.

You have been reading a chapter from
IBM InfoSphere Replication Server and Data Event Publisher
Published in: Aug 2010 Publisher: Packt ISBN-13: 9781849681544
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}