📌  相关文章
📜  oracle 如果不存在则创建表 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:35.097000             🧑  作者: Mango

代码示例2
DECLARE                                -- Oracle
    existing_table number;            
BEGIN
    SELECT count(*) into existing_table FROM ALL_TABLES
    WHERE TABLE_NAME = 'table_name' AND OWNER = 'owner';
    IF existing_table = 1 then
        EXECUTE IMMEDIATE 'DROP TABLE owner.table_name';
    END IF;
END;
/
CREATE TABLE owner.table_name (BDAY DATE, [...]);