How to create and use temporary table in oracle stored procedure?

前端 未结 5 789
挽巷
挽巷 2020-11-30 06:01

I want to create temporary table in stored procedure and access it in the same but I got error that ORA-00942:Table or view does not exists. Following is the pr

5条回答
  •  执念已碎
    2020-11-30 06:55

    CREATE OR REPLACE PROCEDURE myproc IS
    BEGIN
    
        CREATE GLOBAL TEMPORARY TABLE temp (id NUMBER(10)) ON COMMIT DELETE ROWS AS
            SELECT 10 FROM dual;
    
    END;
    /
    

提交回复
热议问题