I am confusing with the global temporary table in Oracle:
For example, I want to write a SP MySP which can be used by 5 users at the same time.
CREATE GLOBAL TEMPORARY TABLE temp
(ID NUMBER, COL1 VARCHAR2(4000), COL2 VARCHAR2(4000));
CREATE OR REPLACE PROCEDURE MySP
(
id NUMBER
, input1 varchar2(4000)
, input2 varchar2(4000)
)
AUTHID CURRENT_USER IS
sql_stmt VARCHAR2(4000);
BEGIN
sql_stmt := 'INSERT INTO temp VALUES ('
+ TOCHAR(ID,99) + ','
+ input1 + ','
+ input2
+ ')';
execute sql_stmt;
END MySP;
My question is:
When the five user run the SP at same time, will they not interrupt with each other because they use the same global temp table?
Best Answer
http://docs.oracle.com/database/121/SQLRF/statements_7002.htm#SQLRF01402