Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP9 SQL Tip
Message
De
17/12/2004 13:31:58
 
 
À
17/12/2004 12:55:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
00970107
Message ID:
00970126
Vues:
17
>>With the new CAST function, you can now handle VFP memo fields better. For example, I want a distinct set of ClassLib names used in a form:
>>SELECT DISTINCT CAST(JUSTFNAME(classloc) as V(60)) ClassLoc ;
>>   FROM forms\techcalls.scx ;
>>   WHERE NOT EMPTY(ClassLoc) ;
>>   INTO CURSOR crsLibs
>>Cool, eh?
>
>vfp8 and before ( except trim this is equal )
>
>SELECT DISTINCT LEFT(JUSTFNAME(classloc),60) ClassLoc ;
>   FROM forms\techcalls.scx ;
>   WERE NOT EMPTY(ClassLoc) ;
>  INTO CURSOR crsLibs
>


Mark's point is the better handling, not new handling. With CAST() you can force it to be more what you want, in his example a VarChar, as when reading from a Memo you may not know the exact length you will return. In your example it is always left(60) instead of a varchar. A small issue indeed, but I believe it is what he was aiming at.


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform