Skip to content

Instantly share code, notes, and snippets.

@akhsiM
Created May 20, 2020 15:06
Show Gist options
  • Save akhsiM/2a2a16fbe74ce479a8ad05165d798443 to your computer and use it in GitHub Desktop.
Save akhsiM/2a2a16fbe74ce479a8ad05165d798443 to your computer and use it in GitHub Desktop.
-- Clear all temp tables in your space
undef current_schema;
begin
for cur_cleanup in (
select object_name
,object_type
from user_objects
where object_type = 'TABLE'
and temporary = 'Y'
)
loop
begin
execute immediate 'truncate '|| cur_cleanup.object_type|| ' "'||
cur_cleanup.object_name|| '" drop storage';
execute immediate 'drop '|| cur_cleanup.object_type|| ' "'||
cur_cleanup.object_name|| '" cascade constraints';
end;
end loop;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment