informatica tips 1

Upload: svdontha

Post on 06-Jul-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/17/2019 Informatica Tips 1

    1/40

    Rules and Guidelines for Connecting Mapping Objects

    If the Designer detects an error when you try to link ports between two mapping objects,it displays a symbol indicating that you cannot link the ports.

    Consider the following rules and guidelines when you connect mapping objects:

    • Follow logic of data flow in the mapping. Gien the logic of the data flow

     between sources and targets, you can link the following types of ports:

    o !he receiing port must be an input or input"output port.

    o !he originating port must be an output or input"output port.

    o #ou cannot link input ports to input ports or output ports to output ports.

    • #ou must link at least one port of an input group to an upstream transformation.

    • #ou must link at least one port of an output group to a downstream

    transformation.

    • #ou can link ports from one actie transformation or one output group of an

    actie transformation to an input group of another transformation.• #ou cannot connect an actie transformation and a passie transformation to the

    same downstream transformation or transformation input group.

    • #ou cannot connect more than one actie transformation to the same downstream

    transformation or transformation input group.

    • #ou can connect any number of passie transformations to the same downstream

    transformation, transformation input group, or target.

    • #ou can link ports from two output groups in the same transformation to one

    $oiner transformation configured for sorted data as long as the data from both

    output groups is sorted.

    • #ou can only link ports with compatible datatypes. !he Designer erifies that it

    can map between the two datatypes before linking them. !he %owerCenter &erercannot transform data between ports with incompatible datatypes. 'hile the

    datatypes do not hae to be identical, they do hae to be compatible, such as Charand (archar. For a list of compatible datatypes

    • #ou must connect a source definition to a source )ualifier only. *ery source must

    connect to a source )ualifier or +ormalier transformation. #ou then link the

    source )ualifier or +ormalier to targets or other transformations.

    • #ou can link columns to a target definition in a mapping, but you cannot copy

    columns into a target definition in a mapping. -se the 'arehouse Designer to add

    columns to a target definition.

    'hen you edit a port name in a transformation, by default, the Designer propagatesreferences to that port in the epressions, conditions, and other ports in that

    transformation. #ou can also propagate changed attributes throughout the mapping.

    !he Designer propagates ports, epressions, and conditions based on the following

    factors:

  • 8/17/2019 Informatica Tips 1

    2/40

  • 8/17/2019 Informatica Tips 1

    3/40

    • -pdates the associated port property in a dynamic 3ookup transformation if the

    associated port name changes.

    • -pdates the port name of Custom transformation port dependencies.

    #ote$ 'hen you propagate a port name, the Designer appends 415 to the port name if a

     port with the same name already eists in the transformation.

    %&a!ple

    &uppose you hae the following mapping:

    !he 6!# port in the $oiner transformation links to the 6!# port in the 2ggregator

    transformation. !he 2ggregator transformation references the 6!# port in theepressions for !7!2386-2+!I!# and !7!2389*(*+-*.

    #ou make the following changes to the 6!# port in the $oiner transformation:

    • #ou change the port name 6!# to 6-2+!I!#.

    • #ou change the datatype from Decimal to Integer.

    'hen you propagate forward the attributes, the Designer updates the followingdependencies in the 2ggregator transformation:

    • !he Designer updates 6!# port name to 6-2+!I!#.

    • !he Designer updates the reference to 6!# port name in the epressions for the

    !7!2386-2+!I!# and !7!2389*(*+-* ports change to 6-2+!I!#.• !he Designer updates the datatype of 6!# port name to Integer.

    "ropagating !plicit Dependencies

    #ou can propagate datatype, precision, and scale to ports with implicit dependencies.

    'hen you click 7ptions in the %ropagate %orts dialog bo, you can choose to parse

  • 8/17/2019 Informatica Tips 1

    4/40

    conditions and epressions to identify the implicit dependencies of the propagated port.

    2ll ports with implicit dependencies are output or input"output ports.

    'hen you choose to include conditions the Designer updates the following dependencies:

    3ink path dependencies.• 7utput ports used in the same lookup condition as the propagated port.

    • 2ssociated ports in dynamic 3ookup transformations that are associated with the

     propagated port. For more information about associated ports, see 43ookup!ransformation5 in the Transformation Guide.

    • 7utput ports used by a Custom transformation to define a port relationship with

    one or more input or input"output ports. For more information about defining port

    relationships, see 4Custom !ransformation5 in the Transformation Guide.

    • aster ports used in the same join condition as the detail port.

    'hen you choose to include expressions, the Designer updates the following

    dependencies:

    • 3ink path dependencies.

    • 7utput ports containing an epression that uses the propagated port.

    %&a!ple

    &uppose you hae the following mapping:

    !he 2+-F2C!-9*98ID port in the 2ggregator transformation links to theI+82+-F2C!-9*98ID port in the 3ookup transformation. !he 3ookup

    transformation uses the following lookup condition:

    2+-F2C!-9*98ID ; I+82+-F2C!-9*98ID

  • 8/17/2019 Informatica Tips 1

    5/40

    #ou change the datatype of the 2+-F2C!-9*98ID port from integer to decimal in

    the 2ggregator transformation. #ou choose to parse conditions to infer dependencies, and

    then propagate the datatype change. !he Designer performs the following tasks:

    • Updates link path dependencies. !he Designer updates the ports in the link path,

    changing the datatype of the I+82+-F2C!-9*98ID port in the 3ookuptransformation to decimal.

    • dentifies dependent ports. !he Designer parses the lookup condition and

    identifies the 2+-F2C!-9*98ID port in the 3ookup transformation as a

    dependent port.

    • Updates i!plicit dependencies. !he Designer changes the datatype of the

    2+-F2C!-9*98ID port in the 3ookup transformation to decimal.

    "ropagated 'ttributes by Transfor!ation

    !able /01 describes the dependencies and attributes the Designer propagates for each

    transformation:

    !able /01. %ropagated 2ttributes by !ransformation

    Transfor!ation Dependency "ropagated 'ttribute

    2ggregator 

    • %orts in link path

    • *pression

    • Implicit dependencies

    • %ort name, datatype,

     precision, scale

    • %ort name

    • Datatype, precision,

    scale

    2pplication &ource6ualifier 

      • %orts in link path• %ort name, datatype,

     precision, scale

    Custom

    • %orts in link path

    • %ort dependency

    • Implicit dependencies

    • %ort name, datatype,

     precision, scale

    • %ort name

    • Datatype, precision,

    scale

    *pression

    • %orts in link path

    • *pression

    • Implicit dependencies

    • %ort name, datatype, precision, scale

    • %ort name

    • Datatype, precision,

    scale

    *ternal %rocedure   • %orts in link path • %ort name, datatype,

  • 8/17/2019 Informatica Tips 1

    6/40

     precision, scale

    Filter 

    • %orts in link path

    • Condition

    • %ort name, datatype,

     precision, scale

    • %ort name

    Input   • %orts in link path• %ort name, datatype,

     precision, scale

    $oiner 

    • %orts in link path

    • Condition

    • Implicit dependencies

    • %ort name, datatype,

     precision, scale

    • %ort name

    • Datatype, precision,

    scale

    3ookup

    • %orts in link path

    • Condition

    • 2ssociated ports

  • 8/17/2019 Informatica Tips 1

    7/40

  • 8/17/2019 Informatica Tips 1

    8/40

    General Rules and Guidelines

    Consider the following rules and guidelines when you propagate port attributes:

    • !he Designer does not propagate to implicit dependencies within the same

    transformation.• 'hen you propagate backward along the link path, erify that the change does not

    cause the %owerCenter &erer to fail the session. For eample, if you propagatechanges to a source )ualifier, the %owerCenter &erer might generate inalid &63

    when it runs the session. If you change the port name 4C-&!8ID5 to

    4C-&!7*98ID,5 the %owerCenter &erer might generate &63 to select thewrong column name if the source table uses 4C-&!8ID.5

    • 'hen you propagate port attributes, erify that the change does not cause the

    Designer to inalidate the mapping. For eample, when you change the datatype

    of a port from integer to string and propagate the datatype to othertransformations, the Designer inalidates the mapping if a calculation uses one of

    the changed ports. (alidate the mapping after you propagate ports. If the Designer inalidates the mapping, choose *dit09eert to &aed to reert to the last saedersion of the mapping.

    • 'hen you propagate multiple ports, and an epression or condition depends on

    more than one propagated port, the Designer does not propagate attributes to

    implicit dependencies if the attributes do not match.

    For eample, you hae the following epression in an *pression transformation:

    Item8desc8out ; &ubstr

  • 8/17/2019 Informatica Tips 1

    9/40

    !he Designer displays the %ropagate %ort 2ttributes dialog bo.

    2fter you open the %ropagate %ort 2ttributes dialog bo, you can select another

     port and propagate its attributes.

    . &elect the direction and attributes you want to propagate.

    E. 7ptionally, choose to infer dependencies.

    !able /0. %ropagate %ort 2ttributes Dialog o

    Option Re)uired*Optional Description

    %reiew 7ptional

    Displays the links to the

    affected ports in green andthe unaffected ports in red.

    %ropagate 9e)uired%ropagates the port attributesaccording to the options you

    specify in the dialog bo.

    Direction 9e)uired

    Instructs the Designer to

     propagate attributes forward, backward, or in both

    directions.

    2ttributes

    to%ropagate 9e)uired

    &pecifies the attributes that

    you want to propagate. !he

    attributes include name,datatype, precision, and

    scale.

    7ptions 7ptional &elect to read conditions or

    epressions and propagateattributes to implicit

    dependencies. !he Designer

  • 8/17/2019 Informatica Tips 1

    10/40

    disables these options when

    you propagate the port name.

    !hese options are clear bydefault. 'hen you select one

    of these options and click

    %reiew, the Designerhighlights the link paths to

    the dependent ports.

    /. Click %reiew to iew the affected ports. !he Designer displays the links to the

    affected ports in green and the unaffected ports in red.

    A. Click %ropagate.

    'hen you propagate port attributes, the 7utput window displays the propagatedattributes and the affected ports.

    . Click Close.

    'pplication (ource +ualifier transfor!ation. 9epresents data read from

    2pplication sources.

    ,ML (ource +ualifier transfor!ation. 9epresents data read from ?3 sources.

    2 transformation is a repository object that generates, modifies, or passes data. #ouconfigure logic in a transformation that the %owerCenter &erer uses to transform data.

    !he Designer proides a set of transformations that perform specific functions. For

    eample, an 2ggregator transformation performs calculations on groups of data.

    *ach transformation has rules for configuring and connecting in a mapping.

    #ou can create transformations to use once in a mapping, or you can create reusable

    transformations to use in multiple mappings. 'hen you add a reusable transformation to

    a mapping, you add an instance of the transformation. 'hen you edit the reusabletransformation in the !ransformation Deeloper, all instances of the transformation in

    mappings inherit the changes. &ome changes might inalidate the mappings using the

    reusable transformation.

    #ou can build mapplets in the applet Designer when you want to use a standardied setof transformation logic in seeral mappings. 'hen you use a mapplet in a mapping, the

    Designer creates an instance of the mapplet. !he mapplet instance displays only the ports

    from the Input and 7utput transformations. !hese transformations display as groups. #oucan enter comments for the instance of the mapplet in the mapping, but you cannot edit

    other mapplet properties.

    Figure /01 shows the mapplet input and output groups in a mapping:

  • 8/17/2019 Informatica Tips 1

    11/40

    Figure /01. applet Display in apping

    #ou can epand the mapplet in the apping Designer by selecting it and choosingappings0*pand from the menu. !his epands the mapplet within the mapping for

    iew. #ou can open or iconie all the transformations in the mapplet and mapping, butyou cannot edit any of the properties.

    'hen you edit the mapplet in the applet Designer, all instances of the mapplet inmappings inherit the changes. &ome changes might inalidate the mappings using the

    mapplet.

    'hen you create a mapping, you must add one or more target definitions to it. 'hen youdrag a target definition into the apping Designer workspace, you add an instance of the

    target definition.

    'hen you add targets to a mapping, you can include different types of targets. #ou can

    include targets of the same database type, but different database connections. #ou canalso include both relational and flat file targets in the same mapping.

    'hen you edit the target in the 'arehouse Designer, all instances of the target in

    mappings inherit the changes. &ome changes might inalidate the mappings using thetarget.

    #ote$ 'hen you add a target definition with some special characters in the table name to

    a mapping, the Designer replaces the character with an underscore in the target instance

    name for the mapping.

    #ou can configure properties for relational, file, and ?3 targets in a mapping.

    Configuring Relational Targets in a Mapping

    For relational targets, you can configure the following properties within a mapping:

  • 8/17/2019 Informatica Tips 1

    12/40

    • Reject truncated and o-erflo data. &elect this option in the target instance

    %roperties tab when you want the %owerCenter &erer to write truncated data to

    the reject file.• Update o-erride. 7erride the default -%D2!* statement using the &63 *ditor

    in the target instance %roperties tab.

    Table na!e prefi&. &pecify the owner of the target tables in the target instance%roperties tab.

    • "re/ and post/session (+L. #ou can enter pre0session &63 commands for a

    target instance in a mapping to eecute commands against the target database

     before the %owerCenter &erer reads the source. *nter post0session &63commands to eecute commands against the target database after the

    %owerCenter &erer writes to the target.

    Configuring 0lat 0ile Targets in a Mapping

    For flat file targets, you can configure the following properties within a mapping:

    • Dateti!e for!at. Define the default datetime format to use for datetime alues.

    • Thousands separator. Define the default thousands separator to use for numeric

    alues.

    • Deci!al separator. Define the default decimal separator to use for numeric

    alues.

    Configuring ,ML Targets in a Mapping

    For ?3 targets, you can change the root element. Howeer, if you change the root, you

    affect the target ?3 structure and you can inalidate the mapping.

    For more information about configuring ?3 targets in a mapping, see the XML User

    Guide.

    (etting the Target Load Order

    #ou can configure the target load order for a mapping containing any type of target

    definition. In the Designer, you can set the order in which the %owerCenter &erer sendsrows to targets in different target load order groups in a mapping. 2 target load order

    group is the collection of source )ualifiers, transformations, and targets linked together in

    a mapping. #ou can set the target load order if you want to maintain referential integrity

    when inserting, deleting, or updating tables that hae the primary key and foreign keyconstraints.

    Figure /01E illustrates two target load order groups in one mapping:

    Figure /01E. !arget 3oad 7rder Groups

  • 8/17/2019 Informatica Tips 1

    13/40

    !he %owerCenter &erer reads sources in a target load order group concurrently, and it processes target load order groups se)uentially.

    !o specify the order in which the %owerCenter &erer sends data to targets, create one

    source )ualifier for each target within a mapping. !o set the target load order, you then

    determine in which order the %owerCenter &erer reads each source in the mapping.

    !o set the target load order:

    1. Create a mapping that contains multiple target load order groups.

    . Choose appings0!arget 3oad %lan.

    !he !arget 3oad %lan dialog bo lists all &ource 6ualifier transformations in the

    mapping, as well as the targets that receie data from each &ource 6ualifier.

    . &elect a &ource 6ualifier from the list.

    E. Click the -p and Down buttons to moe the source )ualifier within the load order.

    /. 9epeat steps  and E for any other source )ualifiers you wish to reorder.

  • 8/17/2019 Informatica Tips 1

    14/40

    A. Click 7>.

    . Choose 9epository0&ae.

    'hen you add a relational target to a mapping, you can configure the following

     properties:

    • Reject truncated and o-erflo data. &elect this option in the target instance

    %roperties tab when you want the %owerCenter &erer to write truncated data to

    the reject file.

    • Update o-erride. 7erride the default -%D2!* statement using the &63 *ditor

    in the target instance %roperties tab.

    • Table na!e prefi&. &pecify the owner of the target tables in the target instance

    %roperties tab.

    • "re/ and post/session (+L. #ou can enter pre0session &63 commands for a

    target instance in a mapping to eecute commands against the target database

     before the %owerCenter &erer reads the source. *nter post0session &63commands to eecute commands against the target database after the%owerCenter &erer writes to the target.

    #ote$ #ou cannot configure these properties in the 'arehouse Designer.

    Figure /01/ shows the items you can configure on the %roperties tab of a relational target

    definition in the apping Designer:

    Figure /01/. 9elational !arget %roperties !ab in the apping Designer 

    Rejecting Truncated and O-erflo Data

  • 8/17/2019 Informatica Tips 1

    15/40

    !he Designer lets you conert data by passing it from port to port. &ometimes a

    conersion causes a numeric oerflow

  • 8/17/2019 Informatica Tips 1

    16/40

    Figure /01 shows the default -%D2!* statement for the target !8&23*&:

    Figure /01. -%D2!* &tatement for &ample apping

    ecause the target ports must match the target column names, the update statement

    includes the keyword :!- to specify the ports in the target transformation. If you modify

    the -%D2!* portion of the statement, be sure to use :!- to specify ports.

    O-erriding the 12%R% Clause

    #ou can oerride the 'H*9* clause to include non0key columns. For eample, youmight want to update records for employees named ike &mith only. !o do this, you edit

    the 'H*9* clause as follows:

    -%D2!* !8&23*& &*! D2!*8&HI%%*D ; :!-.D2!*8&HI%%*D,!7!238&23*& ; :!-.!7!238&23*& 'H*9* :!-.*%8+2* ; *%8+2*

    and

    *%8+2* ; KI>* &I!HK

    Rules and Guidelines

    -se the following rules and guidelines when you enter target update )ueries:

    • If you use target update oerride, you must manually put all database resered

    words in )uotes.• #ou cannot oerride the default -%D2!* statement if the target column name

    contains any of the following characters:

    K , < = L M ; N 0 O " P t P n P @ LspaceM

    • 'hen you sae a mapping, the Designer erifies that you hae referenced alid

     port names. It does not alidate the &63.

  • 8/17/2019 Informatica Tips 1

    17/40

    • If you update an indiidual row in the target table more than once, the database

    only has data from the last update. If the mapping does not define an order for the

    result data, different runs of the mapping on identical input data may result indifferent data in the target table.

    • 2 'H*9* clause that does not contain any column references updates all rows in

    the target table, or no rows in the target table, depending on the 'H*9* clauseand the data from the mapping. For eample, the following )uery sets the*%8+2* to KI>* &I!HK for all  rows in the target table if any row of the

    transformation has *%8ID M 1@@:

    -%D2!* !8&23*& set *%8+2* ; KI>* &I!HK 'H*9* :!-.*%8IDM 1@@

    • If the 'H*9* clause contains no port references, the mapping updates the same

    set of rows for each row of the mapping. For eample, the following )uery

    updates all employees with *%8ID M 1@@ to hae the *%8+2* from the last

    row in the mapping:

    -%D2!* !8&23*& set *%8+2* ; :!-.*%8+2* 'H*9* *%8ID M

    1@@

    • If your mapping includes an -pdate &trategy or Custom transformation, the

    !arget -pdate statement only affects records marked for update.

    • If you use the !arget -pdate option, configure the session to mark all source

    records as update.

    %ntering a Target Update (tate!ent

    -se the following procedures to create an update statement.

    !o enter a target update statement:

    1. Double0click the title bar of a target instance.

    . Click %roperties.

    . Click the open button in the -pdate 7erride field.

  • 8/17/2019 Informatica Tips 1

    18/40

    E. !he &63 *ditor displays.

    /. &elect Generate &63.

    !he default -%D2!* statement appears.

    A. odify the update statement.

    #ou can oerride the 'H*9* clause to include non0key columns.

    *nclose all resered words in )uotes.

    . Click 7>.

    !he Designer alidates the &63 when you sae the mapping.

    Table #a!e "refi&

    !he table name prefi is the owner of the target table. For some databases, such as D,target tables in a session can hae different owners. If the database user specified in the

    database connection is not the owner of the target tables in a session, specify the table

    owner for each target instance. 2 session can fail if the database user is not the owner and

    you do not specify the table owner name.

    #ou can specify the table owner name in the target instance or in the session properties.

    'hen you enter the table owner name in the session properties, you oerride the

    transformation properties.

    #ote$ 'hen you specify the table owner name and you set the s)lid for a D databasein the enironment &63, the %owerCenter &erer uses table owner name in the target

  • 8/17/2019 Informatica Tips 1

    19/40

    instance. !o use the table owner name specified in the &*! s)lid statement, do not enter a

    name in the target name prefi.

    !o specify a target owner name at the target instance leel:

    1. In the Designer, open the apping Designer tool.

    . Double0click the title bar of a relational target instance in your mapping.

    . 7n the %roperties tab, enter the table owner name or prefi in the (alue field for

    !able +ame %refi.

    E. Click 7>.

    'dding "re/ and "ost/(ession (+L Co!!ands

    #ou can enter pre0 and post0session &63 commands on the %roperties tab of the target

    instance in a mapping. #ou might want to run pre0 and post0session &63 on the target todrop indees before a session runs, and recreate them when the session completes.

    !he %owerCenter &erer runs pre0session &63 commands against the target database

     before it reads the source. It runs post0session &63 commands against the target database

    after it writes to the target.

    #ou can oerride the &63 commands on the appings tab of the session properties. #ou

    can also configure the %owerCenter &erer to stop or continue when it encounters errors

    eecuting pre0 or post0session &63 commands. -se the following guidelines when you

    enter pre0 and post0session &63 commands in the target instance:

  • 8/17/2019 Informatica Tips 1

    20/40

    • #ou can use any command that is alid for the database type. Howeer, the

    %owerCenter &erer does not allow nested comments, een though the database

    might.• #ou cannot use session or mapping ariables in the target pre0 and post0session

    &63 commands.

    -se a semi0colon

  • 8/17/2019 Informatica Tips 1

    21/40

    from relational or flat file sources.

    7utput%assie"

    Connected

    Defines mapplet output rows. 2ailable in

    the applet Designer.

    9ank  2ctie"Connected 3imits records to a top or bottom range.

    9outer 2ctie"

    Connected

    9outes data into multiple transformations

     based on group conditions.

    &e)uence Generator %assie"Connected

    Generates primary keys.

    &orter 2ctie"Connected &orts data based on a sort key.

    &ource 6ualifier 

    2ctie"

    Connected

    9epresents the rows that the %owerCenter

    &erer reads from a relational or flat filesource when it runs a session.

    &tored %rocedure

    %assie"

    Connected or-nconnected

    Calls a stored procedure.

    !ransaction Control2ctie"

    ConnectedDefines commit and rollback transactions.

    -nion 2ctie"Connectederges data from different databases or flat

    file systems.

    -pdate &trategy2ctie"

    Connected

    Determines whether to insert, delete, update,

    or reject rows.

    ?3 Generator 2ctie"Connected

    9eads data from one or more input ports andoutputs ?3 through a single output port.

    ?3 %arser 2ctie"Connected

    9eads ?3 from one input port and outputsdata to one or more output ports.

    ?3 &ource

    6ualifier 

    2ctie"

    Connected

    9epresents the rows that the %owerCenter

    &erer reads from an ?3 source when it

    runs a session.

    &ome transformations might include other tabs, such as the Condition tab, where you

    enter conditions in a $oiner or +ormalier transformation.

    'hen you configure transformations, you might perform the following tasks:

  • 8/17/2019 Informatica Tips 1

    22/40

    • 'dd ports. Define the columns of data that moe into and out of the

    transformation.

    • 'dd groups. In some transformations, define input or output groups that define a

    row of data entering or leaing the transformation.

    • %nter e&pressions. *nter &630like epressions in some transformations that

    transform the data.• Define local -ariables. Define local ariables in some transformations that

    temporarily store data.

    • O-erride default -alues. Configure default alues for ports to handle input nulls

    and output transformation errors.

    • %nter tracing le-els. Choose the amount of detail the %owerCenter &erer writes

    in the session log about a transformation.

    Transfor!ation %&pression Return 3alue

    2ggregator 

    %erforms an aggregate calculation

     based on all data passed through thetransformation. 2lternatiely, youcan specify a filter for records in the

    aggregate calculation to eclude

    certain kinds of records. For

    eample, you can find the totalnumber and aerage salary of all

    employees in a branch office using

    this transformation.

    !he result of an aggregate calculation

    for a port.

    *pression

    %erforms a calculation based on

    alues within a single row. Foreample, based on the price and

    )uantity of a particular item, youcan calculate the total purchase

     price for that line item in an order.

    !he result of a row0leel calculationfor a port.

    Filter 

    &pecifies a condition used to filter

    rows passed through this

    transformation. For eample, if youwant to write customer data to the

    2D8D*! table for customers

    with outstanding balances, youcould use the Filter transformation

    to filter customer data.

    !9-* or F23&*, depending on

    whether a row meets the specifiedcondition. 7nly rows that return

    !9-* are passed through this

    transformation. !he transformation

    applies this alue to each row passedthrough it.

    9ank &ets the conditions for rows

    included in a rank. For eample,

    you can rank the top 1@ salespeoplewho are employed with the

    !he result of a condition or

    calculation for a port.

  • 8/17/2019 Informatica Tips 1

    23/40

    company.

    9outer 

    9outes data into multiple

    transformations based on a group

    epression. For eample, you can

    use this transformation to comparethe salaries of employees at three

    different pay leels. #ou can do this

     by creating three groups in the9outer transformation. For eample,

    create one group epression for

    each salary range.

    !9-* or F23&*, depending on

    whether a row meets the specified

    group epression. 7nly rows thatreturn !9-* pass through each user0

    defined group in this transformation.

    9ows that return F23&*automatically pass through the

    default group.

    -pdate &trategy

    Flags a row for update, insert,delete, or reject. #ou use this

    transformation when you want to

    control updates to a target, based onsome condition you apply. For

    eample, you might use the -pdate

    &trategy transformation to flag all

    customer rows for update when themailing address has changed, or flag

    all employee rows for reject for

     people who no longer work for thecompany.

    !he numeric codes for update, insert,

    delete, or reject. !he transformation

    applies this alue to each row passed

    through it.

    !ransaction

    Control

    &pecifies a condition used to

    determine the action the%owerCenter &erer performs,

    either commit, roll back, or no

    transaction change. #ou use this

    transformation when you want tocontrol commit and rollback

    transactions based on a row or set of 

    rows that pass through thetransformation. For eample, you

    can use this transformation to

    commit a set of rows based on anorder entry date.

    7ne of the following built0in

    ariables, depending on whether or

    not a row meets the specifiedcondition:• !C8C7+!I+-*8!92+&2C!I

    7+

    • !C8C7I!8*F79*

    • !C8C7I!82F!*9

    • !C897332C>8*F79*

    • !C897332C>82F!*9

    !he %owerCenter &erer performs

    actions based on the return alue.

    Guidelines for Configuring 3ariable "orts

    Consider the following factors when you configure ariable ports in a transformation:

  • 8/17/2019 Informatica Tips 1

    24/40

    • "ort order. !he %owerCenter &erer ealuates ports by dependency. !he order of

    the ports in a transformation must match the order of ealuation: input ports,

    ariable ports, output ports.• Datatype. !he datatype you choose reflects the return alue of the epression you

    enter.

    3ariable initiali4ation. !he %owerCenter &erer sets initial alues in ariable ports. !his allows you to create counters.

    "ort Order

    !he %owerCenter &erer ealuates ports in the following order:

    1. nput ports. !he %owerCenter &erer ealuates all input ports first since they do

    not depend on any other ports. !herefore, you can create input ports in any order.&ince they do not reference other ports, the %owerCenter &erer does not order

    input ports.

    . 3ariable ports. (ariable ports can reference input ports and ariable ports, but

    not output ports. ecause ariable ports can reference input ports, the%owerCenter &erer ealuates ariable ports after input ports. 3ikewise, since

    ariable can reference other ariables, the display order for ariable ports is the

    same as the order in which the %owerCenter &erer ealuates each ariable.

    For eample, if you calculate the original alue of a building and then adjust fordepreciation, you might create the original alue calculation as a ariable port.

    !his ariable port needs to appear before the port that adjusts for depreciation.

    . Output ports. ecause output ports can reference input ports and ariable ports,the %owerCenter &erer ealuates output ports last. !he display order for output ports does not matter since output ports cannot reference other output ports. e

    sure output ports display at the bottom of the list of ports.

    Datatype

    'hen you configure a port as a ariable, you can enter any epression or condition in it.!he datatype you choose for this port reflects the return alue of the epression you enter.

    If you specify a condition through the ariable port, any numeric datatype returns the

    alues for !9-*

  • 8/17/2019 Informatica Tips 1

    25/40

    • @1"@1"1/ for Date"!ime ports with %&erer E.@ date handling compatibility

    disabled

    • @1"@1"@@@1 for Date"!ime ports with %&erer E.@ date handling compatibility

    enabled

    !herefore, you can use ariables as counters, which need an initial alue. For eample,you can create a numeric ariable with the following epression:

    (291 N 1

    !his epression counts the number of rows in the (291 port. If the initial alue of theariable were set to +-33, the epression would always ealuate to +-33. !his is why

    the initial alue is set to ero.

    • nput port. !he system default alue for null input ports is +-33. It displays as

    a blank in the transformation. If an input alue is +-33, the %owerCenter &erer

    leaes it as +-33.• Output port. !he system default alue for output transformation errors is

    *9979. !he default alue displays in the transformation as

    *9979

  • 8/17/2019 Informatica Tips 1

    26/40

    transformation errors. It skips rows

    with errors and writes the input data

    and error message in the session logfile.

    %ntering User/Defined Default 3alues

    #ou can oerride the system default alues with user0defined default alues for supported

    input, input"output, and output ports within a connected transformation.

    • nput ports. #ou can enter user0defined default alues for input ports if you do

    not want the %owerCenter &erer to treat null alues as +-33.

    • Output ports. #ou can enter user0defined default alues for output ports if you do

    not want the %owerCenter &erer to skip the row, or if you want the %owerCenter

    &erer to write a specific message with the skipped row to the session log.•

    nput*output ports. #ou can enter user0defined default alues to handle nullinput alues for input"output ports in the same way you can enter user0defined

    default alues for null input alues for input ports. #ou cannot enter user0defineddefault alues for output transformation errors in an input"output port.

    #ote$ !he %owerCenter &erer ignores user0defined default alues for unconnected

    transformations. For eample, if you call a 3ookup or &tored %rocedure transformation

    through an epression, the %owerCenter &erer ignores any user0defined default alueand uses the system default alue only.

    !able A0A shows the ports for each transformation that support user0defined default

    alues:

    !able A0A. !ransformations &upporting -ser0Defined Default (alues

    Transfor!ation

    nput 3alues for

    nput "ort

    nput*Output

    "ort

    Output 3alues for

    Output "ort

    Output 3alues

    for

    nput*Output

    "ort

    2ggregator &upported +ot &upported +ot &upported

    Custom &upported &upported +ot &upported

    *pression &upported &upported +ot &upported

    *ternal %rocedure &upported &upported +ot &upported

    Filter &upported +ot &upported +ot &upported

    $oiner &upported &upported +ot &upported

  • 8/17/2019 Informatica Tips 1

    27/40

    3ookup &upported &upported +ot &upported

     +ormalier &upported &upported +ot &upported

    9ank +ot &upported &upported +ot &upported

    9outer &upported +ot &upported +ot &upported

    &tored %rocedure &upported &upported +ot &upported

    &e)uence Generator n"a +ot &upported +ot &upported

    &orter &upported +ot &upported +ot &upported

    &ource 6ualifier +ot &upported n"a +ot &upported

    !ransaction Control +ot &upported n"a +ot &upported

    -nion &upported &upported n"a

    -pdate &trategy &upported n"a +ot &upported

    ?3 Generator n"a &upported +ot &upported

    ?3 %arser &upported n"a +ot &upported

    ?3 &ource

    6ualifier  +ot &upported n"a +ot &upported

    #ou hae the following options to enter user0defined default alues:

    • Constant -alue. #ou can use any constant

  • 8/17/2019 Informatica Tips 1

    28/40

     +-33

    K-nknown (alueK

    K+ull input dataK

    %ntering Constant %&pressions

    2 constant epression is any epression that uses transformation functions

  • 8/17/2019 Informatica Tips 1

    29/40

    #ou can enter a user0defined default input alue if you do not want the %owerCenter

    &erer to treat null alues as +-33. #ou can perform the following functions to oerride

    null alues:

    • 9eplace the null alue with a constant alue or constant epression.

    &kip the null alue with an *9979 function.• 2bort the session with the 279! function.

    !able A0 summaries how the %owerCenter &erer handles null input for input andinput"output ports:

    !able A0. Default (alues for Input and Input"7utput %orts

    Default

    3alue

    Default

    3alue

    Type

    Description

     +-33

    +7'+ D*%!K, you could set the default alue toK-+>+7'+ D*%!K. Depending on the transformation, the %owerCenter &erer passes

    K-+>+7'+ D*%!K to an epression or ariable within the transformation or to the net

    transformation in the data flow.

  • 8/17/2019 Informatica Tips 1

    30/40

    !he %owerCenter &erer replaces all null alues in the *2I3 port with the string

    K-+>+7'+ D*%!.K

    D*%!8+2* 9*%32C*D (23-*

    Housewares Housewares

     +-33 -+>+7'+ D*%!

    %roduce %roduce

    (kipping #ull Records

    -se the *9979 function as the default alue when you do not want null alues to pass

    into a transformation. For eample, you might want to skip a row when the input alue of D*%!8+2* is +-33. #ou could use the following epression as the default alue:

    *9979

  • 8/17/2019 Informatica Tips 1

    31/40

      D*%!8ID

  • 8/17/2019 Informatica Tips 1

    32/40

    Constant or

    Constant

    *pression

    -ser0

    Defined

    !he %owerCenter &erer replaces the error with the

    default alue.

    !he %owerCenter &erer does not increase the errorcount or write a message to the session log.

    279!-ser0

    Defined

    !he session aborts and the %owerCenter &erer writes amessage to the session log.

    !he %owerCenter &erer does not increase the error

    count or write rows to the reject file.

    Replacing %rrors

    If you do not want the %owerCenter &erer to skip a row when a transformation error

    occurs, you can use a constant or constant epression as the default alue for an output port. For eample, if you hae a numeric output port called +*!8&2329# and you want

    to use the constant alue KJJJJK when a transformation error occurs, assign the default

    alue JJJJ to the +*!8&2329# port. If there is any transformation error

  • 8/17/2019 Informatica Tips 1

    33/40

    IIF

    !he following eamples show how user0defined default alues may oerride the *9979

    function in the epression:

    Constant -alue or e&pression. !he constant alue or epression oerrides the*9979 function in the output port epression.

    For eample, if you enter K@K as the default alue, the %owerCenter &erer

    oerrides the *9979 function in the output port epression. It passes the alue @

    when it encounters an error. It does not skip the row or write K+egatie &aleK in thesession log.

    • '5ORT. !he 279! function oerrides the *9979 function in the output port

    epression.

    If you use the 279! function as the default alue, the %owerCenter &ereraborts the session when a transformation error occurs. !he 279! functionoerrides the *9979 function in the output port epression.

    • %RROR. If you use the *9979 function as the default alue, the %owerCenter

    &erer includes the following information in the session log:

    o *rror message from the default alue

    o *rror message indicated in the *9979 function in the output port

    epression

    o &kipped row

    For eample, you can oerride the default alue with the following*9979 function:

    *9979

  • 8/17/2019 Informatica Tips 1

    34/40

    !*811@1J %ort S7-!8&23*&T: Default alue is:

    *9979

  • 8/17/2019 Informatica Tips 1

    35/40

    !able A0J describes the session log tracing leels:

    !able A0J. &ession 3og !racing 3eels

    Tracing

    Le-el

    Description

     +ormal

    %owerCenter &erer logs initialiation and status informationQ errors

    encountered, and skipped rows due to transformation row errors. &ummariessession results, but not at the leel of indiidual rows.

    !erse%owerCenter &erer logs initialiation information as well as error messages

    and notification of rejected data.

    (erbose

    Init

    In addition to normal tracing, %owerCenter &erer logs additional

    initialiation details, names of inde and data files used, and detailed

    transformation statistics.

    (erboseData

    In addition to erbose initialiation tracing, %owerCenter &erer logs eachrow that passes into the mapping. 2lso notes where the %owerCenter &erer

    truncates string data to fit the precision of a column and proides detailed

    transformation statistics.2llows the %owerCenter &erer to write errors to both the session log and

    error log when you enable row error logging.

    'hen you configure the tracing leel to erbose data, the %owerCenter&erer writes row data for all rows in a block when it processes a

    transformation.

    y default, the tracing leel for eery transformation is +ormal. #ou change the tracingleel to a (erbose setting only when you need to debug a transformation that is not

     behaing as epected. !o add a slight performance boost, you can also set the tracingleel to !erse, writing the minimum of detail to the session log when running a workflow

    containing the transformation.

    'hen you configure a session, you can oerride the tracing leels for indiidual

    transformations with a single tracing leel for all transformations in the session.

    appings can contain reusable and non0reusable transformations. +on0reusabletransformations eist within a single mapping. 9eusable transformations can be used in

    multiple mappings.

    For eample, you might create an *pression transformation that calculates alue0added

    ta for sales in Canada, which is useful when you analye the cost of doing business inthat country. 9ather than perform the same work eery time, you can create a reusable

    transformation. 'hen you need to incorporate this transformation into a mapping, you

    add an instance of it to the mapping. 3ater, if you change the definition of thetransformation, all instances of it inherit the changes.

  • 8/17/2019 Informatica Tips 1

    36/40

    !he Designer stores each reusable transformation as metadata separate from any mapping

    that uses the transformation. If you reiew the contents of a folder in the +aigator, you

    see the list of all reusable transformations in that folder.

    *ach reusable transformation falls within a category of transformations aailable in the

    Designer. For eample, you can create a reusable 2ggregator transformation to performthe same aggregate calculations in multiple mappings, or a reusable &tored %rocedure

    transformation to call the same stored procedure in multiple mappings.

    #ou can create most transformations as a non0reusable or reusable. Howeer, you can

    only create the *ternal %rocedure transformation as a reusable transformation.

    'hen you add instances of a reusable transformation to mappings, you must be careful

    that changes you make to the transformation do not inalidate the mapping or generateunepected data.

    nstances and nherited Changes

    'hen you add a reusable transformation to a mapping, you add an instance of thetransformation. !he definition of the transformation still eists outside the mapping,

    while a copy

  • 8/17/2019 Informatica Tips 1

    37/40

    reusable transformation. !he transformation designed in the mapping then

     becomes an instance of a reusable transformation maintained elsewhere in the

    repository.

    If you promote a transformation to reusable status, you cannot demote it. Howeer, you

    can create a non0reusable instance of it.

    #ote$ &e)uence Generator transformations must be reusable in mapplets. #ou cannot

    demote reusable &e)uence Generator transformations to non0reusable in a mapplet.

    !o create a reusable transformation:

    1. In the Designer, switch to the !ransformation Deeloper.

    . Click the button on the !ransformation toolbar corresponding to the type of

    transformation you want to create.

    . Click and drag within the workbook to create the transformation.

    E. Double0click the transformation title bar to open the dialog displaying its properties.

    /. Click the 9ename button and enter a descriptie name for the transformation, and

    click 7>.

    !he naming conention for reusable transformations is reuTransformation_Name.

    A. Click the %orts tab, then add any input and output ports you need for thistransformation.

    . &et the other properties of the transformation, and click 7>.

    !hese properties ary according to the transformation you create. For eample, if

    you create an *pression transformation, you need to enter an epression for one

    or more of the transformation output ports. If you create a &tored %roceduretransformation, you need to identify the stored procedure to call.

    . Choose 9epository0&ae.

    "ro!oting #on/Reusable Transfor!ations

    !he other techni)ue for creating a reusable transformation is to promote an eisting

    transformation within a mapping. y checking the ake 9eusable option in the *dit

    !ransformations dialog bo, you instruct the Designer to promote the transformation andcreate an instance of it in the mapping.

  • 8/17/2019 Informatica Tips 1

    38/40

    !o promote a non0reusable transformation:

    1. In the Designer, open a mapping and double0click the title bar of the

    transformation you want to promote.

    . &elect the ake 9eusable option.

    . 'hen prompted whether you are sure you want to promote the transformation,

    click #es.

    E. Click 7> to return to the mapping.

    /. Choose 9epository0&ae.

     +ow, when you look at the list of reusable transformations in the folder you are workingin, the newly promoted transformation appears in this list.

    Creating #on/Reusable nstances of Reusable Transfor!ations

    #ou can create a non0reusable instance of a reusable transformation within a mapping.9eusable transformations must be made non0reusable within the same folder. If you want

    to hae a non0reusable instance of a reusable transformation in a different folder, you

    need to first make a non0reusable instance of the transformation in the source folder, and

    then copy it into the target folder.

    !o create a non0reusable instance of a reusable transformation:

    1. In the Designer, open a mapping.

    . In the +aigator, select an eisting transformation and drag the transformation

    into the mapping workspace. Hold down the Ctrl key before you release thetransformation.

    !he status bar displays the following message:

    4ake a non0reusable copy of this transformation and add it to this mapping.5

    . 9elease the transformation.

    !he Designer creates a non0reusable instance of the eisting reusable

    transformation.

    E. Choose 9epository0&ae.

    'dding Reusable Transfor!ations to Mappings

  • 8/17/2019 Informatica Tips 1

    39/40

    2fter you create a reusable transformation, you can add it to mappings.

    !o add a reusable transformation:

    1. In the Designer, switch to the apping Designer.

    . 7pen or create a mapping.

    . In the list of repository objects, drill down until you find the reusabletransformation you want in the !ransformations section of a folder.

    E. Click and drag the transformation from the +aigator into the mapping.

    2 copy

  • 8/17/2019 Informatica Tips 1

    40/40

    Re-erting to Original Reusable Transfor!ation

    If you change the properties of a reusable transformation in a mapping, you can reert to

    the original reusable transformation properties by clicking the 9eert button.