Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 11 to 14 of 14 total |
SQL from a memory SQL |
Fri, Jul 14 2006 4:22 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Al
Just to make sure I understand. What I think you're trying to do is: 1. copy a subset of records into a memory table (A) 2. copy the same subset into a different memory table (B) 3. edit (or not) the first memory table 4. compare A and B and post differences back to the underlying table If I'm right then there's no problem with closing the query creating A and using a second query to create B Depending on how you intend to do the comparison I think there are better ways, it also depends on how you intend to return the altered records to the table (sql or navigational). Also, unless you are somehow locking the records that are transferred into the memory table there's nothing to stop another user having altered them in the interval between capture and return. Here's a few thoughts for you. 1. in A's BeforePost event a) if B doesn't exist create it copying A's structure b) copy the A's current record OldValue's into B (overwrite if it already exists) c) when time to update check if B has any records and if so do the compare and update as necessary 2. In A's AfterPost event add the current record's key information to a list a) when time to update i) Start a transaction ii) pull the records from the underlying table with keys in the list iii) compare and update as necessary I would favour 2 or something similar in any case don't forget to free the memory table(s) when you've done Roy Lambert |
Fri, Jul 14 2006 4:22 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Al
You can't have the two queries open at the same time, but you're confusing the query and the tables they have created. The tables will hang around until either you get rid of them or the app is closed. Roy Lambert |
Fri, Jul 14 2006 2:54 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Alex,
<< You cannot have these two queries open at the same time? Which means in the way I have attempted, you cannot compare these tables against each other? >> Correct. The solution is to simply close the first query that generates the table, and then re-open it with a simple SELECT * FROM query using the same query component or open it using a separate table component. Then you're free to open the second query and compare the two tables. -- Tim Young Elevate Software www.elevatesoft.com |
Sat, Jul 15 2006 1:26 AM | Permanent Link |
"Al Vas" | Hi Roy
Thanks for your detailed response. I have taken into consideration records changing in the live dataset, and will aslo be doing a comparison in changes against live data as part of the process. I'll look into your ideas, thanks for that Alex |
« Previous Page | Page 2 of 2 | |
Jump to Page: 1 2 |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |