By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,197 Members | 972 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,197 IT Pros & Developers. It's quick & easy.

Bulk Inserts

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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.
================================================== ==============

ra**************@yahoo.com (Kiran Dalvi) wrote in message news:<b3*************************@posting.google.c om>...
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

Jul 19 '05 #2

P: n/a
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.
================================================== ==============

ra**************@yahoo.com (Kiran Dalvi) wrote in message news:<b3*************************@posting.google.c om>...
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

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.