BEGINFOR iter in 1..100 LOOPINSERT /*+ APPEND_VALUES*/ INTO test_append_value_hint values (iter);END LOOP;END;
执行此 *** 作时,我收到以下错误消息:
ORA-12838: cannot read/modify an object after modifying it in parallelORA-06512: at line 312838. 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.
有没有人知道如何使这个代码工作,或如何快速插入大量的行到另一个表?
解决方法 您收到此错误,因为您的每个INSERT都作为单独的DML语句执行. Oracle阻止对使用直接路径插入添加数据的表进行读/写,直到提交为止.从技术上讲,您可以使用PL / sql集合和FORALL:
sql> declare 2 type array_t is table of number index by pls_integer; 3 a_t array_t; 4 begin 5 for i in 1..100 loop 6 a_t(i) := i; 7 end loop; 8 forall i in 1..100 9 insert /*+ append_values */ into t values (a_t(i)); 10 end; 11 /
但Justin问的问题是在行动 – 你的数据来自哪里,为什么你不能使用通常的INSERT / *追加* / INTO … SELECT FROM方法?
总结以上是内存溢出为你收集整理的oracle – PL / SQL Append_Values提示提供错误消息全部内容,希望文章能够帮你解决oracle – PL / SQL Append_Values提示提供错误消息所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)