Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Syntax error
Message
 
À
15/08/2007 14:54:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01247986
Message ID:
01248342
Vues:
29
>>The correct syntax even in VFP 9 is:
>>
>>delete from WorkTable;
>>       from WorkTable;               && Double FROM clause
>>inner join RecToDelete on WorkTable.telNo = RecToDelete.TelNo
>>
>>I am not sure if it exists in VFP8.
>
>No, that's not right. You do repeat the Alias, but you don't use FROM twice:
>
>
>delete WorkTable;
>       from WorkTable;
>inner join RecToDelete on WorkTable.telNo = RecToDelete.TelNo
>
>
>Tamar

HA! I'm so focused on SQL Server right now that I tested my example on SSMS :-( and it works. In VFP that gives me an error:
CREATE CURSOR crsTest1 (Fld1 I)
CREATE CURSOR crsTest2 (Fld1 I)

FOR lnFor = 1 TO 20
    INSERT INTO crsTest1 VALUES (lnFor)
    IF lnFor % 2 == 0
        INSERT INTO crsTest2 VALUES (lnFor)
    ENDIF
NEXT
DELETE FROM crsTest1;
FROM crsTest1;
INNER JOIN crsTest2 ON crsTest1.Fld1 = crsTest2.Fld1
SELECT crsTest1
BROWSE NORMAL
But that in SSMS didn't:
DECLARE @crsTest1 TABLE (Fld1 int)
DECLARE @crsTest2 TABLE (Fld1 int)
DECLARE @i int
SET @i = 1
WHILE @i < 21
   BEGIN
      INSERT INTO @crsTest1 VALUES(@i)
      IF @i % 2 = 0
         INSERT INTO @crsTest2 VALUES(@i)

      SET @i = @i + 1
   END

DELETE crsTest1
       FROM @crsTest1 crsTest1
INNER JOIN @crsTest2 crsTest2 ON crsTest1.Fld1 = crsTest2.Fld1

SELECT * from @crsTest1
(I shouldn't test something fro VFP in SSMS but....)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform