02287. 00000 - “此处不允许序列号”

时间:2017-05-28 23:49:34

标签: sql oracle

我创建了一个maxvalue为10的序列。我试图使用单个insert语句在多个表中插入值,但是会出现以下错误。 02287. 00000 - “此处不允许使用序列号”

insert all into test_t1 values (col1,col2)
into test_t2 values (col1,col2)
select test_seq.nextval col1, test_seq.currval col2 
from dual;

1 个答案:

答案 0 :(得分:1)

你可以参考CURRVAL& NEXTVAL在单个SQL语句中,但不在INSERT ALL语句的源中。

参见:

https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:6915127515933

http://www.orafaq.com/wiki/ORA-02287