我正在尝试将带有多个值的2行插入2行,然后test_id.nextval中的dataframe中,而无需在代码中包含列标题:
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 ID的现有表中?
尝试以下:
insert into x
select tt.* , test_id_seq.nextval from
(select 12345, 'text' from dual
union all
select 23589, 'other text' from dual) tt;