I want to insert 2 lines in a table within one insert into
statement with Oracle SQL.
This code works:
insert into a_glw select tt.*, work_id_seq.nextval from
(select 11111, 'one text', 12345, 'new text', NULL,
'some text', 'nice text', 'test', 'text', 'great text'
from dual
union all
select 11111, 'one text', 12345, 'new text', NULL,
'some text', 'nice text', 'test', 'text', 'great text'
from dual) tt;
When I change the value test
to text
this code produces the error 00918. 00000 - "column ambiguously defined"
:
insert into a_glw select tt.*, work_id_seq.nextval from
(select 11111, 'one text', 12345, 'new text', NULL,
'some text', 'nice text', 'text', 'text', 'great text'
from dual
union all
select 11111, 'one text', 12345, 'new text', NULL,
'some text', 'nice text', 'test', 'text', 'great text'
from dual) tt;
It seems to be a problem to insert identical values in one select statement. How can I fix this?