Question

In Oracle, I am invoking the following querys (not from sqlplus) as part of an installation script:

ALTER TABLE MYTABLE DISABLE CONSTRAINT PFTATTRS_ATTR_FK;
INSERT INTO MYTABLE (PTF_ID, ATTR_ID) VALUES (1, 5);
ALTER TABLE MYTABLE ENABLE CONSTRAINT PFTATTRS_ATTR_FK;

As you see I'm interleaving DMLs (that require COMMIT) with DDLs (that are auto-committed). My doubt is: do I need to commit the DMLs before every DDL, or is it safe to do one big commit at the end of my script?

Was it helpful?

Solution

See here.

http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:7072180788422

https://community.oracle.com/message/10310617

Each DDL statement will commit all previous uncommitted DML statements.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top