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!

Is there a delay between a truncate command in PL/SQL and the update of the indexes?

user565959Sep 11 2014 — edited Sep 12 2014

I am getting a unique constraint error but I know for certain I do not have duplicates on the offending constraint. These are the steps I'm performing in a package

EXECUTE IMMEDIATE 'TRUNCATE TABLE DBA1.CIM_SEC_USER_DS_RC';

INSERT INTO A (F1, F2, F3, F4)
SELECT FROM B F1, F4, F6, F9 WHERE F8 = 'AB';

In other words there is no command between the truncate and the insert. When the package runs it has recently started throwing an ORA-00001. If the package is immediately rerun with no change in data it succeeds. Do I need to put some sort of delay in after the truncate?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 10 2014
Added on Sep 11 2014
10 comments
2,520 views