Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

NULL and Empty String

rsar001Feb 17 2011 — edited Feb 18 2011
Hi There,
As far as I know, Null is not the same as an empty string; however, when I try this out, I get some unexpected results (well, at least unexpected for my liking):
SQL> CREATE TABLE TS (MID NUMBER,
  2  MDESC VARCHAR2(20) DEFAULT '' NOT NULL);

Table created.

SQL> INSERT INTO TS VALUES(1,'');
INSERT INTO TS VALUES(1,'')
                        *
ERROR at line 1:
ORA-01400: cannot insert NULL into ("TT"."TS"."MDESC")
So, according to the above scenario, I can't insert an empty string!! However, an empty string is a valid string that doesn't have tuples/data!!

How come Oracle translates the null string '' as NULL?


Thanks

Comments

evgeni gelfand

I don't think (I am sure actually) that this is an database server error, this is application error and this is coming from WebSphere.
According to google search results the main advice is to check connectivity between your client (WebSphere I guess) and database server.

1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 18 2011
Added on Feb 17 2011
13 comments
2,973 views