Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DELETED() function and SQL
Message
 
To
17/08/2006 13:17:07
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Miscellaneous
Thread ID:
01146477
Message ID:
01146564
Views:
16
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
Previous
Reply
Map
View

Click here to load this message in the networking platform