0

一括削除のような即時実行を使用できますか (カーソルの場合)

forall i in rowid.FIRST .. rowid.LAST
Execute Immediate 'DELETE table_name '||PARTIION_NAME||'where rowid =rowid(m)';

この仕事を行う別の方法はありますか...? 前もって感謝します

4

1 に答える 1

0

で何をしようとしているのかよくわかりませんが||PARTIION_NAME||、次のようなことができます。

DECLARE
  type rowid_tab is table of rowid;
  rowids rowid_tab;

  cursor c is select rowid from table_name where <some condition>;
BEGIN
  open c;
  fetch c bulk collect into rowids;
  close c;

  -- here is where the "real thing" starts
  forall i in rowids.first .. rowids.last 
    execute immediate 'delete table_name where rowid = :1' using rowids(i);

  commit;  

END;

しかし、私は尋ねなければなりません - なぜですか?

于 2012-05-24T12:00:01.337 に答える