Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

multiple databases with same tables

i have multiple databases for different operating sites but all of them have the same tables and i do not have a column that says where the record is from since all of them reside in site-specific databases so there was no need in the first place...

how do i join them together but still be able to differentiate which sites the records are from?

thanks in advance...

18 Replies
Not applicable
Author

i can't do this?

connect site1

load table1

load table2

...more tables...

connect site2

concatenate table1

concatenate table2

...more tables...

and so on...

Anonymous
Not applicable
Author

Sure you can

Not applicable
Author

but im getting suffixes adding on to the concatenated tables when i connect to a database once to retrieve all the tables and then the next database instead of repeatedly connect to the databases for the next table...

table.fieldA

table.fieldB

table-1.fieldA

table-2.fieldB

for kris' example, he consantly connects to the database to simulate multiple databases

Anonymous
Not applicable
Author

So what does your script look like then? Could you paste the doc here?

nagaiank
Specialist III
Specialist III

You do not need to connect to the database for each table.

Connect to Site1 database

// load tables

table1:

...

table2:

..

Then connect to site2 database

load tables

Hope this helps.

Not applicable
Author

thanks to kris, johannes and nick i have managed to get what i wanted

it was actually my qualify/unqualify statements that were causing the suffixes to be appended instead of concatenating to the tables...

Not applicable
Author

ahhhhh now i got another problem

i wasn't joining all tables yet when i removed the qualify/unqualify statements

i was only joining tables with 2 similar columns

but once i started joining the other tables which were similar but site-specific i will be stuck at the loading script window...

TK_
Partner - Creator
Partner - Creator

why are you using join and not concatenate ?

nagaiank
Specialist III
Specialist III

For any table, if there are site-specific fields in addition to common fields, you need to define all the fields of a table before you start loading from the sites. For example,

Common fields of all sites: Com1, Com2, Com3

Site1-specific fields: Site1a, Site1b

Site2-specific fields; Site2a, Site2b

Define all fileds of the Table1 using the script

Table1:

LOAD * Inline [

Com1, Com2, Com3, Site1a, Sit1b, Site2a, Site2b

];

Connect to Site0 and load data

Concatenate (Table1) LOAD * From Table1

Connect to Site1 and load data

Concatenate (Table1) LOAD * From Table1

...

Hope this helps.