Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG or am I missing something very obvious?
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
BUG or am I missing something very obvious?
Miscellaneous
Thread ID:
01184707
Message ID:
01184707
Views:
62
CREATE CURSOR crsTest (cCode char(4))

INSERT INTO crsTest VALUES('0001')
INSERT INTO crsTest VALUES('0001')
INSERT INTO crsTest VALUES('0001')
INSERT INTO crsTest VALUES('0001')
INSERT INTO crsTest VALUES('0002')
INSERT INTO crsTest VALUES('0002')
INSERT INTO crsTest VALUES('0002')
INSERT INTO crsTest VALUES('0002')

CREATE CURSOR crsTest1 (cCode char(4))
INSERT INTO crsTest1 VALUES('0001')

DELETE crsTest;
 FROM crsTest;
LEFT JOIN crsTest1;
     ON crsTest.cCode = crsTest1.cCode;
     WHERE crsTest1.cCode IS NULL
SELECT crsTest
BROWSE NORMAL

**** TA - DA whole crsTest cursor apears here
**** no marked records at all.
From help:
FROM [FORCE] Table_List[[, Table_List...] | [JOIN [Table_List]]] 
Specifies one or more tables containing the data for the delete operation. 

The FROM clause has the same syntax as in the SQL SELECT command except for the following restrictions: 
    The target table or cursor cannot be included in an OUTER join as a secondary table or cursor. 
    It should be possible to evaluate all other JOIN operations before performing a JOIN operation on the target table. 
    The target cursor cannot be the result from a subquery. 
    For more information, see SELECT - SQL Command. 
But crsTest is not a second table in the JOIN. the select:
SELECT *;
 FROM crsTest;
LEFT JOIN crsTest1;
     ON crsTest.cCode = crsTest1.cCode;
     WHERE crsTest1.cCode IS NULL
works as expected.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Next
Reply
Map
View

Click here to load this message in the networking platform