Column Value Corrupted After DDL Operations
(Doc ID 1924931.1)
Last updated on FEBRUARY 25, 2019
Applies to:
Oracle Database - Enterprise Edition - Version 11.2.0.4 and laterOracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Information in this document applies to any platform.
Symptoms
Adding new column after dropping column with default value leads to values corruption.
Steps to reproduce:
SQL> drop table xx;
create table xx (x number);
insert into xx (x) values (1);
commit;
alter table xx add (
c varchar2 (100),
cx varchar2 (100),
f char (1) default 'n' not null,
fx char (1) default 'n' not null);
alter table xx drop (
cx,
fx);
alter table xx add (
na number (10),
nb number (4));
select nb from xx;
select dump (nb) from xx;
Table dropped.
SQL>
Table created.
SQL>
1 row created.
SQL>
Commit complete.
SQL> SQL> 2 3 4 5
Table altered.
SQL> SQL> 2 3
Table altered.
SQL> SQL> 2 3
Table altered.
SQL> SQL>
NB
----------
SQL>
DUMP(NB)
----------------------------------------
Typ=2 Len=1: 110
SQL>
Now "na" and "nb" are expected to be null, but they have the values from removed columns, filled previously by default values.
Changes
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Symptoms |
Changes |
Cause |
Solution |
References |