Home » Community » U++ community news and announcements » Sql: *JoinRef
Re: Sql: *JoinRef [message #35411 is a reply to message #34979] |
Fri, 10 February 2012 19:12   |
 |
mirek
Messages: 14267 Registered: November 2005
|
Ultimate Member |
|
|
After some experiences I have to say that this feature is a little bit dangerous, as it can eventually pick wrong 'connection' between tables. Worse, it can in some cases even break existing code by adding columns to tables. (Google "natural join sql" which is quite similar feature for explanation).
However, it still seems very useful and works just fine in most cases. To fix "wrong connection" problem, I have introduced heuristics that it first tries to pick foreign key with the same name as primary or foreign key key that has name table_pk (if FOO has primary key ID, then foreign key has to be FOO_ID) - this covers two most common naming conventions. This has fixed "picked wrong connection" problem for me.
As for other problem (instability in SQL issues), I guess that given this heuristics, it is something that can be avoided when designing and upgrading DB schema. I mean, if DB schema makes any sense, things should work.
|
|
|
 |
|
Sql: *JoinRef
By: mirek on Fri, 09 December 2011 14:14
|
 |
|
Re: Sql: *JoinRef
By: Didier on Thu, 22 December 2011 00:22
|
 |
|
Re: Sql: *JoinRef
By: mirek on Thu, 22 December 2011 08:17
|
 |
|
Re: Sql: *JoinRef
By: Didier on Thu, 22 December 2011 17:26
|
 |
|
Re: Sql: *JoinRef
By: Didier on Thu, 22 December 2011 23:10
|
 |
|
Re: Sql: *JoinRef
By: mirek on Fri, 23 December 2011 08:40
|
 |
|
Re: Sql: *JoinRef
By: mirek on Fri, 23 December 2011 08:48
|
 |
|
Re: Sql: *JoinRef
By: Didier on Fri, 23 December 2011 17:24
|
 |
|
Re: Sql: *JoinRef
By: mirek on Fri, 23 December 2011 17:26
|
 |
|
Re: Sql: *JoinRef
By: mirek on Fri, 10 February 2012 19:12
|
 |
|
Re: Sql: *JoinRef
By: Didier on Sat, 11 February 2012 09:31
|
Goto Forum:
Current Time: Sun Aug 24 13:40:48 CEST 2025
Total time taken to generate the page: 0.03690 seconds
|