diff b/w truncate and drop [message #61861] |
Mon, 07 June 2004 02:15 |
ashokmote
Messages: 56 Registered: December 2003
|
Member |
|
|
i want to know the difference of truncate and drop.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
DEMO TABLE
DEMO1 TABLE
DEPT TABLE
SQL> drop table demo1;
Table dropped.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
DEMO TABLE
DEPT TABLE
SQL> truncate table demo;
Table truncated.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
DEMO TABLE
DEPT TABLE
SQL> drop table demo;
Table dropped.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
DEPT TABLE
SQL>
|
|
|
|
|
Re: diff b/w truncate and drop [message #61875 is a reply to message #61868] |
Mon, 07 June 2004 19:58 |
Srinivas
Messages: 138 Registered: June 2000
|
Senior Member |
|
|
Hi Kiran...
Truncate will delete the records and set the High water mark, nothing to do with table structure, will remains same.
But, drop will delete entire table structure along with records.
U can't compare drop and truncate commands.
U can compare delete and truncate commands.
Drop is a DDL statement.
Truncate is also a DDL statement, but acts as a DML statement.
We can't rollback data from the above commands..
HTH,
Srinivas
|
|
|