Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Different sources ----->one mapping????

Status
Not open for further replies.

saifnawaz

Programmer
Apr 1, 2004
8
Hi,
The following is my scenerio:
I have 25 tables on db2
T_A11
T_A12
T_A13
T_A14
.....
.....
T_A125
<NOTE ALL TABLES HAVE SAME STRUCTURE>
I want to extract data from each table without importing all of them or creating multiple mappings.
Is it possible to keep the table name as a variable/get from parameter file during runtime and increment a variable "T_A1"+<the increment> thus reducing my source imports/mappings?
IF so how can i achieve this?
Thx

 
You could try one mapping, 25 sessions in your workflow, override the table name in the SQL query (session's source) for each one

There's no way (that I found at least) to pass in parameters from the session and have the workflow itself see them, so in my one-mapping, many source jobs (from files) I have separate sessions. Still less maintenance than separate mappings.

 
Hi,
If you are trying to extract data from all the sources & then trying to dump into one single target then the below solution might workout.

As you have said the structure is same what you have to do is just import one of the table into the mapping & do the necessary transformation & load it into the target.

but in the sql override of source qualifier write the query as
select fld1,fld2 from T_A11 union select fld1,fld2 from TA12.....

By this way you can do the necessary extract from all the tables in one map & one session without much hazards.

 
Hi,

There is an easy solution to it. Try to use Partition for all your sources. see Partitioning for more information. They have an example with 3 flat files hope that can help you understand it better.

- Hitesh Rathod
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top