I have a dynamic sql :
forall k in 1..Job_ID.COUNT Save exceptions
EXECUTE IMMEDIATE 'insert into XYZ values(:1,:2,:3)' using sequence_one.NextVal,job_id(k),Name(k);
///Exception handling.
On running the abouve query only one row is getting inserted.And following error is thrown:
ORA-24381: error(s) in array DML.
Any idea why above thing is happening?
Do you really want every inserted row to have the same sequence value in the first column? If not you should do this:
Or even better (unless you have a good reason for using dynamic SQL: