Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Weird Query

Re: Weird Query

From: Turkbear <john.g_at_dot.spamfree.com>
Date: Mon, 01 Aug 2005 13:11:16 -0500
Message-ID: <p3pse1dgjrj758kvg1hn1kjsegon0kvlpj@4ax.com>


"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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US