-
I am trying to truncate all the tables in my database before doing an import. There are like around 150 tables and I have a procedure to do it which fetches each tablename and then executes a DELETE statement.
But it has been like an hour since I started the process and it still is executing( I think so..) But it never used to take this much time. Can anyone think of a reason for this?
Shiva.
-
Delete Statements are slow because they can be rolled back.
Use TRUNCATE TABLE ...; It is much faster.
To use this command in a stored procedure you will have to use execute immediate, like this :
execute immedate('truncate table mytable');
-John
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|