Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create and update filed with selected records
Message
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 SP2
OS:
Vista
Database:
MS SQL Server
Divers
Thread ID:
01311271
Message ID:
01311372
Vues:
18
>boris, It is possibel if filed long 200 character but trim if
>a string is only long 190.Auto trim
>like your codes
>
CAST(" id#"+Alltrim(code)+" Name"+Alltrim(Name)+" Fname"+Alltrim(fname)+ " Level"+Alltrim(lcode)+ " Sec"+Alltrim(sec) as CHAR(200)) AS NewField;
>if text is short than 200, and it is long 190, and trim the empty space.

If you have only one record in the result then yes, you could use the expression w/o CAST. But If you have more than one you SHOULD CAST() the expression to some value. That is because VFP define the length of the column based on the first record in result set, so if the first record contains narrowest expression all other records will be truncated.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform