null condition
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: null condition

  1. #1
    Join Date
    Feb 2002
    Posts
    16
    hello, I'm working with a jsp/oracle application.
    I'm having trouble with a sql statement whose condition is that the value is null.

    For example,
    SELECT a, b, c
    FROM myTable
    WHERE condition = null;

    In the table, the condition is either N or null.

    I've tried
    condition = ""
    condition = ''
    condition = null
    condition = "null"
    condition != 'N'
    condition <> 'N'

    All these do not produce any result, even though there should be at least 50 rows that have null conditions.

    Is there anything that I'm not aware of when finding null values? Can anyone help me with this problem?

    Thanks a lot!

  2. #2
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    Hello, try WHERE condition IS null
    HTH, Ales




  3. #3
    Join Date
    Feb 2002
    Posts
    16

    null condition

    Hi,
    Thanks for your help.

    I tried using condition IS null and condition IS NULL.
    The error I am getting is:
    ORA-00908: missing NULL keyword.

    Is there something wrong with my statement?

    I tried putting single and double quotes around the null keyword, but it doesn't help.

    Thanks.


  4. #4
    Join Date
    Sep 2001
    Location
    NJ, USA
    Posts
    1,287
    SELECT a, b, c
    FROM myTable
    WHERE FIELD_NAME IS NULL;

    (FIELD_NAME is a or b or ...)

    http://download-west.oracle.com/otnd...s7.htm#1034482

  5. #5
    Join Date
    Feb 2002
    Posts
    16

    null condition

    Thanks for all your help Shestakov and ales,
    I finally got it working.

  6. #6
    Join Date
    Mar 2002
    Posts
    2

    Cool

    Try these

    SELECT a, b, c
    FROM myTable
    WHERE NVL(FIELD_NAME,'*') ='*';


    bye

    Mauro

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width