Compare and contrast TRUNCATE and DELETE for a table.

Answer Posted / santosh

Basically truncate is a DDL and Delete is DML. You can use
delete to remove rows depending on certain criteria and it
generated redo logs and can be rolled back before you
commit the transaction, Where as the truncate is used to
remove all the data in the table. Once you execute this
command u can not rollback this transaction.and commit is
not required for the truncate statement

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how can you get actual data change values from previous transactions in oracle?

615


how can you create a user-defined lock?

588


In what script is "snap$" created? In what script is the "scott/tiger" schema created?

1950


Does transparent data encryption provide encryption when transmitting data across network? : sql server DBA

603


What do the 9i dbms_standard.sql_txt() and dbms_standard.sql_text() procedures do?

1967






What types of replication are supported in sql server? : sql server DBA

605


Illustrate how to determine the amount of physical CPUs a Unix Box possesses (LINUX and/or Solaris).

1497


how can you initialize log miner?

581


what is the use of recording information about current session?

574


You have found corruption in a tablespace that contains static tables that are part of a database that is in NOARCHIVE log mode. How would you restore the tablespace without losing new data in the other tablespaces?

2393


Assuming today is Monday, how would you use the DBMS_JOB package to schedule the execution of a given procedure owned by SCOTT to start Wednesday at 9AM and to run subsequently every other day at 2AM.

1705


How do you troubleshoot errors in a sql server agent job? : sql server DBA

569


When setting replication, can you have distributor on sql server 2005, publisher on sql server 2008? : sql server DBA

562


Query processing is slow(eg select query)how will u solve that

6523


What is replication? : sql server DBA

628