日期:2014-05-16  浏览次数:20329 次

oracle判断表名是否存在

declare

??tableCount number;

begin

??select count(*) into tableCount from user_all_tables where table_name = 'STUDENT';

??if tableCount > 0 then

?? ? execute immediate 'drop table STUDENT';

??end if;

??execute immediate 'create table student

?? ? ? ? ? ? ? ? (

?? ? ? ? ? ? ? ? ? ? id integer,

?? ? ? ? ? ? ? ? ? ? stuName varchar2(20),

?? ? ? ?