Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why can I use .properties in WHERE clause but not SELECT
Message
De
03/08/2004 05:00:00
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00930193
Message ID:
00930264
Vues:
11
This message has been marked as the solution to the initial question of the thread.
*--- Sample 2 -- Syntax Error
use c:\foxtemp\table1
scatter memo name loTest
with loTest
   sele iif(.name = name,"Yes","No") as indicator from loTest where .id = id
endwith
close tables
Why does Sample 1 work fine and Sample 2 gives me a syntax error. Why can't the query work with .property in the select items but it can in the where clause?

Thanks for your help!


First:
- Use id = .id because .id = id is not optimizable ( VFP optimize only the left member of a comparison)
Second:
- iif(.name = name,"Yes","No") fire a error because the VFP SELECT-SQL parser have a bug

use this:
use c:\foxtemp\table1
scatter memo name loTest
sele iif(m.loTest.name = name,"Yes","No ") as indicator from loTest where id = m.loTest.id

close tables
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform