As far as I understand, FORALL is not sequential per-se: if I execute a series of INSERT statements inside a FORALL, they may be optimized to run asyncronously/unsequentially (and also allows me to use the APPEND_VALUES and PARALLEL hint);
But will the result of the bulk collect also reflect the asyncronous execution?
Let's say I pass a SYS.ODCIVARCHAR2LIST as input, as well as v_count representing the collection size, then do:
FORALL idx IN 1..v_count
INSERT INTO my_table (id, value) values (seq_my_table_ids.nextval, my_varray(idx))
RETURNING id BULK COLLECT INTO returned_ids;
OPEN my_out_cursor FOR SELECT column_value FROM TABLE(returned_ids);
Can i assume the index of returned_ids obtained this way will match the index of the array passed as input (or in other words returned_ids(i) is the ID of the record that used my_varray(i) as value)?
From my tests, this seems to be the case, but I wanted to make sure this is a safe assumption to make