oracle建表之前删除原表的语句

xiaoxiao2021-02-28  81

declare        num   number;  begin        select count(1) into num from all_tables where TABLE_NAME = 'TABLE'; --查看存不存在该表       if   num=1   then            execute immediate 'drop table TABLE';  --执行删除操作

      end   if; 

    execute immediate--执行建表操作     'create table TABLE (        CELL1              varchar2(20)    primary key               not null,       CELL2               number     )';        end; 
转载请注明原文地址: https://www.6miu.com/read-43176.html

最新回复(0)