473,326 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Bulk Inserts

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
2 2483
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: iqbal | last post by:
Hi all, We have an application through which we are bulk inserting rows into a view. The definition of the view is such that it selects columns from a table on a remote server. I have added the...
2
by: Niraj | last post by:
Hi, I am trying to do bulk insert of binary data (array of bytes) in an Oracle table. The data type of the table is BLOB. I am using Oracle Objects for OLE (OO4O) in C++. The binary data that I...
1
by: gchavez | last post by:
I'm running MSSQL 2K on Win 2k and just upgraded SQL Server from SP3 to SP4 (that's when my problem started). I have a procedure that bulk inserts from a text file that is located on a Netware 4.11...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
0
by: Eric Paul | last post by:
I have been in search of a better way to handle bulk inserts and updates into SQL 2000 using c# and while I have found a few different ways to accomplish this I was wondering what is considered to...
1
by: Metal Dave | last post by:
I do not understand the error handling of SQL Server here. Any error in bulk insert seems to halt the current T-SQL statement entirely, rendering it impossible to log an error. The first statement...
0
by: ozkhillscovington | last post by:
We have sp's in place that do BULK INSERTS from txt files into the tables. This works fine, however they have asked us to add a field that identifies accounting ctr. The only thing that identifies...
2
by: mivey4 | last post by:
Hi, I have been searching but haven't had any luck finding a method of performing bulk inserts of data into Oracle comparable to using the BCP utility with MSSQL. In our MSSQL environment I...
0
by: rshivaraman | last post by:
BULK INSERT bill_tbl FROM 'd:\ftp_Data\in\baddress.dat' WITH ( FIELDTERMINATOR = ';', ROWTERMINATOR = '\n' ) --------------------------------- This is the query used to populate bill_tbl....
4
by: shreyask | last post by:
I have been working on doing bulk updates and inserts through sqlapi++ using a bulk udpate extention library, developed, a long time ago, internally. The database is oracle. The bulk inserts/updates...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.