|
-
yes you can ...
SQL> create table my_table (my_column number primary key);
Table created.
SQL> desc my_table
Name Null? Type
----------------------------------------- -------- ----------------------
MY_COLUMN NOT NULL NUMBER
SQL> alter table my_table modify (my_column not null);
Table altered.
SQL> alter table my_table modify (my_column null);
Table altered.
SQL> alter table my_table modify (my_column null);
alter table my_table modify (my_column null)
*
ERROR at line 1:
ORA-01451: column to be modified to NULL cannot be modified to NULL
SQL> desc my_table
Name Null? Type
----------------------------------------- -------- -------------------
MY_COLUMN NOT NULL NUMBER
Note that it is the second modify to not null that fails, but not because o the PK definition ...
SQL> drop table my_table;
Table dropped.
SQL> create table my_table (my_column number null);
Table created.
SQL> alter table my_table modify (my_column null);
alter table my_table modify (my_column null)
*
ERROR at line 1:
ORA-01451: column to be modified to NULL cannot be modified to NULL
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|