Oracle Application Express (MOSC)

MOSC Banner

auto commit in sql commands not working with global temporary table

edited May 17, 2016 5:03AM in Oracle Application Express (MOSC) 1 commentAnswered

In APEX sql commands environment, if the 'autocommit' is checked, the data is not preserved for global temporary table. Is this a bug or configuration issue?

(1). Table creation script:

CREATE GLOBAL TEMPORARY TABLE my_temp(

id           NUMBER,

description  VARCHAR2(20)

)

ON COMMIT preserve ROWS;

(2). insert data into the table

INSERT INTO my_temp

WITH data AS (

SELECT 1 AS id

FROM   dual

CONNECT BY level < 10000

)

SELECT rownum, TO_CHAR(rownum)

FROM   data a, data b

WHERE  rownum <= 10

(3). viewing the data

select * from my_temp;

This will return 'no Data found'.


Does it mean the session ends, that's why it returns no data? And strange enough, this happens only in our production environment, in development environment, even with 'autocommit' checked, we can get data back with all the steps mentioned above.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center