Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Key fields: alpha vs. numeric
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00318449
Message ID:
00321988
Views:
29
Dennis, try this code
create cursor TestNull(int1 I null, int2 I null)

insert into TestNull values (4, .null.)
? nvl(TestNull.int2, TestNull.Int1) && returns 4
Works for me!

Cheers,

Andrew



>>>NVL() does not apply to integer type fields...
>>
>>AFAIK, Integer fields can have a Null value, at least in VFP data, are you using something else? In the table designer, check the NULL button.
>
>I believe -- and cannot check because VFP is not on the system I am on now -- that NVL() does not work on Integer field types. I know that I use it extensively; was using it on a key field that was a Character type field; converted that field to an Integer type with .NULL. values remaining though I was still using NVL() on the key field. Then I'm pretty sure I looked up NVL() and read that it doesn't work on Integer fields.
>
>What you say is true. Integer fields can have a null value. However, NVL() does not work on Integer fields. I tried a roll-your-own NVL() by combining IIF() with ISNULL(). Didn't quite work. The null values were removed but the Integer values were jacked up. For now, I am looping through tables and replacing null values after using a ISNULL() test.
>
>I would bet that there are smarter solutions and welcome them. For now at least I have a work-around.


If we were to introduce Visual FoxBase+, would we be able to work from the dotNet Prompt?


From Top 22 Developer Responses to defects in Software
2. "It’s not a bug, it’s a feature."
1. "I thought I fixed that."


All my FoxTalk and other articles are available on my web site.


Unless specifically identified otherwise, anthing posted here is purely my opinion and may or may not reflect the policies or practices of Microsoft.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform