Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Snapshot too old
I am having a puzling problem. I have a pl/sql procedure that opens a cursor in a loop, inserts records from the cursor into a table, and if there are any errors, the error messages are inserted into a third table via an exception section. I am committing after every insert, the tables are empty before the procedure starts, but I am still getting a "SNAPSHOT TOO OLD" message. Here is a fragment of code similar to what I am working with, but simplified:
CREATE OR REPLACE PROCEDURE proc1 AS
BEGIN
DECLARE
CURSOR c1 IS SELECT a, b FROM t1; BEGIN FOR c1_rec IN c1 LOOP BEGIN INSERT INTO t2 VALUES (c1_rec.a, c1_rec.b); COMMIT; EXCEPTION WHEN OTHERS THEN DECLARE err_msg VARCHAR2(256) := SQLERRM; BEGIN INSERT INTO problems <<<<Error points here. VALUES (SYSDATE, err_msg); COMMIT; END; END; END LOOP;
Any answers to this question would be greatly appreciated. Received on Sat Dec 14 1996 - 00:00:00 CST