我正在嘗試使用另一個表中的數據執行多個插入到oracle表中,我也使用一個序列。像這樣:http://www.dbforums.com/oracle/1626242-insert-into-table-sequence-value-other-table.htmloracle批量插入失敗,因爲序列不會自動增加
Now..in the destination table there are a primary key on the column that being populated by the sequence and it is given me primary key violation。我的猜測是,sequence.nextval由於某種原因不起作用。錯誤在哪裏?這是我的實際查詢:
insert into xxxx (col1, col2, col3, col4, col5)
select SEQ_CNT.nextval, inner_view.*
from (select col1, 26, 0, 'N'
FROM yyyy WHERE col_ID = 30 AND DELETED = 'N') inner_view;
「col1」是您的主鍵嗎?一個可以獲得序列值的人?我問,因爲你有一個col1'在你的inner_view以及 – 2013-02-26 17:27:07
是col1是主鍵 – Victor 2013-02-26 18:55:23