
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Load Left Join with resident table
Hi all,
I have two table loaded:
table1:
prodID
prodDes
table2:
prodID
prodFlag
I'd need to obtain a table:
table3:
prodID
prodDes
prodFlag
containing the result of an SQL string like:
SELECT prodID, prodDes, prodFlag FROM table1 LEFT JOIN table2 ON table1.prodID=table2.prodID
I cannot use this SQL string in the DB source because table1 and table2 are in different datasources: so I'd need use a kind of
LOAD .... RESIDENT LEFT JOIN (LOAD .... RESIDENT)
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
You'll need to do something like that:
LEFT JOIN (table2) LOAD * RESIDENT table1;
but the trick is you'll have the concatenated result in the table2, not on a third table.
That was my initial mistake and I just figured it out...
Hope this helps,
Romain

.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Your script should look something like this:
table3:
Load
prodID,
prodDes
From sourcefortable1;
Left Join (table3)
Load
prodID,
prodFlag
From sourcefortable2;
It is not necessary to load the 2 tables into memory first. You can just go ahead and do this straight from the source.
Stephen

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot: your answer has been helpful.
