Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Truncated field in cursor
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01533215
Message ID:
01533219
Vues:
37
>>I have a select statement gathering fields into a cursor which is then copied to a delimited text file. Has worked fine until last night.
>>
>>It is selecting several logical fields (among others) like this:
>>
>>
>>IIF(no_reinst=.F., "False", "True") as no_reinst, ;
>>IIF(no_chks=.F., "False", "True") as no_chks, ;
>>IIF(no_eft=.F., "False", "True") as no_eft, ;
>>IIF(web_msr=.F., "False", "True") as web_msr, ;
>>
>>
>>The line selecting the web_msr field is truncating and inserting "Fals" as the value when .F. This is not happening on the selection of the other logical fields. Any idea what might cause this?
>>
>>Thanks,
>>KP
>
>Because when you select strings like this in VFP the FIRST resulted record defines the length of the field.
>In your case maybe the first record has "True" as result and that way the length of the field becomes 4.
>So PAD all strings to have the same length:
>
>IIF(no_reinst, "True ", "False") as no_reinst, ;
>IIF(no_chks  , "True ", "False") as no_chks, ;
>IIF(no_eft   , "True ", "False") as no_eft, ;
>IIF(web_msr  , "True ", "False") as web_msr, ;
>
>BTW the field is logocal. There is NO NEED to compare it to .t. or .f., Just check the field.


I had that happen a while back when doing some imports into SQL server and discovered that was the case. Should have thought of that. Thanks for your help!

KP
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform