PTK
PTK

Reputation: 323

02287. 00000 - "sequence number not allowed here"

I have created a sequence with maxvalue as 10. I am trying to insert values in multiple tables using single insert statement but getting following error. 02287. 00000 - "sequence number not allowed here"

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;

Upvotes: 1

Views: 1328

Answers (1)

Jeffrey Kemp
Jeffrey Kemp

Reputation: 60292

You can refer to CURRVAL & NEXTVAL in a single SQL statement, but not in the source for an INSERT ALL statement.

Refer:

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

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

Upvotes: 1

Related Questions