Thursday, August 7, 2014

Goldengate Filter data based on Before image and and after Value in Extract.

Links to this post
Below is example to filter data based on Existing value or before image in column and New updated value .

This is used in 11.2 OGG. In OGG 12C use @BEFORE to Get before image.

So X_COMMAND will appear as "REFRESH" If status change from Inactive to Active.

X_COMMAND=@IF (((@STRFIND(before.STATUS, "Inactive") > 0 ) and (@STRFIND(STATUS, "Active") >0 )) > 0 , "REFRESH", @CASE(@GETENV("GGHEADER", "OPTYPE"), "SQL COMPUPDATE", "UPDATE", "PK UPDATE", "UPDATE"))


You can also use this code for compare Exist and new value.
((@STRFIND(before.STATUS, "Inactive") > 0 ) and (@STRFIND(STATUS, "Active") >0 )) > 0 .