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!

Truncate vs Delete in Loop

TheOldHagJan 31 2014 — edited Jan 31 2014

I understand that truncate lowers the high water mark on a table which allows space to be freed up and is generally quicker than a delete. However, if you have a temp table in a loop in which you are storing some scratch data each time you go through a loop and that scratch data is a constant size, lets size 500 rows, would it be better to delete the table so as to not have to acquire space each time through the loop. Also, I understand in this situation it may be better to use a nested table in PL/SQL but the question is still a valid one since I don't see it considered much in the discussions as delete retains space that you will end up needing to allocate repeatedly in a loop.

This post has been answered by unknown-7404 on Jan 31 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 28 2014
Added on Jan 31 2014
2 comments
578 views