Level:
1 
Professional point:
81 
Experience:
32 
Thread:
281 
Post:
990 
Joined date:
4/29/2007 12:22:00 AM
Last Visit:
12/17/2008 12:54:30 AM
|
I am puzzled. I have a column CalloutName in one of the tables in an SQL Server database. That column CalloutName has either a string or a NULL (as in <NULL>). (A) If there is no gap/space between the entry <NULL> and the left boundary of a column, the entry is treated as a NULL. (B) If there is a gap/space between the entry <NULL> and the left boundary of a column, the entry is treated as not NULL.
(A) and I can use the following to test whether it is really a NULL: If IsNull(!CalloutName) Or !CalloutName = "" Then callOutState = "" (path for A) Else callOutState = !CalloutName (path for B) End If
So, I tried the following code to see whether the entry in (B) can be picked up as a NULL.
Dim iPosNULL As Integer iPosNULL = InStr(4, !CalloutName, "NULL>", 1)
If IsNull(!CalloutName) Or !CalloutName = "" Or iPosNULL <> 0 Then callOutState = "" Else callOutState = !CalloutName End If
I got an error:
and got an error: Inavalid use of NULL.
So, I am at a loss; how do I test the Nullity of such an entry.
|