Subscribe to Posts by Email

Subscriber Count

    699

Disclaimer

All information is offered in good faith and in the hope that it may be of use for educational purpose and for Database community purpose, but is not guaranteed to be correct, up to date or suitable for any particular purpose. db.geeksinsight.com accepts no liability in respect of this information or its use. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content and if notify any such I am happy to remove. Product and company names mentioned in this website may be the trademarks of their respective owners and published here for informational purpose only. This is my personal blog. The views expressed on these pages are mine and learnt from other blogs and bloggers and to enhance and support the DBA community and this web blog does not represent the thoughts, intentions, plans or strategies of my current employer nor the Oracle and its affiliates or any other companies. And this website does not offer or take profit for providing these content and this is purely non-profit and for educational purpose only. If you see any issues with Content and copy write issues, I am happy to remove if you notify me. Contact Geek DBA Team, via geeksinsights@gmail.com

Pages

Administration : Invisible Columns in 12c

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.

Comments are closed.