how to design mapping half of source table records into one
target and remaining half into another target
Answer Posted / akash
There are 2 ways through which we can achieve this:
Through informatica transformations: Source Qualifier /
Aggregator and Expression
1. Take count through an aggregator or source qualifier.
Add a port (say record_id) from sequence generator to give
the record number.
Mark router condition as -
where record_id < = (count / 2)
send this group to one target and default group of router
to other target.
2. Use the following query in Source Qualifier:
SELECT KEY_field,
description,
(CASE WHEN ROWNUM <= ((SELECT COUNT(*) FROM TEMP_TABLE)/2)
THEN 1
ELSE 2
END) AS FLAG
FROM table_name
In the above key_field and description are the required
fields from source table.
The result will be of the type:
KEY_FIELD DESCRIPTION FLAG
1 ABC 1
2 JJJ 1
3 XYZ 2
4 PQR 2
Use a router on the condition of port FLAG to map data to
targets.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
what is SDLC way of code development?
I have two different source structure tables, but I want to load into single target table? How do I go about it? Explain in detail through mapping flow.
How many ways a relational source definition can be updated and what are they?
complex mapping ur project u r invlve can u explain and give real time example give me ?
suppose in my source flatfile i have 10000 records in that some of master table records missed table records missed then what will u do
Can one use mapping parameter or variables created in one mapping into any other reusable transformation?
How is Source Side push down optimization different to just providing a SQL override in Source qualifier transformation.
Why do you use Mapping Parameter and mapping variable?
Mention some types of transformation?
What is an expression transformation?
How does a rank transform differ from aggregator transform functions max and min?
EXL informatica Questions
Where are the source flat files kept before running the session?
What are ETL Tools?
Define update strategy?