Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to delete all the table data of a schema

User568425-OracleFeb 10 2017 — edited Feb 10 2017

Hi,

I am looking to delete all the table data of particular schema. I have written a script like this:

BEGIN

  FOR c IN (SELECT table_name FROM user_tables)

  LOOP

    EXECUTE IMMEDIATE ('SELECT COUNT(*) FROM' || c.table_name);

  END LOOP;

END;

But it doesn't seem to work. Can some body help how it can be achieved?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 10 2017
Added on Feb 10 2017
12 comments
1,471 views