Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUGG: Correlated UPDATE and DELETE - SQL Commands
Message
 
To
23/02/2005 19:22:47
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
00989905
Message ID:
00989917
Views:
14
Fabio,

VFP will not complain at compile time as long as command's syntax is correct. You know, all the required clauses, commas, etc. It doesn't think what the command is supposed to do.
So in the two cases where you expected a compile time error, you would at most get a run time one. But then again, VFP's SQL has survived several generations starting with the one that didn't even have JOIN clause. And VFP is backwards compatible as you know... (Some say it is good). So what you normally put as a JOIN condition can also exist as part of WHERE, and VFP will figure out, at runtime, what you meant actually.

And your ambiguous example also doesn't apply becasue VFP will open 2 tables (even if they are the same one) with different aliases and then will do all the joining and filtering, etc, as if they indeed were different

The one with DELETE Table1 FROM Table1 T JOIN JoinData...
is also correct because as I explained above Table1 is opened as alias T and therefore you are not really limiting the DELETE target, which is alias Table1, because there is nothing in the FROM clause talking about Table1 *alias*

--Andrew
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform