1

I have a mapping which I need to be able to run against multiple source schemas (having the same structure), one schema at-a-time. Given the number of schemas, I would rather not set up a session for each schema in order to specify a particular mapping connection, as that will require new sessions to be added as new schemas are added.

Is it possible to set up a workflow in such a way that the data source connection for a mapping within a session is defined (or passed in as a parameter of some sort) at run-time?

2 Answers 2

1
  1. Configure the workflow or the session to use a parameter file.
  2. In the session settings, change the 'hard-coded' source connection (option Use object) to Use Connection Variable and enter a variable name with a $DBConnection prefix (e.g. $DBConnectionSource01).
  3. Create a parameter file in an appropriate location with the following contents:

    [Global]
    $DBConnectionSource01=connection_name

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! I'll try it and report back.
0

I believe what you are looking for is going to be solved using a parameter file and a bit of shell script (assuming your server is on some Unix flavour).

Setup your workflow to run with a parameter file. Declare a special parameter for Database Connection (staring with $DBConnection) in the parameter file global section. Change your session properties to use that parameter.

You need to create appropriate Relational connection objects for each of the source db/schemas.

Now, write some shell program to dynamically change that parameter file and replace the value of the parameter in parameter file with the new value you want.

Typical sequence of events at run time should look like this -

  1. Whenever you want to run that workflow/session/mapping for a different source, launch the script with appropriate parameter to effect the change in Informatica parameter file.

  2. Shell script runs for launching the job for a given db source. The script run should change the $DBConnection parameter in parameter file

  3. Launch the workflow through pmcmd using the parameter file.

1 Comment

Thanks! I'll try it and report back.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.