Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> multi-table insert in Oracle 9i

multi-table insert in Oracle 9i

From: Niloufar <niloufar_at_veltisto.com>
Date: Thu, 26 Jun 2003 20:50:03 GMT
Message-ID: <3EFB5C9C.4040703@veltisto.com>


Could someone please tell me what am I doing wrong that causes both of the following multi-table insert statements to fail with a "missing key" error. My Oracle server is Version 9.2.0.2.0.

Thanks,
Niloufar



create table junk(id number,order_num varchar2(10),bill_amt number); create table junk2(id2 number,order_num2 varchar2(10),bill_amt2 number); create table junk_input(order_id number,order_number varchar2(10),bill_amt number);
insert into junk_input values (1, '1234', 10);
insert into junk_input values (2, '1234', 10);
insert into junk_input values (3, '1234', 10);
insert into junk_input values (4, '5678', 10);
insert into junk_input values (5, '5678', 10);
select * from junk_input;

       tried both:

       insert all when 1=1
       into junk (id, order_num, sequence_num)
       select order_id, order_number, seq_num from junk_input;

       and tried:

       insert all when 1=1
       into junk (id, order_num, sequence_num)
       when order_number = '5678'
       into junk2 (id2, order_num2, sequence_num2)
       select order_id, order_number, seq_num from junk_input;
Received on Thu Jun 26 2003 - 15:50:03 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US