Skip to main content

Posts

Showing posts with the label Know that Truncate is DML or DDL in SQL

Know that Truncate is DML or DDL in SQL

These are some reason why truncate is ddl not dml 1. TRUNCATE can change storage parameters (the NEXT parameter), and those are part of the object definition - that's in the DDL commands. ... 2. TRUNCATE does an implicit commit, and cannot be rolled back most DDL operations in Oracle do this, no DML does.that's Truncate is DDL 3. TRUNCATE TABLE handles table as an entity to clear all data from the specified table 4. Deallocates all space used by the removed rows make truncate to DDL 5. The fact that TRUNCATE doesn't run ON DELETE triggers also sets it apart from normal DML operations (but some DML operations also skip triggers, so that's not a clear indicator. As TRUNCATE removes all rows, it can theoretically be implemented by dropping the table and recreating it in which case it is like any other DDL statement The statement is not expected to be used for usual transactions where insert,update,delete and select statements are used.It is mainly meant for ...