Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Null value is string
Not sure what you are asking. I tried what I think you meant and it works
fine. This is what I did:
SQL> create table student (student_id number, student_name varchar2(10) default 'null');
Table created.
SQL> insert into student (student_id) values ('28');
1 row created.
SQL> select * from student;
STUDENT_ID STUDENT_NA
---------- ----------
28 null
SQL> alter table student add ( student_name2 varchar2(10) default 'null' );
Table altered.
SQL> insert into student (student_id,student_name) values ('43','Peter Pan');
1 row created.
SQL> select * from student;
STUDENT_ID STUDENT_NA STUDENT_NA
---------- ---------- ----------
28 null null 43 Peter Pan null
--Jeff
-----Original Message-----
Sent: Tuesday, July 09, 2002 4:13 PM
To: Multiple recipients of list ORACLE-L
All,
I need to know if there is a way to insert a character value of 'null' as a default for a column:
example: student_name varchar2(10) default 'null'
I have tried this and it works if I update the column values to the string 'null' later:
example: update student set student_name = 'null' where student_name is null
I know that null is a reserved word but I though that I saw it used somewhere like this before and just thought I would check with the group on this. thanks.
Joseph Hway
hway_at_uswest.net
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: donald.holloway
INET: Donald.Holloway_at_wcom.com
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Liststo: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Liststo: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Tue Jul 09 2002 - 17:44:43 CDT
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message