CF handling null

Discussion in 'Programming' started by kimimaro, Feb 17, 2009.

  1. #1
    how do i represent null in CF?

    i tried IsNULL()

    and EQ NULL

    and EQ "" <--- this does not mean equals to null instead an empty value

    Thanks in advance
     
    kimimaro, Feb 17, 2009 IP
  2. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    In what context? CF does not really have the concept of NULL.

    Here are a few scenarios:

    1. If you retrieve a NULL value from a database query, that NULL is usually converted to an empty string "".

    2. You can pass a "null" to a java class using javacast("null", ..).

    3. If you are working with a java class that _returns_ a "null", it is treated as undefined in CF. So you could use IsDefined to test for its existence.

    HTH
     
    cfStarlight, Feb 17, 2009 IP
  3. kimimaro

    kimimaro Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for replying. Im retrieving a NULL value from database which supposedly it converts into ""

    But i put a syntax something like

    <cfif query.column EQ "">

    But the code does not catch it. :(
     
    kimimaro, Feb 17, 2009 IP
  4. kimimaro

    kimimaro Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Ignore my post.. Everything works fine . It is "" thanks
     
    kimimaro, Feb 17, 2009 IP