Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object reference lost in SQL SELECT ?
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Divers
Thread ID:
01120146
Message ID:
01120306
Vues:
16
>Hi Igor,
>
>It has nothing to do with macro substitution. IMO, the problem is that '.' (dot) is used for 'object.property' and for 'workarea.field'. It leads to ambiguity which VFP doesn't handle very well in SQL commands.
>My sugesstion to use TEXTMERGE doesn't eliminate macro substitution but makes building quieries easier and simplifies maintanance. It also allows to evaluate constatnt values, like properties, at the time when query is build which could be a good or bad thing depending on your requirements but it certanly eliminates the problem with oobject properties references in the field list.
>
>TEXT TO cSQLStatement TEXTMERGE NOSHOW PRETEXT 15
>SELECT column1, column2, "<<alltrim(object1.object2.property1)>>" as column3,
>    alltrim(cursor1.LastName) + ", " + cursor1.FirstName as FullName
>FROM cursor1
>INTO CURSOR cursor2 READWRITE
>ENDTEXT
>&cSQLStatement
>
I think textmerge is the best approach. We're using it here almost everytime.

I just like to point, that alltrim(cursor1.LastName) + ", " + cursor1.FirstName should probably be converted to
padr(alltrim(cursor1.LastName) + ", " + cursor1.FirstName,60)
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform