Results 1 to 7 of 7

Thread: ‘’ = null ?

  1. #1
    Join Date
    Jan 2004

    Unanswered: ‘’ = null ?

    When I use JDBC to insert data into Oracle tables I get null value in the columns when the value is quoted with no space like this ‘’. There are many places in my code that do this type of insert and I never had problem with other databases like DB2, MySQL, MS SQL server etc.
    Is there a way to configure Oracle tables to accept ‘’ as a blank in stead of null?
    I tried to alter table to not allow null but then I get an error saying “null value not allowed” when I do the insert.


  2. #2
    Join Date
    Jun 2004
    Liverpool, NY USA
    In Oracle NULL and an empty string are the same thing. They have no concept of a differency between NULL and empty.
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  3. #3
    Join Date
    Jul 2006
    Myself I've created a standard input format to know when that field has no data but it's not NULL. I just insert "(n/d)". So instead of BLANK, I have my application do something specific for when the result is "(n/d)". Kinda like BLANK, but not really, and different than NULL. See, NULL is very important. Don't mess with that! And remember to always plan for NULL using nvl().


  4. #4
    Join Date
    Aug 2003
    Where the Surf Meets the Turf @Del Mar, CA
    Provided Answers: 1
    >I just insert "(n/d)"
    so why are you not using that instead of '' (2 single quote marks)?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Apr 2002
    Toronto, Canada
    Quote Originally Posted by anacedent
    so why are you not using that instead of ''
    he is -- the other guy isn't

    Quote Originally Posted by igordonin
    See, NULL is very important.
    i agree with you, and still cannot get over how oracle could get it so wrong | @rudydotca
    Buy my SitePoint book: Simply SQL

  6. #6
    Join Date
    Jul 2006
    Well, why do you say Oracle got it (NULL) wrong? It works wonders for me!

  7. #7
    Join Date
    Apr 2003
    Oracle didn't get NULL wrong so much as they got empty Strings wrong.
    By equating an empty String with NULL they made a fundamental mistake as the two are not (necessarilly) the same thing.

Posting Permissions

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