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!

Partitioning Existing table

user520824Dec 11 2006 — edited Dec 11 2006
Hello,
I would like to partition an existing table. How can i achive this?
This is what i am trying to do:
1) rename existing table
2) import the new table
3) drop the renamed table

But i have foreign key constraints, it is not allowing me to drop it. I dont want to drop all FOREIGN Key constratins.


create table emp_master (no number);

alter table emp_master add constraint pk_emp_master primary key (no);

create table emp_child (no number);

alter table emp_child add ( constraint fk_emp_chilk foreign key (no)
references emp_master(no));

insert into emp_master values (10);
insert into emp_child values (10);

rename emp_master to emp;

Import the table emp_master -- recreating table

drop table emp -- ERROR i am getting.

I also want to point all the foreign key constraints to emp_master table. But the emp table already has that constraint name so i am no longer able to create the same FK name. Well, i will not be able to drop emp table also here in order to create the same PK on emp_master.....
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 8 2007
Added on Dec 11 2006
4 comments
269 views