Problem with FORALL, ORA-24381

twrzodak

Member
hello,
I have a problem with code that raise ORA-24381, PL/SQL Developer (9.0.4.1644) does not show in SQL WIndows exception raised by Oracle:

Code:
CREATE TABLE twr_t1(c1 INT NOT NULL UNIQUE);

DECLARE
  TYPE t_int IS TABLE OF INT;
  lt_int t_int := t_int();
  e_dml_errors EXCEPTION;
  PRAGMA EXCEPTION_INIT(e_dml_errors, -24381);
BEGIN
  lt_int.extend(10);
  FOR i IN 1..10 LOOP
    lt_int(i) := i;
  END LOOP;
  lt_int(5) := 4;

  FORALL i IN 1..lt_int.count SAVE EXCEPTIONS
    INSERT INTO twr_t1(c1) VALUES (lt_int(i));
END;
/

There is no exception, status in SQL Window is "Done in ... seconds".

There is a problem also in command windows, after executing anonymous block: Warning: PL/SQL procedure successfully completed with compilation errors

In sql*plus is of cource

Code:
ERROR:
ORA-24381: error(s) in array DML
ORA-06512: at line 13

Is this a bug?
 
To obtain some more diagnostic information, can you modify the shortcut and add the DebugSQL parameter? For example:

"C:\Program Files\PLSQL Developer\plsqldev.exe" DebugSQL

Reproduce the problem and send me the debug.txt file that is generated in the PL/SQL Developer directory or in the %APPDATA%\PLSQL Developer directory (e.g. C:\Users\\AppData\Roaming\PLSQL Developer).
 
here is my test case:

CREATE TABLE mytab(col1 NUMBER PRIMARY KEY);

INSERT INTO mytab VALUES (1);
COMMIT;

DECLARE
TYPE t_nums IS TABLE OF NUMBER INDEX BY PLS_INTEGER;
x t_nums;
BEGIN
x(1) := 2;
x(3) := 1;
x(5) := 3;

FORALL i IN INDICES OF x SAVE EXCEPTIONS
INSERT INTO mytab VALUES (x(i));
END;
/
 
the execution in command window is also bizarre.
The plsql block is executed successfully and I receive:
"Warning: PL/SQL procedure successfully completed with compilation errors"
 
Back
Top