Data load question

  • From: "Sandeep Dubey" <dubey.sandeep@xxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Fri, 7 Apr 2006 14:03:03 -0400

I need to load data from one table to two tables. It is kind of
noramlizing the data.

As an example:
Source table:
Table A(col1, col2)
A1,B1
A1,B2
A2,B3
A2,B4
A3,B5

From this table I need to insert into Table B and C

I wan to insert data into B and C as:

Table B(id, col1) id is synthetic pk from sequence
1,A1
2,A2
3,A3

Table C(id, col2,B_id) id is pk, b_id is fk to B.id
1,B1,1
2,B2,1
3,B3,2
4,B4,2
5,B5,2

Source table A has 2 million rows. I am trying to do through a single
select on table A and using insert into .. select.  Or using FORALL.

Any good ideas on how to do this?

Regards

Sandeep
--
//www.freelists.org/webpage/oracle-l


Other related posts: