Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Oracle and empty strings...

by Rhose (Priest)
on Sep 14, 2001 at 01:11 UTC ( [id://112309]=note: print w/replies, xml ) Need Help??


in reply to OT: Oracle SQL issues

Sorry I am so late finding this node, but maybe I can offer a little insight as to what is happening.

The following information is quoted from Oracle's documentation:

Oracle currently treats a character value with a length of zero as null. However, this may not continue to be true in future releases, and Oracle recommends that you do not treat empty strings the same as nulls.

This is not a correct implementaion, but it is what Oracle currently does. A NULL value is an unknown value... an empty string is not unknown -- it is known to be empty.

So, the problem here is the empty strings you want to insert are being converted to NULLs which violate the NOT NULL constraint on the columns. While this may not be much of a "fix", your options would seem to be:

  • Remove the NOT NULL column constraints
  • Insert some other value into the columns (like a single space.)

I hope this helps... (or at least explains what is happening.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://112309]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (1)
As of 2024-04-25 04:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found