Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The number in Replicate creates a problem
Message
 
 
À
05/04/2022 19:14:36
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
01684050
Message ID:
01684087
Vues:
30
>>>The problem is the use of ALLTRIM with a field longer then 10 chars in SELECT SQL. Look at message#01684075, I gave all the info were the problem comes from there.
>
>Thanks, Lutz! And your explanation holds up with various other tests- e.g.
>
>
SELE ALLTRIM(LEFT(c1,4)) AS c1 FROM mycur INTO CURSOR cmycur
>
>It processes the LEFT to decide field length, but not the ALLTRIM. It's as if the VFP parser is "smart" enough to know that ALLTRIM() can and I'm sure used to deliver undersized resultset fields. So, ignoring alltrim() when calculating selected field lengths makes sense, but a cause for unexpected issues as seen by Dmitry!
>
>FWIW, I'm pretty sure there was a time when you had to PADR() expressions to prevent undersized results, with confirmations as recently as 2003 on internet search- but I can't provoke it now by using SET ENGINEBEHAVIOR 70 etc. Maybe it got fixed in VFP7, leaving dinosaurs like me laboring on with obsolete truths. ;-)
>
>I experimented using varchar; your example now works as expected, yielding a V(10) result field with len(c1)=0 for first row... , but the same issue Dmitry saw with replicate and V(15).

Yes, I have learned a lesson.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform