Skip to Main Content
  • Questions
  • db2 Query in Unix: load from /dev/null of del replace into Schema.Tablename nonrecoverable;

Breadcrumb

May 4th

Question and Answer

Connor McDonald

Thanks for the question, Vanka.

Asked: December 05, 2016 - 8:48 am UTC

Last updated: December 06, 2016 - 11:35 am UTC

Version: 12c

Viewed 1000+ times

You Asked

Hi Tom,

In Unix db2 I am using the below query to clear the table.

db2 Query in Unix:

load from /dev/null of del replace into Schema.Tablename nonrecoverable;

What would be the best approach to do the same thing in Oracle.

I don't think delete will do the same thing. Correct me if I am wrong.

and Connor said...

truncate table T;

will empty the table without overhead (ie, it is not a delete, but more of a reset of the table).

truncate is DDL so it cannot be rolled back

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Thanks

Vanka Satyanarayana, December 06, 2016 - 6:34 am UTC

Yeah it is doing the same. Thank you for the help.
Connor McDonald
December 06, 2016 - 11:35 am UTC

glad we could help