Oracle存储过程-删除所有表
?
删除所有user_tables中的表 ,这样非常不安全,执行改存储过程则会非常的危险. 请谨慎使用.
create or replace procedure PROC_dropTable(tabName in varchar2)as --引用user_tables表中的tableName的类型; tableName user_tables.table_name%type; mycount number(10); begin --把存储过程传过来的参数,赋值给tableName; tableName:= tabName; SELECT COUNT(*) INTO mycount FROM user_tables WHERE TABLE_NAME = tableName ; if mycount>0 then execute immediate 'DROP TABLE '||tableName; end if; end; /
?
?
?