Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set EngineBehavior 90 - Possible Bug
Message
 
 
À
28/03/2005 02:47:38
Jarid Griesel
The Innovix Technology Group (Pty) Ltd
Johannesburg, Afrique du Sud
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
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
00999370
Message ID:
00999392
Vues:
22
No, it's not a bug. When you reference field alias that has the same name as field name, the field name takes precedence. IOW, in your query 'ORDER BY sales' references field 'sales' from 'saleshist' table which isn't present in the query field list.

>The VFP 9 Help says the following re 9.0 SQL enhancements:
>
>A SELECT … DISTINCT … ORDER BY command will generate an error if the specified ORDER BY field is not in the SELECT field list.
>
>However the followig sql statement generates a "SQL: Order By clause is invalid" error:
>
>SELECT DISTINCT (Sales / 10) as sales FROM saleshist INTO CURSOR test ORDER BY sales
>
>Setting EngineBehavior 80 gets rid of the error condition.
>
>Is is a Bug ?
>
>A work around is:
>
>SELECT DISTINCT (Sales / 10) as Sales1 FROM saleshist INTO CURSOR test ORDER BY sales1
>
>but the workaround is a pain.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform