There are two database: DB1 local and DB2 remote, both Oracle 11g R2.
On local database DB1 I collect some data from remote one with the help of the following code:
..
v_acct_id := 999;
..
v_stmt := 'select x, y from some_table@' || db_link_to_DB2 || ' where acct_id = :val';
..
execute immediate v_stmt bulk collect into v_collection using v_acct_id;
..
The code above fills the v_collection with values of x, y properly.
Now I would like to delete remotely from some_other_table based on the values {x} just collected and with use of forall operator (ie. using bulk operation). If I was working on DB2 database what I would like to do could be coded like this:
delete some_other_table
where x in ( select x from some_table where acct_id = 999 );
But is it possible to archive the same result with the help of FORALL operator, EXECUTE IMMEDIATE and v_collection over db link so that this could be invoked on local DB1 database? If so, how this can be coded?
thank you