Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUGG: Correlated UPDATE and DELETE - SQL Commands
Message
De
23/02/2005 19:52:26
 
 
À
23/02/2005 19:22:47
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
Divers
Thread ID:
00989905
Message ID:
00989911
Vues:
28
Hi Fabio,

The result is correct, please read documentation.

Thanks,
Aleksey.

>The new SQL Language Improvements are not implemented correctly.
>
>Repro:
>
>CLEAR
>
>CREATE CURSOR joindata (fr i)
>INSERT INTO joinData VALUES (1)
>
>CREATE CURSOR table1 (f2 i)
>INSERT INTO table1 VALUES (1)
>INSERT INTO table1 VALUES (2)
>INSERT INTO table1 VALUES (3)
>INSERT INTO table1 VALUES (4)
>
>INDEX ON f2 TAG tf2
>
>SET DELETED OFF
>SYS(3054,11)
>
>* result is correct
>DELETE table1 FROM table1 join joinData ON table1.f2=joinData.fr
>? _tally
>BROWSE
>RECALL ALL IN table1
>
>* Result is wrong, table1 is not filtered and all records are deleted
>DELETE table1 FROM table1 T join joinData ON T.f2=joinData.fr
>? _tally
>BROWSE
>RECALL ALL IN table1
>
>* expected a compile Error
>* the where correlate the two table1, and fix the issue
>DELETE table1 FROM table1 T join joinData ON t.f2=joinData.fr where T.f2=table1.f2
>? _tally
>BROWSE
>RECALL ALL IN table1
>
>* expected a compile Error, the command is ambiguous
>DELETE table1 FROM table1 T join joinData ON table1.f2=joinData.fr where T.f2=table1.f2
>? _tally
>BROWSE
>
>
>I guess that UPDATE SQL have the same bug.
>
>Fabio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform