Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Truncate in stored procedure
In article <368a897e.9954303_at_news.siol.net>,
jmodic_at_src.si (Jurij Modic) wrote:
> 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
>
You can, however, execute it from PL/SQL procedure or package
by using DBMS_SQL package. See your applications developer's guide.
--
Mladen Gogala
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Fri Jan 01 1999 - 19:29:24 CST