Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL SELECT against view returns OLDVAL()
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00509744
Message ID:
00509755
Vues:
23
>Okay, all, I'm on the verge of losing my status as local VFP guru (and the little respect which I derive from it <g>). One of my guys asked how he could locate some data in a remote view without moving the record pointer. I told him he could run a VFP SQL SELECT against it, because SQL does not move the record pointer in the target cursor.
>
>Well, he came back saying that I was right insofar as I went, but I hadn't mentioned that buffered changes would not be retrieved. And he's right -- apparently, SQL against buffered data returns OLDVAL() values, not changed values. In this case, that doesn't work because he is doing data validation -- which makes OLDVAL() particularly useless :)
>
>I told him to go back to the old way (saving the RECNO() or primary key, using LOCATE, and then returning to the original record) but this is bugging me. Is there any way to get a VFP SQL SELECT to look at the data in the view? This implementation makes no sense to me, because everything else (LOCATE, SCAN, BROWSE, etc) looks at the changed data. Or am I doing something wrong?
>zahid

Zahid,
SQL Selects open the tables again (USE sometable AGAIN in someotherworkarea). It does this by design so it can change the active indexes (for one thing) and not have to reset anything. Because it opens the table again, it uses the disk presence of the table and this does not have the changes yet. The other commands use the alias specified so it looks at the buffered data.

So the answer to your question is you can't do this using SQL Select. You have to use the old xBase commands.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform