INVISIBLE COLUMNS

Invisible columns can be useful during application migrations. Making new columns invisible means they won’t be seen by any existing applications, but can still be referenced by any new applications, making the online migration of applications much simpler.

 

create table tab1 ( id number, description varchar2(50) invisible ); Example 2 CREATE TABLE TBL_EMPLOYEE2(
EMPLOYEE_NUMBER NUMBER(4,0) INVISIBLE NOT NULL ,
EMPLOYEE_NAME VARCHAR2(50 CHAR) NOT NULL,
CONSTRAINT TBL_EMPLOYEE2 PRIMARY KEY(EMPLOYEE_NUMBER)

);

Querying Tables with Invisible colums

 

  • Select * will not display invsible colums. They will have to be requested individually¬† or look at the SQL statement that applies to the table currently
  • Create a VIEW of the table

Create View

— views make invisible columns viewable
CREATE OR REPLACE VIEW VIEW_TBL_EMPLOYEE2 AS
SELECT employee_name,
employee_number
FROM tbl_employee2;

 

 

https://oracle-base.com/articles/12c/invisible-columns-12cr1#invisible-columns

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top