0
votes

When we do not know the number of targets, Can we create the targets at run time using informatica Powercenter.

Suppose we have below source:

Employee: 

Dept_ID      EmpName  Sal
10           A        200
11           B        100
10           C        200
10           D        400
12           E        500
12           F        400
...

It can have any number of distinct Dept_ID. I want to load all EmpName and Sal of a particular Dept_ID into a separate target table (i.e target name should be as Tar_10 or Tar_11 where 10 & 11 are Dept_ID).

2
It is not possible. Can you tell more about this requirement? Maybe I can suggest another solution. - Marek Grzenkowicz
This is possible only for Flat Files. Generating relational tables on the fly is not possible. If you share more details perhaps we could come up with some solution, like using Flat Files to store staged data and then create and load the tables. - Maciejg

2 Answers

1
votes

You can achieve this by the following method:

  1. While creating the target check the include file name port checkbox.
  2. Use an expression to create the file name port name, something like " 'Tar' || Dept_ID" should do.
  3. Use a sorter to sort your input with respect to Dept_ID.
  4. Use a transaction control transformation on the condition that when Dept_ID is different from previous Dept_ID use "TC_COMMIT_AFTER", this will keep changing the file name depending on your input.

Your Output will look like this : TAR_10

10 A 200

10 C 200

10 D 400

TAR_11

11 B 100

TAR_12

12 E 500

12 F 400

0
votes

Yes Sumit is right. You can achieve this by creating the File name port and Transaction control. Also if your target is file then you can write the whole record in 1 port so there is no need to worry about the target structure either.