Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Weird Query
"AK" <AK_TIREDOFSPAM_at_hotmail.COM> wrote:
>>>You know, the '' is equivalent to NULL.
><<
>
>I have some reservations, such as:
>
>situation A:
>First Name: 'John'
>Middle Name: '' (unknown, not a required field)
>Last Name: 'Smith'
>
>situation B:
>First Name: 'Igor'
>Middle Name: '' (a known fact: no middle name at all. Russians do not
>have middle names. Patronymic names are not middle names)
>Last Name: 'Petrov'
>
>how would you distinguish between situations A and B?
You could not, nor would you need to...
A properly constructed where clause would return both of them, if desired..Empty strings are , by Oracle's definition, NULL.
You could avoid that ( if you really, really needed to treat them differently for some reason) by setting a default value of
' ' ( 1 blank space string) for the Middle Name field; that way if no middle name is supplied, a 1 char string is inserted so
that record would not be returned with an IS NULL test...
It would be returned if you used the
where ( Trim(Middle_Name) = '' or Middle_Name IS NULL )
construct
Received on Mon Aug 01 2005 - 13:11:16 CDT
![]() |
![]() |