Oracle Create Table if it does not exist

前端 未结 4 1030
渐次进展
渐次进展 2020-12-11 03:36

Can anyone point me to the right syntax to use in order to create a table only if it does not currently exist in the database?

I\'m currently programming a Java GUI

4条回答
  •  一整个雨季
    2020-12-11 04:07

    You can do this with the Following Procedure -

    BEGIN
        BEGIN
             EXECUTE IMMEDIATE 'DROP TABLE <>';
        EXCEPTION
             WHEN OTHERS THEN
                    IF SQLCODE != -942 THEN
                         RAISE;
                    END IF;
        END;
    
        EXECUTE IMMEDIATE '<>';
    
    END;
    

    Hope this may help you.

提交回复
热议问题