GoldenGate Macro

* Valid for
– Extract
– Replicat
* Syntax

MACRO <macrochar><macro name>  # macrochar defaults to pound sign '#'
PARAMS (<macrochar><paramname> [, ...])  # Parameters passed to macro
BEGIN
<macro body>
END;

* Example

MACRO #make_date
PARAMS (#year, #month, #day)
BEGIN
@DATE("YYYY-MM-DD", "CC", @IF(#year < 50, 20, 19),
"YY", #year, "MM", #month, "DD", #day)
END;
 
-- Calls make_date macro from macro
MACRO #assign_date
PARAMS (#target_col, #year, #month, #day)
BEGIN
#target_col = #make_date (#year, #month, #day)
END;
This entry was posted in goldengate. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

This site uses Akismet to reduce spam. Learn how your comment data is processed.