Dynamic Reference partition by Trigger
842442Feb 24 2011 — edited Feb 24 2011Hi All,
I need to create a Dynamic Reference partition by Trigger. Could you please help me on this.
eg:- I am taking an example from http://www.oracle.com/technetwork/articles/sql/11g-partitioning-084209.html
I am almost clear about Partition Part and Reference Partition. But I am not sure how I can implement using a trigger
Like; when new rows added to the customer table this Partition table should dynamically add the partition.
Could you please let me know how I can add a trigger to work for this example/scenario? Thanks.
create table customers
( cust_id number primary key,
cust_name varchar2(200),
rating varchar2(1) not null)
partition by list (rating)
( partition pA values ('A'),
partition pB values ('B'));
create table sales
( sales_id number primary key,
cust_id number not null,
sales_amt number,
constraint fk_sales_01
foreign key (cust_id)
references customers)
partition by reference (fk_sales_01);