我正在尝试将两行包含多个值和test_id.nextval插入到现有数据框中,而不在代码中包含列标题:
insert into x
select * from
(select 12345, 'text', test_id_seq.nextval from dual
union all
select 23589, 'other text', test_id_seq.nextval from dual);
我收到错误:sequence number not allowed here
。所以我删除了序列号。然后发生错误not enough values
。
如何使用nextval ids将多行插入现有表?
答案 0 :(得分:3)
试试这个:
insert into x
select tt.* , test_id_seq.nextval from
(select 12345, 'text' from dual
union all
select 23589, 'other text' from dual) tt;