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: Truncate in stored procedure

Re: Truncate in stored procedure

From: Jurij Modic <jmodic_at_src.si>
Date: Wed, 30 Dec 1998 22:18:53 GMT
Message-ID: <368a897e.9954303@news.siol.net>


On Wed, 30 Dec 1998 16:05:33 GMT, andrewf_at_jaredgroup.com wrote:

>Thank you all for the answers. I did not know that 'Truncate' is a DDL. I
>thought it was like a DML (delete without log). I am curious about the reason
>it is treated as a DDL by PL/SQL and would appreciate it if you guys have some
>explanation. Does it change some internal structure or what? Also, does it
>issue a 'Commit' as other DDL do, if it does not log its deletes?

It isn't just PL/SQL that treats it like DDL! TRUNCATE command *is* DDL command. Not that it doesn't create any redo entries, it doesn't create any undo entries, so it can't be rolled back. Besides, you are correct, it does perform implicit commit (two commits, to be precise - one before it executes and one after it is finished, like any other DDL command).

Don't think of it like DELETE without the WHERE condition, you better think of it as DROP TABLE + CREATE TABLE with all the other stuf it has to do to remain all the constraints, views, synonyms ... and other references to the table.

HTH,
Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)



The above opinions are mine and do not represent any official standpoints of my employer Received on Wed Dec 30 1998 - 16:18:53 CST

Original text of this message

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