我在使用 PL/SQL 向 Oracle 表中进行大量插入时遇到问题。我的查询逐行进行,查询对每一行进行计算以确定它需要插入另一个表的行数。传统的插入工作,但代码需要很长时间才能运行大量行。为了加快插入速度,我尝试使用Append_Values
以下示例中的提示:
BEGIN
FOR iter in 1..100 LOOP
INSERT /*+ APPEND_VALUES*/ INTO test_append_value_hint values (iter);
END LOOP;
END;
执行此操作时,我收到以下错误消息:
ORA-12838: cannot read/modify an object after modifying it in parallel
ORA-06512: at line 3
12838. 00000 - "cannot read/modify an object after modifying it in parallel"
*Cause: Within the same transaction, an attempt was made to add read or
modification statements on a table after it had been modified in parallel
or with direct load. This is not permitted.
*Action: Rewrite the transaction, or break it up into two transactions
one containing the initial modification and the second containing the
parallel modification operation.
有没有人知道如何使这段代码工作,或者如何快速将大量行插入另一个表?