SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[ES] - Inserting multiple joins into editor

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[ES] - Inserting multiple joins into editor
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2108

Post [ES] - Inserting multiple joins into editor Reply with quote
When selecting a table from a JOIN popup, if there are multiple foreign keys defined, SA inserts the JOIN either for the foreign key selected from the popup or inserts all the possible JOINs if the table is selected. However, while for the first JOIN the type of the JOIN entered into the editor is respected, the rest of the JOINs are added as a plain (INNER) JOIN. This might be both good or bad as SA could not read minds to decide which type of JOINs to use beyond the one that was explicitly given by the user but my own statistics show a trend that all those joins tend to be of the same type.

Check this short video here.


Last edited by gemisigo on Wed Oct 13, 2021 12:02 pm; edited 1 time in total
Wed Oct 13, 2021 6:02 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
*If* I get it correctly, in your last example only one join had to be inserted, for the selected table only. I see two joins inserted as if the top line was selected, which is not what I think I see in the video.

The expected behavior is like this. It's triggered by the JOIN keywords, the type of join isn't relevant, it's not yet that smart to analyze the type.
1. If you select the first line with the name of the table for which joins are shown, it should insert all of them, or if there is a filter, then only for the filtered tables including all columns referenced in the joins
2. If you select one of the tables in the list, then just one join is supposed to be inserted with all its columns (that's your last example), should be one join with two columns in it
3. If you select a specific column, then only one join is supposed to be inserted with one selected column referenced only.


I all scenarios, it doesn't yet pay attention to the text before the JOIN keyword in order to figure out join type. That would be an enhancement.


Last edited by SysOp on Wed Oct 13, 2021 12:29 pm; edited 2 times in total
Wed Oct 13, 2021 9:00 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2108

Post Reply with quote
Some clarifications are needed:
- in each of the three examples the table kar_validation_transaction (AS kvt) was left joined to the table kr_tariff_zone (AS ktz)
- there are two foreign keys defined between those two tables, both kvt.origin_zone_tid and kvt.destination_zone_tid point to (possibly different) zones, not a single foreign key with two columns
- in the first example I selected one of the foreign keys, in the second one the other foreign key and in the third, I choose the table instead of one of the foreign keys
- in all three examples the number of the inserted joins was as expected, in the third example, it added the table twice, one for both of the foreign keys. SA inserted just what I wanted
- the only thing I'd expected different was the JOIN keyword inserted for the subsequent JOIN

And yes, you're right I intended this as an enhancement suggestion, not as a remark to the beta. My bad, I'm very sorry, I'm updating the topic title now.
Wed Oct 13, 2021 12:01 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
I'm sorry I didn't mean to object to what you mentioned. My intention was to state that it doesn't respect OUTER join because it's not yet smart enough to figure out that it can follow the join type specified, right now it's more or less a cookie cutter logic, same size, always does "JOIN etc..." Of course I will follow up and enter an enhancement request to propagate to subsequent joins the same join type as in the first case
Wed Oct 13, 2021 12:34 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.