Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 2 of 2 total |
Sharing record buffers |
Tue, May 9 2006 10:35 AM | Permanent Link |
"Jose Eduardo Helminsky" | I have been playing with a small trouble with an example routine like below:
Q: TDBISamQuery T: TDBISamTable T.TableName := 'mytable'; Q.RequestLive := True; Q.Sql.Text := 'select * from mytable where cond=1'; Q.Open; while not Q.Eof do begin if T.FindKey([Q.FieldByName('Key').AsInteger]) then begin T.Edit; T.FieldByName('Cond').AsInteger := 0; <--------- Here I am violating the where clause T.Post; end; Q.Next; <----- *** end; Q.Close; *** Because RequestLive = True the current record pointer is invalid but I think before jump to the next record DBISAM move to a valid record pointer. The real problem here is not how to update the table (I can use update instead of) but just to understant the exact way DBISAM handle this situation. The final question: DBISAM works like explained above or not ? Eduardo |
Tue, May 9 2006 4:26 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Eduardo,
<< *** Because RequestLive = True the current record pointer is invalid but I think before jump to the next record DBISAM move to a valid record pointer. >> Correct. << The real problem here is not how to update the table (I can use update instead of) but just to understant the exact way DBISAM handle this situation. >> It depends upon the order of the result set. It will re-adjust based upon the order, which will be the primary index order if you didn't specify an ORDER BY clause. IOW, it will jump to the next highest record based upon the primary index, so just skip the Next call when you actually update a record so that it falls out of the WHERE clause. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Friday, March 29, 2024 at 03:30 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |