Results 1 to 2 of 2

Thread: re :NULL value

  1. #1
    Join Date
    Aug 2003
    Location
    Pasay City, Philippines
    Posts
    8

    Unanswered: re :NULL value

    SELECT count(*) INTO :li_count2
    FROM in_cargoinfo
    WHERE registry = :ls_registry
    and document_proc_user = Null
    and document_proc_user = ''
    USING SQLCA;

    Is there any problem with my script. I want to select record/documents that has not been processed. I rely my validation in the user information . If user = '' or null then it means this document has not been process. I want to view this information..... Bu upon checking it with my oracle server the document don't have any value so it means this document must be included in the un-processed documents. but upon retrieval in my program, no records occured...

    Can you help me with this one....

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: re :NULL value

    Originally posted by adalson
    SELECT count(*) INTO :li_count2
    FROM in_cargoinfo
    WHERE registry = :ls_registry
    and document_proc_user = Null
    and document_proc_user = ''
    USING SQLCA;

    Is there any problem with my script. I want to select record/documents that has not been processed. I rely my validation in the user information . If user = '' or null then it means this document has not been process. I want to view this information..... Bu upon checking it with my oracle server the document don't have any value so it means this document must be included in the un-processed documents. but upon retrieval in my program, no records occured...

    Can you help me with this one....
    Oracle is a bit funny about the zero-length string ''. It treats it as synonymous with NULL (contrary to SQL standard). And nothing is ever "equal to" NULL - not even NULL. You have to test it like this:

    and document_proc_user is Null

Posting Permissions

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