Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Dummy - Me
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00436193
Message ID:
00436204
Vues:
16
>Has anyone out there, ever done the following
>Named fields with names like 'mydata.name' or mydata.type or mydata.date
>or anything as stupid as that.
>
>Long story, but it has happend on a legacy system.
>The problem I just started cropping up, when I was attemping to do sql querries on the data, and all sorts of error started happening.
>
>I tracked down the source of the sql error's and it was with the order by clause.... vfp's sql commands, dont allow for these reserved words to be used as fields in the order by clause.
>
>So for now, I fixed it, and made it work by putting the data in a cursor, and adding an additional field with a proper name like mycursor.f_name and put the values there... etc, it works... not a pretty picture,
>
>
>Is there better work arround, for this type of dummy mistake ?
>
>Thanks in advance.
>Bob Lee


The most common error is to name description field DESC and this would definitely confuses SQL. Anyway, in your situation you may try to put numbers in ORDER BY clause, e.g.:
select name, type, date from ... ;
order by 1,2,3

BTW, we also have Date field in one of our Tables. May be it's not too late to switch... We had not beaten so far...
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform