Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select statement doesn't see changed value 1

Status
Not open for further replies.

scklifasovskiy

Programmer
Nov 12, 2012
57
CA
Hi all,
I have this situation:
1. I update the table value (control source on a field)
2. Browse the table -- and I see new value no problem
3. [highlight #EF2929]SELECT statement sees old value[/highlight]

How can I make SQL see new value?
 
what is your select sql look like?

Ali Koumaiha
TeknoSoft Inc.
Michigan
 
See one or two threads further. The reason is buffered changes.

SQL by default looks into the DBF file, even if it's already opened and bufferd, you query the dbf file.
since VFP9 we have SET SQLBUFFERING ON to make each query also look into buffers.

I warn you though: I had C5 errors using this feature and they only disappeared when using the exact same SP and hotfix version of the runtimes as was compiled with. That was a bit difficult with several hundred PCs not connected to LAN.

We lived without this feature for about 20 years or so. Why do you need SQL to query in changed data? One solution would be to save before you query, another one is scan/endscan loops, locates and seeks on the alis in question, anything but SQL reads the buffer.

Bye, Olaf.
 
Or, simply commit the changes:

1. I update the table value (control source on a field)
2. Browse the table -- and I see new value no problem
2a. Issue a TABLEUPDATE() here.
3. SELECT statement sees old will see the new value.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Well, "One solution would be to save before you query" means Tableupdate(), but of course Mike has put this much easier.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top