update strategy
DESCRIPTION
Update StrategyTRANSCRIPT
-
6/4/2015 UpdateStrategyTransformationinInformatica
http://www.folkstalk.com/2012/05/updatestrategytransformationin.html 1/2
Home DataWarehouse Informatica InformaticaScenarios Oracle Unix Hadoop Subscribe
UpdateStrategyTransformationinInformatica
Updatestrategytransformationisanactiveandconnectedtransformation.Updatestrategytransformationisusedtoinsert,update,anddeleterecordsinthetargettable.Itcanalsorejecttherecordswithoutreachingthetargettable.Whenyoudesignatargettable,youneedtodecidewhatdatashouldbestoredinthetarget.
Whenyouwanttomaintainahistoryorsourceinthetargettable,thenforeverychangeinthesourcerecordyouwanttoinsertanewrecordinthetargettable.Whenyouwantanexactcopyofsourcedatatobemaintainedinthetargettable,thenifthesourcedatachangesyouhavetoupdatethecorrespondingrecordsinthetarget.
Thedesignofthetargettabledecideshowtohandlethechangestoexistingrows.Intheinformatica,youcansettheupdatestrategyattwodifferentlevels:
SessionLevel:Configuringatsessionlevelinstructstheintegrationservicetoeithertreatallrowsinthesameway(Insertorupdateordelete)oruseinstructionscodedinthesessionmappingtoflagfordifferentdatabaseoperations.MappingLevel:Useupdatestrategytransformationtoflagrowsforinert,update,deleteorreject.
FlaggingRowsinMappingwithUpdateStrategy:
Youhavetoflageachrowforinserting,updating,deletingorrejecting.Theconstantsandtheirnumericequivalentsforeachdatabaseoperationarelistedbelow.
DD_INSERT:Numericvalueis0.UsedforflaggingtherowasInsert.DD_UPDATE:Numericvalueis1.UsedforflaggingtherowasUpdate.DD_DELETE:Numericvalueis2.UsedforflaggingtherowasDelete.DD_REJECT:Numericvalueis3.UsedforflaggingtherowasReject.
Theintegrationservicetreatsanyothernumericvalueasaninsert.
UpdateStrategyExpression:
Youhavetoflagrowsbyassigningtheconstantnumericvaluesusingtheupdatestrategyexpression.Theupdatestrategyexpressionpropertyisavailableinthepropertiestaboftheupdatestrategytransformation.
Eachrowistestedagainsttheconditionspecifiedintheupdatestrategyexpressionandaconstantvalueisassignedtoit.Asampleexpressionisshowbelow:
IIF(department_id=10,DD_UPDATE,DD_INSERT)
MostlyIIFandDECODEfunctionsareusedtotestforaconditioninupdatestrategytransformation.
UpdateStrategyandLookupTransformations:
Updatestrategytransformationisusedmostlywithlookuptransformation.Therowfromthesourcequalifieriscomparedwithrowfromlookuptransformationtodeterminewhetheritisalreadyexistsoranewrecord.Basedonthiscomparison,therowisflaggedtoinsertorupdateusingtheupdatestrategytransformation.
UpdateStrategyandAggregatorTransformations:
Ifyouplaceanupdatestrategybeforeanaggregatortransformation,thewaytheaggregatortransformationperformsaggregatecalculationsdependsontheflaggingoftherow.Forexample,ifyouflagarowfordeleteandthenlaterusetherowtocalculatethesum,thentheintegrationservicesubtractsthevalueappearinginthisrow.Ifitsflaggedforinsert,thenthe
Search... Search
SedCommandinUnixandLinuxExamples
TopExamplesofAwkCommandinUnix
FindCommandinUnixandLinuxExamples
CutCommandinUnix(Linux)Examples
InformaticaScenarioBasedInterviewQuestionswithAnswersPart1
StringFunctionsinHive
SQLQueriesInterviewQuestionsOraclePart1
DateFunctionsinHive
TypesofDimensionsindatawarehouse
GrepCommandinUnixandLinuxExamples
PopularPosts
vijaybhaskar
339havemeincircles Viewall
Addtocircles
HaveQuestions?FollowMe
-
6/4/2015 UpdateStrategyTransformationinInformatica
http://www.folkstalk.com/2012/05/updatestrategytransformationin.html 2/2
NewerPost OlderPostHome
aggregatoraddsitsvaluetothesum.
ImportantNote:
Updatestrategyworksonlywhenwehaveaprimarykeyonthetargettable.Ifthereisnoprimarykeyavailableonthetargettable,thenyouhavetospecifyaprimarykeyinthetargetdefinitioninthemappingforupdatestrategytransformationtowork.
RecommendedReading:
UpdateStrategySessionLevelSettingsSQLTransformationInformaticaScenariosUpdateStrategyTransformationinInformaticaStoredProcedureTransformationinInformaticaLookupTransformationinInformatica
Ifyoulikethisarticle,thenpleaseshareitorclickonthegoogle+1button.
pnrstatus privacypolicy