-- list分区
create table list_par_city (sid number,s_num number,city varchar2(20))
partition by list(city)(
partition p1 values ('wuhan'),
partition p2 values ('beijing'),
partition p3 values ('shanghai'),
partition p4 values ('shenzhen')
)
insert into list_par_city values(1,12,'wuhan');
insert into list_par_city values(2,44,'beijing');
insert into list_par_city values(3,65,'shanghai');
insert into list_par_city values(4,23,'wuhan');
insert into list_par_city values(5,31,'wuhan');
insert into list_par_city values(6,55,'shenzhen');
select * from list_par_city partition(p5);
alter table list_par_city add partition p5 values('hangzhou');
insert into list_par_city values(7,254,'hangzhou');
create or replace procedure p_par_list(pn in varchar2,p_v in varchar2)
as
begin
-- alter table list_par_city add partition p5 values('hangzhou');
--execute immediate 'alter table list_par_city add partition '||pn||' values ('||p_v||')';
-- alter table list_par_city add s_name varchar2(50);
--execute immediate 'alter table list_par_city add '||pn||' '||p_v||'';
execute immediate 'alter table list_par_date add partition '||pn||' values ('||p_v||')';
end;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12961536/viewspace-769501/ ,如需转载,请注明出处,否则将追究法律责任。