Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Dynamic Reference partition by Trigger

842442Feb 24 2011 — edited Feb 24 2011
Hi 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);
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2011
Added on Feb 24 2011
7 comments
318 views