|
|
| Re: Need few clarification on Alter table. [message #643721 is a reply to message #643720] |
Fri, 16 October 2015 05:34   |
John Watson
Messages: 9003 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
I get the same result (using release 12.1.0.2):orclz>
orclz> desc dept
Name Null? Type
----------------------------------------------------------- -------- ----------------------------------------
DEPTNO NOT NULL NUMBER(2)
DNAME VARCHAR2(14)
LOC VARCHAR2(13)
orclz> alter table dept modify(dname not null disable);
Table altered.
orclz> desc dept
Name Null? Type
----------------------------------------------------------- -------- ----------------------------------------
DEPTNO NOT NULL NUMBER(2)
DNAME VARCHAR2(14)
LOC VARCHAR2(13)
orclz> alter table dept modify(dname not null);
alter table dept modify(dname not null)
*
ERROR at line 1:
ORA-01442: column to be modified to NOT NULL is already NOT NULL
orclz> I would say that it is just an anomaly in the way the SQL*Plus DESCRIBE command happens to work: when it constructs its output, it ignores disables NOT NULL constraints. So to get guaranteed accurate results, one needs to query DBA_CONSTRAINTS.
Surprising.
|
|
|
|
|
|
|
|
|
|
|
|
|
|