Discussion:
table buffering ?
(too old to reply)
Nigel Gomm
2005-01-21 16:56:36 UTC
Permalink
i'm saving a field into the current record and then doing a sum of that
field for any other records
so a couple of lines of code like this...

select deal
gather memvar deposit
select sum(deposit) from deal into array ax where blahblah = thingy

when I start this code deal.deposit = 600 & m.deposit = 800 there's just
one record to sum

afterwards
deal.deposit = 800 but ..... ax(1) =600 (there's just one record to sum).

The SELECT is picking up the old value... putting a FLUSH between the gather
and the SELECT fixes this problem but i'm worried this may be happening
elsewhere. (It's a very big program)

This app began as FPW26 now running on VFP7 so uses free tables with no
buffering.


any suggestions?

TIA


Nigel
Stefan Wuebbe
2005-01-24 10:49:43 UTC
Permalink
In Vfp8 and previous Select-SQL does always read from disk only,
i.e. does not "see" buffered values.
You can use xBase commands, like Sum, Locate, Seek etc., with
buffered aliases instead of SQL.

VFP9 introduced the new buffering clause
Select * From theTable With (buffering=.T.)


hth
-Stefan
i'm saving a field into the current record and then doing a sum of that field for
any other records
so a couple of lines of code like this...
select deal
gather memvar deposit
select sum(deposit) from deal into array ax where blahblah = thingy
when I start this code deal.deposit = 600 & m.deposit = 800 there's just one
record to sum
afterwards
deal.deposit = 800 but ..... ax(1) =600 (there's just one record to sum).
The SELECT is picking up the old value... putting a FLUSH between the gather and
the SELECT fixes this problem but i'm worried this may be happening elsewhere.
(It's a very big program)
This app began as FPW26 now running on VFP7 so uses free tables with no buffering.
any suggestions?
TIA
Nigel
Nigel Gomm
2005-01-24 14:43:02 UTC
Permalink
yikes... i didn't know that

thanks for the info


n
Post by Stefan Wuebbe
In Vfp8 and previous Select-SQL does always read from disk only,
i.e. does not "see" buffered values.
You can use xBase commands, like Sum, Locate, Seek etc., with
buffered aliases instead of SQL.
VFP9 introduced the new buffering clause
Select * From theTable With (buffering=.T.)
hth
-Stefan
Post by Nigel Gomm
i'm saving a field into the current record and then doing a sum of that
field for any other records
so a couple of lines of code like this...
select deal
gather memvar deposit
select sum(deposit) from deal into array ax where blahblah = thingy
when I start this code deal.deposit = 600 & m.deposit = 800 there's just
one record to sum
afterwards
deal.deposit = 800 but ..... ax(1) =600 (there's just one record to sum).
The SELECT is picking up the old value... putting a FLUSH between the
gather and the SELECT fixes this problem but i'm worried this may be
happening elsewhere. (It's a very big program)
This app began as FPW26 now running on VFP7 so uses free tables with no buffering.
any suggestions?
TIA
Nigel
Loading...