Oracle 创建表的存储过程

来源:互联网 发布:红蜘蛛软件年费 编辑:程序博客网 时间:2024/05/22 12:40
create or replace procedure mytestdrop as v_cnt  number; begin   select count(*) into v_cnt from user_tables where table_name = 'MYTESTDROPTABLE';   if v_cnt>0   then   dbms_output.put_line('该表存在!');   execute immediate  'drop table MYTESTDROPTABLE';   end If;   dbms_output.put_line('不存在就创建表!');   execute immediate 'create table MYTESTDROPTABLE tablespace MYDB_SPACE as select * from GETSYSDATE'; 
原创粉丝点击