Oracle PL/SQL/System Tables Views/user unused col tabs

Материал из SQL эксперт
Перейти к: навигация, поиск

Query user_unused_col_tabs

 

create table people(
  employee_id     number(9),
  first_name      varchar2(15),
  last_name       varchar2(20),
  email           varchar2(25),
  constraint pk_people primary key (employee_id)
);
insert into people values (1, "T", "Kyte", "Y@q.ru");
insert into people values (2, "S", "Viper","s@q.ru");
insert into people values (3, "C", "Beck", "c@q.ru");

alter table people drop column first_name;
alter table people drop column last_name;
select * from user_unused_col_tabs;
ALTER TABLE people DROP UNUSED COLUMNS;
drop table people;