Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: DDL

Re: DDL

From: David Fitzjarrell <fitzjarrell_at_cox.net>
Date: 18 Nov 2004 15:08:51 -0800
Message-ID: <9711ade0.0411181508.16af523e@posting.google.com>


DA Morgan <damorgan_at_x.washington.edu> wrote in message news:<1100761866.606335_at_yasure>...
> Rahul Jain wrote:
>
> > Why is DDL required to be the last statement in a transaction?
>
> It isn't. Where did you hear this?

Presuming you mix DML and DDL in the same script or set of commands (which, with a few limited exceptions like dropping or creating a temp table, I question), to preserve the completeness (for lack of a better word at the moment) of the transaction the DDL should be placed AFTER any inserts, updates and/or deletes to data. The OP has worded this incorrectly, and English, for non-English speakers (and some who claim it as their primary tongue) is a cruel taskmistress. To be correct:

If it is necessary to mix both DML and DDL the DDL should follow any statements comprising a single transaction, as the DDL will issue a commit prior to its execution, and another commit afterwards. Note that the DDL will commit the prior transaction BEFORE it executes, so it isn't truly a part of the transaction itself; the DDL starts a new transaction comprised solely of the DDL.

So, Howard is correct, and Daniel and Richard are also correct, since the original question can be read in a number of ways. Howard read it as I did initially, asking, "Why must I put my DDL at the end of a transaction?" Daniel and Richard read it as it was written, and their responses are also correct, in that there is no requirement to include DDL at the end of a transaction.

I hope this helps settle the matter.

David Fitzjarrell Received on Thu Nov 18 2004 - 17:08:51 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US