Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DELETED() function and SQL
Message
 
À
17/08/2006 13:17:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Divers
Thread ID:
01146477
Message ID:
01146564
Vues:
15
Hi,

>Is this SQL command returns the deleted status of one record from file a?

That's one of the side effects of how VFP processes SELECT statements. When you run a SELECT query, VFP doesn't operate on the tables you specify. Instead VFP opens them again using a random alias. After that VFP replaces all occurrences of the alias in your SELECT statement with the random alias choosen for the table:
SELECT _s89334jj8.field1, _j83jd032d.field1,  s89334jj8.field2, _j83jd032d.field4, deleted('a') ;
  FROM s89334jj8, _j83jd032d ;
 WHERE  s89334jj8.field1 = _j83jd032d.field1
When you pass the name of an alias to a function, VFP doesn't recognize this string as an alias and fails to translate it. Therefore DELETED() accesses table a, whereas the reminder of the SELECT statement uses a copy of table a with the alias _j83jd032d. You can actually see that VFP opens multiple tables:
Dimension la[1]
Select AUsed(la) from Sys(2005)
Display Memory like la
--
Christof
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform