create or replace procedure drop_user_table (in_table IN varchar2) authid current_user IS -- Declare the variables for counting tables and setting the execute statement. tbl_exists integer; my_stmt varchar2(100); BEGIN -- Make a count to see if table exists select count(*) into tbl_exists from all_tables where table_name = in_table and owner = user; -- If table exeists, then set the statement to drop it and execute the statement. if tbl_exists = 1 then my_stmt := 'drop table ' || in_table; EXECUTE IMMEDIATE my_stmt; end if; END;