Oracle does not have the syntax of drop table if exists. You can use storage to achieve the effect of deleting if the table exists.
-- 定义存储过程
create or replace procedure proc_droptable(
p_table in varchar2
) is
v_count number(10);
begin
select count(*) into v_count from user_tables
where table_name = upper(p_table);
if v_count > 0 then
execute immediate 'drop table ' || p_table ||' purge';
end if;
end proc_droptable;
-- 调用执行过程
exec proc_droptable('tableName');
[Java interview questions and answers] sorting recommendations
- Basics and Grammar
- set
- network programming
- Concurrent programming
- Web
- Safety
- Design Patterns
- frame
- Algorithms and data structures
- abnormal
- File parsing and generation
- Linux
- MySQL
- Oracle
- Redis
- Dubbo