📜  oracle 删除临时表 - SQL 代码示例

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

代码示例1
CREATE OR REPLACE PROCEDURE p AS
    table_or_view_not_exist EXCEPTION;
    PRAGMA EXCEPTION_INIT (table_or_view_not_exist, -942);
    attempted_ddl_on_in_use_GTT EXCEPTION;
    PRAGMA EXCEPTION_INIT (attempted_ddl_on_in_use_GTT, -14452);
BEGIN
    EXECUTE IMMEDIATE 'DROP TABLE t';

EXCEPTION
    WHEN table_or_view_not_exist THEN
        dbms_output.put_line('Table t did not exist at drop time. Continuing.');

    WHEN attempted_ddl_on_in_use_GTT THEN
        dbms_output.put_line('Help ! Someone is doing my job!');
        dbms_output.put_line('Please rescue me');
        RAISE;
END p;