Home » RDBMS Server » Server Utilities » SQL *Loader multiple table insert problems
SQL *Loader multiple table insert problems [message #72843] Sat, 15 November 2003 23:22 Go to next message
Chander
Messages: 4
Registered: November 2001
Junior Member
I have a excel sheet which i convert it to a .csv format. the columns present in excel sheet have to be entered into 2 tables (tab1 and tab2) but in excel sheet i have columns col1,col2,col3,col4 out of which col1,col3 have to be inserted into tab1 and the col2,col4 have to be inserted into tab2. If the excel sheet has the columns in the order col1,col3,col2,col4 then the inserts are going just fine but i can not change the ordering of the columns. Any help on how to achieve the above would be highly appreciated. (i can
not use fixed format)...

Thanks in advance,
Chander
Re: SQL *Loader multiple table insert problems [message #72849 is a reply to message #72843] Mon, 17 November 2003 05:31 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
sql*loader is not too intelligent.
a standard workaround we always do ( if our custom perl parser is not helping )
1. create a temp table with c1,c2,c3,c4 order.
2. insert records into this table using sql*loader as-is.
3. later you can copy the records into any tables in any order u want.
   insert into table2 ( select c1,c3 from temp_table);]]
   insert into table4 ( select c2,c4 from temp_table);
   or 
   you can write an after insert trigger in temp_table.
   so thbat, every inserted record is again insert into the corresponding tables table1 and table2.,

Previous Topic: Loading EBCDIC Data using SQL Loader
Next Topic: Full Database Export Import (Privileges not getting granted)
Goto Forum:
  


Current Time: Sat Jun 29 06:11:26 CDT 2024