Friday 25 May 2018

Unused Column in Oracle



CREATE TABLE cust_details (
    cust_id               NUMBER,
    cust_name             VARCHAR2(100),
    cust_address          VARCHAR2(255),
    cust_account_number   NUMBER 
);

insert into cust_details values(1,'SCOTT','500,1A,california',11111111);
insert into cust_details values(2,'KING','120,1B,california',22222222);
insert into cust_details values(3,'JAMES','400,1A,california',33333333);
insert into cust_details values(4,'JHON','300,1A,california',44444444);

commit;

desc cust_details;

select * 
from cust_details;

alter table cust_details set unused(cust_account_number);

select * 
from cust_details;

desc cust_details;

select * 
from USER_TAB_COLUMNS 
where table_name = 'CUST_DETAILS';

alter table cust_details drop unused columns;

No comments:

Post a Comment

About Me

I am Siva Jeevan.LK [LEARN | CODE | TRAIN | SHARE] Passionate to answer oracle SQL & PLSQL related questions. In my day to day job, I work with technologies including Oracle, Java, Python, MongoDB, talend and UNIX. I am passionate about "DATA", “SQL” , coding & training. In my spare time, I teach database technologies , ETL etc. I am very glad that you are reading my Profile, and I value your time as well as mine. Looking forward to see you in my videos at Siva Academy Passionate to answer oracle SQL & PLSQL related questions. You can contact me via My youtube channel (Siva Academy) or drop an email at siva.k.academy@gmail.com Happy to Learn & Help :-)

Total Pageviews