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

前端 未结 5 800
挽巷
挽巷 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:36

    Just create it first (once, outside of your procedure), and then use it in your procedure. You don't want to (try to) create it on every call of the procedure.

    create global temporary table tmp(x clob)
    on commit delete rows;
    
    create or replace procedure...
    -- use tmp here
    end;
    

提交回复
热议问题