Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Field width or number of decimal places is invalid
Message
 
À
14/03/2008 02:01:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Vista
Database:
Visual FoxPro
Divers
Thread ID:
01302039
Message ID:
01302292
Vues:
12
>Mario,
>
>>I need to set the NULL property of a logical field programatically and it gives me the "field width or number of decimal places is invalid".
>>
>>The command I use is:
>>
>>Alter Table MyTable Alter Column myColumn NULL
>
>That works for me with no error (VFP6 SP5 on Windows NT). Are you sure that the command in your code is the same as what you are typing at the command window?
>
>The error sounds like VFP is expecting the command to provide the field type and depending on type, the length and precision. Perhaps your command in code has ADD COLUMN instead of ALTER COLUMN?
>
>Perhaps you should try adding the "L" to indicate field type (shouldn't be necessary on an ALTER unless you're trying to set to NOT NULL, in which case just the field type and length/precision or field type only if logical will work, but perhaps you have an earlier SP# of VFP6 with a bug?) I haven't seen this error before, so I'm just guessing.
>
>This should work just as well as the line you gave above and might help (won't hurt):
Alter Table MyTable Alter Column myColumn L NULL
>
>Is the line of code hard-coded, or is it being constructed dynamically as the program runs, depending on which table/column you're working with? If dynamic, step in the debugger and see just what the actual line is that is about to be executed. You might be surprised.

David,

Thanks for your answer but no cigar.

-I have SP5
-Pasted my command from my program, so it's exactly the same (ALTER, not ADD and it's hardcoded, not dynamic)
-If I try "Alter Table MyTable Alter Column myColumn L NULL", I get a "Syntax error" from the prg and it works from the command window...this is so weird.

Any other idea?

TIA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform