Starting 12c you can make columns invisible as like you make indexes invisible.
The following actions can be applicable on invisible columns
SELECT * FROM statements in SQL
DESCRIBE commands in SQL*Plus
%ROWTYPE attribute declarations in PL/SQL
Describes in Oracle Call Interface (OCI)
Few Notes:-
When using select, when you dont select the invisible column in the list, it wont display that column
When using select, When you select the invisible column in the list, it will display that column
When using insert, if you specify the invisible column in the insert list it will insert the value
When using insert, if you dont specify the invisible column in the insert list it will not insert the value indeed only visible columns will have insertions
Restrictions:-
External tables
Cluster tables
Temporary tables
Attributes of user defined tables
How you can make column invisible
SQL> CREATE TABLE mytable (a INT, b INT INVISIBLE, c INT); SQL> Alter table mytable modify b invisible; SQL> Alter table mytable modify b visible;
Very Very Important Note
Column order will be changed when you switch the columns between visible and invisible. Since the column number will not be stored for invisible columns
For example:-
SQL> CREATE TABLE mytable (a INT, b INT INVISIBLE, c INT);
SQL> Select table_name,column_position from dba_tab_columns where table_name='MYTABLE';
TABLE_NAME COLUMN_POSITION ---------- -------------- A 1 C 2
SQL> Alter table mytable modify b visible;
The order of column now will be
SQL> Select table_name,column_position from dba_tab_columns where table_name='MYTABLE';
TABLE_NAME COLUMN_POSITION ---------- -------------- A 1 C 2 B 3
As you see the above the column though in the second list, the order moved to 3rd position, we need to be very careful if you hurrying to use this feature.
Follow Me!!!