Re: Bulk Inserts

From: Christine <karistom_at_hotmail.com>
Date: 16 Dec 2003 22:08:46 -0800
Message-ID: <693b7163.0312162208.4a3eb936_at_posting.google.com>


1.replace all the TAGs.
ex) as you may know >> sed -e "s/<Data>/--<Data>/" aaa.txt > aaa.out

replace <Data> 		->	--<Data>
replace </Data>		->	--</Data>
replace <Employee> 	->	--<Employee>
replace </Employee>	->	--</Employee>
replace <EmpName> 	->	INSERT INTO EMPLOYEE(EmpName, EmpID) VALUES( '
replace </EmpName> 	->  	'
replace <EmpID>		->  	,
replace </EmpID>	->  	); 

2.execute generated output file.

output file will be like this,

  --<Data>
   --<Employee>

     INSERT INTO EMPLOYEE(EmpName, EmpID) VALUES( 'Kiran'
     ,100);

   --</Employee>

Cheers,
Christine.


rayoflight_kiran_at_yahoo.com (Kiran Dalvi) wrote in message news:<b33f94a.0312150302.1671af2c_at_posting.google.com>...
> Hi,
>
> I have following problem scenario .....
>
> I have a XML of the format ....
> <Data>
> <Employee>
> <EmpName>Kiran</EmpName>
> <EmpID>100</EmpID>
> </Employee>
> <Employee>
> <EmpName>Faheem</EmpName>
> <EmpID>1000</EmpID>
> </Employee>
> ..
> ..
> .. ..... I have such 30000+ blocks corressponding to 30000+
> Employees.
> </Data>
>
> Now, I have a DB design with following columns .....
> 1) EmpName Varchar2(64)
> 2) EmpID Number(64)
>
>
> Here I want to parse this XML and persist the data from that XML into
> DB "efficiently".
> I don't want to use conventional INSERTs.
>
> How can I go about it ?
>
> Thanks,
> --Kiran
Received on Wed Dec 17 2003 - 07:08:46 CET

Original text of this message