You are not logged in.
Announcement
Unanswered posts
|
Pages: 1
I have 10 databases with a common table "district"......I want to merge district table of all the databases.......
how i can achieve my target with dynamic database connection and a loop
for ex
dbcon1 Database 1 district dable
dbcon2 Database 2 district dable
dbcon3 Database 3 district dable
dbcon4 Database 4 district dable
dbcon5 Database 5 district dable
for i =1 to 5
set dbcon= dbcon$i
loop
thanks in advance
Offline

Hi,
You can dynamically set up database connections by using a tForeach and supplying the database name in the foreach values. If you choose this method, you can then use the iterate link and have the database name set by String.valueOf(globalMap.get("tForeach_1_CURRENT_VALUE")). Additionally, you can also use the tLoop component. Set it as a for loop and provide the start and end value as well as the number by which to increment the counter. From here, you will use the iterate link and set the database name to be, from your example, "dbcon"+globalMap.get("tLoop_1_CURRENT_VALUE"). Attached are images from an example job I've put together to demonstrate this capability.
Regards,
Last edited by rbaldwin (2009-02-25 19:34:16)
Offline
Thanks....Working fine
Offline
Pages: 1