I have a cursor that I fetch using bulk collect into an array.
I then use FORALL x IN a_array.FIRST..a_array.LAST and do an update of tablea with a where condition of: field_a = a_array(x); - this works fine
I then need to delete from a different table so do delete from tableb with a where condition of: where field_b = a_array(x);
because there are now two dml statements the second one errors with PLS-00201: identifier 'X' must be declared and this highlights the x in brackets in the second dml statement.
Is is possible to carry out multiple dml statements within a forall ?
TIA
[blue]DBomrrsm[/blue]
[blue]Software code, like laws and sausages, should never be examined in production[/blue][black] - [/black][purple]Edward Tenner[/purple]
I then use FORALL x IN a_array.FIRST..a_array.LAST and do an update of tablea with a where condition of: field_a = a_array(x); - this works fine
I then need to delete from a different table so do delete from tableb with a where condition of: where field_b = a_array(x);
because there are now two dml statements the second one errors with PLS-00201: identifier 'X' must be declared and this highlights the x in brackets in the second dml statement.
Is is possible to carry out multiple dml statements within a forall ?
TIA
[blue]DBomrrsm[/blue]
[blue]Software code, like laws and sausages, should never be examined in production[/blue][black] - [/black][purple]Edward Tenner[/purple]