Mest sandsynligt, at en markør åbnes baseret på en global midlertidig tabel (GTT), som var blevet oprettet med ON COMMIT DELETE ROWS
mulighed. Og årsagen til ORA-08103: object no longer exists
fejlen er commit
sætning, der fulgte lige efter delete
udmelding. Her er et simpelt eksempel:
SQL> declare
2 type t_recs is table of number;
3 l_cur sys_refcursor; -- our cursor
4 l_rec t_recs;
5
6 begin
7
8 -- populating a global temporary table GTT1 with sample data
9 insert into GTT1(col)
10 select level
11 from dual
12 connect by level <= 1000;
13
14 open l_cur -- open a cursor based on data from GTT1
15 for select col
16 from GTT1;
17
18 -- here goes delete statement
19 -- and
20 commit; <-- cause of the error. After committing all data from GTT1 will be
21 -- deleted and when we try to fetch from the cursor
22 loop -- we'll face the ORA-08103 error
23 fetch l_cur -- attempt to fetch data which are long gone.
24 bulk collect into l_rec;
25 exit when l_cur%notfound;
26 end loop;
27
28 end;
29 /
ORA-08103: object no longer exists
ORA-06512: at line 24
Genskabelse af global midlertidig tabel med on commit preserve rows
klausulen giver mulighed for sikkert at hente data fra en markør, der er baseret på den tabel uden at være bange for at se ORA-08103:
fejl.