Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I would like to know is there any difference between outer join and general load.
For example:
There are two tables: Main table and Sub table:
Main Table:
OrderId LocaleId MemberId
1 1 1
Sub Table:
SuborderId LocaleId MemberId Amount
1 2 1 30
We can see that there is a synthetic key (MemberId ,LocaleId)
If I use general load:
load * from Maintable; load * from Subtable;
or outer join:
Load * from Maintable; outer join load * from Subtable;
But the result is the same when I use table object to show the result.
LocaleId MemberId Amount OrderId SubOrderId
1 1 30 1 1
2 1 - 1 -
If the there is no difference between outer join and general load, I was wondering when shall I use outer join and when shall I use general load?
Thanks.
Hi Isaac,
Load and Outer Join should not be compared. They serve totally different purposes. Eventually you are finding the data in table object in a similar result form, still they are nowhere related or comparable i believe. When you are loading two different tables, they are different entities and could be associated if there is any commom field. If there are more than one fields in common, then it's a synthetic key issue; it gets confused - what to be associated with. Still the tables are different in the data model. But if you use the JOIN, it's causes to make two tables into one. Now the type of join(INNER/OUTER/LEFT/RIGHT) depends on how the data are in the tables and which data are of your interest. If you use OUTER JOIN, the all combinations(left+right) of records would come in the resultant table based on again a key field(you are using for JOIN). possibly,it won't be easy to understand when to use general load and when to use outer join from any theoritically explained topic. What i would suggest you, have the view of your tables in mind and visualize the resultant table(you actually want the table to look like), and get the concept of the functionality of these load and joins. You would automatically get an answer to your question...which to use where. Don't go with any theoritical prejudice (at least for this case).
i am sorry, if this lenghty text irritates you.
Regards, tresesco
Hi Isaac,
Load and Outer Join should not be compared. They serve totally different purposes. Eventually you are finding the data in table object in a similar result form, still they are nowhere related or comparable i believe. When you are loading two different tables, they are different entities and could be associated if there is any commom field. If there are more than one fields in common, then it's a synthetic key issue; it gets confused - what to be associated with. Still the tables are different in the data model. But if you use the JOIN, it's causes to make two tables into one. Now the type of join(INNER/OUTER/LEFT/RIGHT) depends on how the data are in the tables and which data are of your interest. If you use OUTER JOIN, the all combinations(left+right) of records would come in the resultant table based on again a key field(you are using for JOIN). possibly,it won't be easy to understand when to use general load and when to use outer join from any theoritically explained topic. What i would suggest you, have the view of your tables in mind and visualize the resultant table(you actually want the table to look like), and get the concept of the functionality of these load and joins. You would automatically get an answer to your question...which to use where. Don't go with any theoritical prejudice (at least for this case).
i am sorry, if this lenghty text irritates you.
Regards, tresesco
Hi tresesco,
Thanks for your wonderful explanation, I should go through my situation, then choose which model is fit for me, thanks again.