Invisible Columns in Oracle 12c
Invisible column is a new feature in Oracle 12c. Invisible columns provide a convenient way to change a table’s structure without having to edit the existing applications using that table. Invisible columns can be created at the time of table creation using CREATE TABLE command SQL> create table inviscol_test 2 (compno number, 3 compname varchar(20), 4 compcode varchar(10) invisible); Table created. existing visible columns can be modified to invisible using ALTER TABLE command SQL> alter table inviscol_test modify (compname invisible); Table altered. How does it work? The insert statement where we don’t specify the column names will fail. SQL> insert into inviscol_test values (101,’ABCD’,’A101′); insert into inviscol_test values (101,’ABCD’,’A101′) * ERROR at line 1: ORA-00913: too many values Explicit column names should be included in the insert statement. SQL> insert into inviscol_test(compno, compname, compcode) values (101,’ABCD’,’A101′); 1 row created. If invisible columns are not listed in the insert statement they are set to NULL SQL> insert into inviscol_test values (201); (more…)
[ad_2]