Re: Q: DDL/DML & rollback

From: Hans Forbrich <forbrich_at_tibalt.supernet.ab.ca>
Date: 1 Jun 1994 14:55:21 -0600
Message-ID: <2sisjp$9g3_at_tibalt.supernet.ab.ca>


BO/EBC/KX/RGFC Roger Bjaerevall 08-682 4851 (ebcrbj_at_ebcw150.ericsson.se) wrote:
> Does Oracle implicitly commits if there are mixed DML and DDL statements
> in the current transaction?
 

> Scenario:
 

> ---
> ora_csr csr, anotherCsr;
 

> open(&csr);
> parse(&csr, "INSERT INTO a VALUES (:anInt, :aChar)");
 

> do (5) {
> // Set anInt and aChar
> exec(&csr);
> }
 

> open(&anotherCsr);
> parse(&anotherCsr, "CREATE TABLE b (key NUMBER, name VARCHAR2(20));
> exec(&anotherCsr);
 

> rollback();
> ---
>
> Even if I end the Oracle stuff with a rollback() there will be 5 rows in the 'a'
> table. The 'b' table will exist as supposed (though DDL statements can't be
> rollback'ed).
Oracle does an implicit commit BECAUSE you request the CREATE TABLE.

In their documentation, you will find that any DDL (CREATE/ALTER/DROP) will do a commit.

/Hans Received on Wed Jun 01 1994 - 22:55:21 CEST

Original text of this message