Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 7 of 7 total |
SELECT with INNER JOIN adds new records |
Sun, Jan 22 2012 12:38 PM | Permanent Link |
Janusz Cyran | It seems that SELECT with INNER JOIN adds new records to result set. I see it in a grid connected with appropriate DataSource. Every next time the user runs SELECT the old values still are visible and new ones are added. The simple SELECT without JOIN works differently and in a grid each time only single values appears.
|
Sun, Jan 22 2012 1:17 PM | Permanent Link |
Fernando Dias Team Elevate | Janusz,
JOIN and INNER JOIN should produce the exact same result set, and none of them should add its result set to an existing result set of a previously executed query, no matter if it is a JOIN or any other kind of SELECT. If that is what you are seeing, that's not an expected or normal behavior. Can we have some more details on what you are doing and how, as well as what EDB version you are using, please? -- Fernando Dias [Team Elevate] |
Sun, Jan 22 2012 1:51 PM | Permanent Link |
Janusz Cyran | The version is ElevateDB 2.05 Build 11.
Here is the relevant code: // Wrong behaviour: with qZwrot do begin Close; SQL.Text := 'SELECT s.Symbol, s.Nazwa, s.Ilosc, p.Ilosc AS IloscPZ, s.Barkod'; SQL.Text := SQL.Text + 'FROM StanyRob s '; SQL.Text := SQL.Text + 'INNER JOIN PZARob p ON (s.Barkod = p.Barkod) '; SQL.Text := SQL.Text + ' WHERE s.Ilosc > 0 ORDER BY s.Nazwa'; Open; end; // Proper behaviour: with qZleBarkody do begin Close; SQL.Text := 'SELECT Symbol, Ilosc, Barkod FROM PZARob p WHERE CzyCyfry(p.Barkod) < 0'; Open; end; |
Sun, Jan 22 2012 2:53 PM | Permanent Link |
Fernando Dias Team Elevate | Janusz ,
I don't see anything unusual happening with similar queries here, but I don't have 2.05.11 installed anymore, I'm testing with 2.06.2. Do you also see it happening in EDB Manager or only in your application? -- Fernando Dias [Team Elevate] |
Sun, Jan 22 2012 4:42 PM | Permanent Link |
Janusz Cyran | Only in my application. Additionaly, when I first run 2x, 3x, etc SELECT in the application and see doubled records in the grid, then run the same SELECT in Manager, the result set is doubled, tripled etc. The consecutive execution in Manager doesn't add new records, but the last result from application is visible.
|
Sun, Jan 22 2012 5:51 PM | Permanent Link |
Fernando Dias Team Elevate | Janusz ,
Have you tried a REPAIR on those 2 tables? If that doesn't fix it, can you post the structure of the tables and indexes so that I can test it here, please? -- Fernando Dias [Team Elevate] |
Mon, Jan 23 2012 3:36 PM | Permanent Link |
Janusz Cyran | Fernando,
I've got it! It was a side effect of my other error, sorry. Anyway thank you for your great support, as always Janusz |
This web page was last updated on Tuesday, May 7, 2024 at 02:40 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |