Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I don't understand why
Message
De
16/11/2000 12:40:34
 
 
À
16/11/2000 11:39:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00442702
Message ID:
00442776
Vues:
8
>Hello. I ran into a little odd behavior that I would like to clear up.
>In my sql select statement I have;
>
>Select ..., SERVICE.DESC from mytable1, mytable2 .... where .... into cursor myresult order by myfield
>
>Service.desc is a not referred anywhere else in this statement.
>
>I'm using this sql select to gather data for a report. The odd thing is I'm expecting one of the field name to be "desc" from SERVICE.DESC, but instead I'm getting exp_5 as the field name. Since my report form is expecting DESC, it of course error out. So, I have to do something like this "...SERVICE.DESC AS DESC ". Seems a little odd to me that I have to do this.
>
>Does anybody no what is causing this?
>
>Thanks.
In your example service.desc is like a constant and need to be named exlicitly.
For example,
SELECT "Hello" AS someconst ......

In the result set the field would be named exp_1 (for expression #1) if not explicitly named to someconst. Similarly, if the result set would have two fields of the same name, foo, from separate FROM tables, the fields would be renamed foo_a and foo_b since two fields in a table or cursor can't have the same name.
HTH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform