Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to add a column placeholder allow NULL
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01536981
Message ID:
01536998
Views:
31
>>>What is wrong with CAST(null as int)? Why the Coalesce is necessary?
>>
>>Because he wanted to get 0 as the field's value, I assume.
>
>I think the approach Hugo suggested may work. Since I am using this column as a placeholder the field value will be set according to the business logic of the program (I know that me and logic do not go together well <g>). Most of the values will be set to 0 or 1. But there could be a case where the value will be NULL and this is why I want to allow NULLs.
>
>Thank you, Hugo.

If you want to create a placeholder with NULL value, then simply CAST (NULL as INT) and it will work in both VFP and SQL Server. But if you want to create 0 as a value but also allow NULLs to be entered, then use the approach I suggested.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform