在 ORACLE 中使用 FORALL 选项更新多个表

Updating Multiple Tables using FORALL option in ORACLE

任何人都可以帮助我如何在 oracle 中的 FORALL 选项中给出多个 DML 语句。

how to give multiple DML statements inside FORALL

你不能。一个FORALL语句只能支持一个DML语句。对于 "n" DML,您需要编写 "n" FORALL 语句。

实际上,您可以将 DML 放在一个匿名 pl/sql 块中,然后通过立即执行语句 运行 将其放入,如下所示 (https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:9530395800346231332):

 forall 1 .. l_var.count
     execute immediate 'begin
     delete tab1 where id=:1;
     delete tab2 where id=:1;
     delete tab3 where id=:1;
   end;' using l_var(i);