Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why I cannot search a NULL value ? BUG ?
Message
 
To
30/08/2003 11:59:33
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00824792
Message ID:
00824821
Views:
18
1. The error message is quite good in case of your example

SET NULL ON
CREATE CURSOR MyCursor ( A I UNIQUE)
x=NULL
? type(x) && type of x is "L"
SEEK m.x ORDER 1 && so you want to compare logical and numerical value ?

2. The error message is not good if you initialize x to a number

SET NULL ON
CREATE CURSOR MyCursor ( A I UNIQUE)
x = 1
x=NULL
? type(x) && type of x is "N"
SEEK m.x ORDER 1 && now you compare two numerical values

In this example VFP error message seems wrong but logic of your code is wrong also.
It is easier to explain this using LOCATE FOR command than SEEK command.
After LOCATE FOR a = .NULL. found() function will always return .f. because value of .NULL. = .NULL. comparison is .NULL. (and not true !).
Try to use isnull() fuction and probably you will not have such problems.






>Hi,
>
>If i search a NULL on a INDEX with keys not nullable,
>VFP fire a error "Data type mismatch"
>
>
>SET NULL ON
>CREATE CURSOR MyCursor ( A I UNIQUE)
>x=NULL
>SEEK m.x ORDER 1
>
>
>For me, correct is ( like SQL Server ) not found.
>
>Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform