Home » RDBMS Server » Server Administration » about '' and null
about '' and null [message #373344] Wed, 11 April 2001 20:00 Go to next message
rongdorry
Messages: 5
Registered: April 2001
Junior Member
it seems that oracle cant distiguish '' and null
eg if i insert into a varchar2 column values '' than oracle look it as null.

is it right?and can i insert into a "not null" column with value ''?
Re: about '' and null [message #373346 is a reply to message #373344] Wed, 11 April 2001 20:18 Go to previous messageGo to next message
Naresh Sharma
Messages: 12
Registered: April 2001
Junior Member
Hi,

Whatever you say above is not correct.

You can insert into a NOT NULL COLUMN with value
"?

-------------------------

Suppose I have a table X which has 1 column
COM with a Datatype of varchar2(5) and a
NOT NULL contraint.

Insert statement :
Insert into x
values('"');

This will insert a record in the table x
with COLUMN value as ".

Insert into x
values('"?');

This will again insert a record in the table x
with COLUMN value as "?.

--------------------------

HTH

Naresh
Re: about '' and null [message #373347 is a reply to message #373346] Wed, 11 April 2001 21:42 Go to previous messageGo to next message
rongdorry
Messages: 5
Registered: April 2001
Junior Member
oh,thanks
and u means is a column A is null then the followed 2 statement is same effect?

--insert into tb (A) values (null);
--insert into tb (A) values ('');

and if i want to insert into a string that length is 0,but i dont want insert as a null value,can i do it?
Re: about '' and null [message #373349 is a reply to message #373347] Wed, 11 April 2001 23:18 Go to previous messageGo to next message
Naresh Sharma
Messages: 12
Registered: April 2001
Junior Member
--insert into tb (A) values (null);
--insert into tb (A) values ('');

The above 2 statements will have the same effect.
Both will insert a null value.

---------------------------
About the 2nd query of yours, can you please explain it more clearly !!

---------------------------

Naresh
Re: about '' and null [message #373351 is a reply to message #373349] Thu, 12 April 2001 00:19 Go to previous message
Naresh Sharma
Messages: 12
Registered: April 2001
Junior Member
If the length of String is 0, the in Oracle it will treated same as Null.

--------------
Previous Topic: table or view does not exist
Next Topic: Stop users from Selecting
Goto Forum:
  


Current Time: Sat Jun 29 00:24:55 CDT 2024