0% found this document useful (0 votes)
112 views

Update Strategy Transformation in Informatica

The update strategy transformation in Informatica flags rows for insert, update, delete, or reject operations in the target table. It is used with lookup and aggregator transformations to determine how to handle existing and new records. The update strategy can be configured at the session or mapping level, with mappings using expressions to test conditions and assign constant values that indicate the operation. Having a primary key is required for the update strategy to determine which rows in the target table correspond to rows in the source.

Uploaded by

Abdul Mateen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
112 views

Update Strategy Transformation in Informatica

The update strategy transformation in Informatica flags rows for insert, update, delete, or reject operations in the target table. It is used with lookup and aggregator transformations to determine how to handle existing and new records. The update strategy can be configured at the session or mapping level, with mappings using expressions to test conditions and assign constant values that indicate the operation. Having a primary key is required for the update strategy to determine which rows in the target table correspond to rows in the source.

Uploaded by

Abdul Mateen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

6/4/2015

UpdateStrategyTransformationinInformatica

UpdateStrategyTransformationinInformatica
Updatestrategytransformationisanactiveandconnectedtransformation.Updatestrategy transformationisusedtoinsert,update,anddeleterecordsin
thetargettable.Itcanalso rejecttherecordswithoutreachingthetargettable.Whenyoudesignatargettable,youneed todecidewhatdatashouldbe
storedinthetarget.
Whenyouwanttomaintainahistoryorsourceinthetargettable,thenforeverychangein thesourcerecordyouwanttoinsertanewrecordinthetarget
table.
Whenyouwantanexactcopyofsourcedatatobemaintainedinthetargettable,thenifthe sourcedatachangesyouhavetoupdatethecorresponding
recordsinthetarget.
Thedesignofthetargettabledecideshowtohandlethechangestoexistingrows.Inthe informatica,youcansettheupdatestrategyattwodifferent
levels:
SessionLevel:Configuringatsessionlevelinstructstheintegrationserviceto eithertreatallrowsinthesameway(Insertorupdateordelete)oruse
instructions codedinthesessionmappingtoflagfordifferentdatabaseoperations.
MappingLevel:Useupdatestrategytransformationtoflagrowsforinert,update, deleteorreject.
FlaggingRowsinMappingwithUpdateStrategy:

Youhavetoflageachrowforinserting,updating,deletingorrejecting.Theconstantsand theirnumericequivalentsforeachdatabaseoperationarelisted
below.
DD_INSERT:Numericvalueis0.UsedforflaggingtherowasInsert.
DD_UPDATE:Numericvalueis1.UsedforflaggingtherowasUpdate.
DD_DELETE:Numericvalueis2.UsedforflaggingtherowasDelete.
DD_REJECT:Numericvalueis3.UsedforflaggingtherowasReject.
Theintegrationservicetreatsanyothernumericvalueasaninsert.
UpdateStrategyExpression:

Youhavetoflagrowsbyassigningtheconstantnumericvaluesusingtheupdatestrategy expression.Theupdatestrategyexpressionpropertyis
availableinthepropertiestabofthe updatestrategytransformation.
Eachrowistestedagainsttheconditionspecifiedintheupdatestrategyexpressionanda
constantvalueisassignedtoit.Asampleexpressionisshowbelow:
IIF(department_id=10,DD_UPDATE,DD_INSERT)

MostlyIIFandDECODEfunctionsareusedtotestforaconditioninupdatestrategy transformation.
UpdateStrategyandLookupTransformations:

Updatestrategytransformationisusedmostlywithlookuptransformation.Therowfromthe sourcequalifieriscomparedwithrowfromlookup
transformationtodeterminewhetheritis alreadyexistsoranewrecord.Basedonthiscomparison,therowisflaggedtoinsertor updateusingtheupdate
strategytransformation.
UpdateStrategyandAggregatorTransformations:

Ifyouplaceanupdatestrategybeforeanaggregatortransformation,thewaytheaggregator transformationperformsaggregatecalculationsdependson
theflaggingoftherow.For example,ifyouflagarowfordeleteandthenlaterusetherowtocalculatethesum,thenthe integrationservicesubtractsthe
valueappearinginthisrow.Ifitsflaggedforinsert,thenthe
aggregatoraddsitsvaluetothesum.
ImportantNote:

Updatestrategyworksonlywhenwehaveaprimarykeyonthetargettable.Ifthereisno primarykeyavailableonthetargettable,thenyouhavetospecifya
primarykeyinthetarget definitioninthemappingforupdatestrategytransformationtowork.

You might also like