在删除表前,oracle如何判断表是否存在,存在就删再创建,不存在直接创建!

来源:互联网 发布:mac海淘攻略 编辑:程序博客网 时间:2024/05/21 08:46

http://topic.csdn.net/u/20070327/17/e322facd-794d-48c8-9ea5-66e4a8394cfe.html

 

declare      
    num       number;      
    begin      
    select       count(1)       into       num       from       user_tables       where       table_name= '大写表名 ';      
    if       num> 0       then      
    execute       immediate       'drop       table       '||大写表名;      
    end       if;      
    execute       immediate       'create       table.... ';      
    end;