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!

insert all order

kaericnMay 25 2018 — edited Oct 13 2018

Is the insert all guarantee the insert orders e.g.

We have the scenario similar to the code sample below that we can parent key not found error.

And we suspect its because the order of insertion is not guaranteed in the sql ?

Is there a way that we can guarantee the order of operation in DML  as such ?

create table tt_p as select * from user_objects where 1 = 0

create table tt_c as select * from user_objects where 1 = 0

ALTER TABLE

   tt_p

ADD CONSTRAINT

   pk_object_id

PRIMARY KEY (object_id);

ALTER TABLE tt_c

ADD CONSTRAINT object_id_fk1

FOREIGN KEY (object_id)

REFERENCES tt_p (object_id);

insert all into  tt_p

into tt_c

select * from user_objects;

This post has been answered by mathguy on May 26 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 10 2018
Added on May 25 2018
24 comments
2,918 views