Create a temporary table during the Oracle stored procedure

xiaoxiao2021-03-06  61

create procedure proasstr ​​varchar2 (100); beginstr: = 'CREATE GLOBAL TEMPORARY TABLE TABLENAME (COL1 VARCHAR2 (10), COL2 NUMBER) ON COMMIT PRESERVE ROWS'; execute immediate str; - is performed using dynamic SQL statements end; /

The DDL statement cannot be used directly in the stored procedure, so you can only use dynamic SQL statements. Description Temporary Table is specified by sessions, and Oracle will truncate the table when the session is interrupted. Create Global Temporary Table Admin_Work_Area On Commit Delete Rows As SELECT * FROM DEPT

转载请注明原文地址:https://www.9cbs.com/read-112328.html

New Post(0)