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

Breadcrumb

XMAS_TREE

The AskTOM team is taking a break over the holiday season, so we're not taking questions or responding to comments. Please have a happy and safe festive season and as always, thanks for being a member of the AskTOM community.

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)

We're not taking comments currently, so please try again later if you want to add 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