declare
cursor c1 is
select ‘drop table ‘||table_name|| ‘ cascade constraints’ text from all_tables where owner =’USER_NAME’;
begin
for i in c1 loop
BEGIN
dbms_output.put_line(‘Performing: ‘||i.text);
EXECUTE IMMEDIATE (i.text);
EXCEPTION
When Others Then
DBMS_OUTPUT.PUT_LINE(‘ERROR=’||i.text);
DBMS_OUTPUT.PUT_LINE(SQLERRM);
–RAISE;
END;
end loop;
end;
/

Reklamlar