Re: DDL and transactions

From: Jonathan Leffler <jleffler_at_earthlink.net>
Date: Thu, 07 Oct 2004 05:45:18 GMT
Message-ID: <OJ49d.8259$M05.5113_at_newsread3.news.pas.earthlink.net>


Laconic2 wrote:

> "Karel van der Walt" <karelvdwalt_at_webmail.co.za> wrote:

>>Are DDL statements enclosed in transactions? I.e. is it ever possible
>>to do a rollback on a DDL statement?

>
> AFAIK, this is DBMS specific.

Very much so.

> In DEC Rdb, CREATE, ALTER, and DELETE are all done in the context of a
> transaction for all schema objects, and for most database objects. You can
> DELETE TABLE EMPLOYEES, then do ROLLBACK or COMMIT. CREATE DATABASE,
> ALTER DATABASE, and DELETE DATABASE are done when no one is attached to the
> database, and no transaction is in progress.

IBM Informix Dynamic Server and its relatives do this too.

> Watch out for TRUNCATE, if it exists. In Oracle, at least, TRUNCATE is
> done outside the context of a transaction.

AFAIK, all Oracle DDL is non-transactional.

IBM Informix Standard Engine has the same weakness.

-- 
Jonathan Leffler                   #include <disclaimer.h>
Email: jleffler_at_earthlink.net, jleffler_at_us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
Received on Thu Oct 07 2004 - 07:45:18 CEST

Original text of this message