473,387 Members | 1,365 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,387 software developers and data experts.

Bulk inserts to DB through PL/SQL

Hi,
I have to solve a problem relating to insertion/updation of millions of
rows to DB (Oracle).
The current implementation of the problem is described as follows:
A C++ application receives data from many sources and after processing
it inserts this data to DB. There are various procedures to handle the insert
requests corresponding to various tables. The problem is that for each
row's insertion , the C++ application has to call the procedure. I can buffer
multiple insertion requests and send to the DB server as a bulk. But I dont know how to process this bulk data in DB . Data which I sent from C++ to
DB is either "insertion" or "updation" data.

Please advise me in the following matters:

1) When we want to insert huge data to DB from a back end applicaton , what is the best way?
2) Is there a way to accept a buffer(which contains multiple rows) into a procedure and process each row one by one?

etc ..etc.
Feb 1 '10 #1

✓ answered by OraMaster

Hi,

Why don't you generate CSV files from within C++ application and then try loading those CSV files into Oracle tables. Using the bulk loader that comes with Oracle. This is designed to load CSV data very rapidly into oracle. You could perhaps spawn this program from your C++ Builder program using WinExec(), ShellExecute() or CreateProcess().

Best Of Lucks,
Bhushan

6 4921
Please give some hint...thats all needed. I dont have time to go throgh a full text book to search for a solution. Also done lot of googling...please help.
Feb 3 '10 #2
OraMaster
135 100+
Hi,

Why don't you generate CSV files from within C++ application and then try loading those CSV files into Oracle tables. Using the bulk loader that comes with Oracle. This is designed to load CSV data very rapidly into oracle. You could perhaps spawn this program from your C++ Builder program using WinExec(), ShellExecute() or CreateProcess().

Best Of Lucks,
Bhushan
Feb 4 '10 #3
Hi Bhushan,
thanks for the reply. I will do some analysis in that way.

-sumesh.
Feb 5 '10 #4
Is it possible to use sqlloader to give input to a pl/sql procedure?
ie, not a direct insertion/updation to the DB. instead a pl/sql procedure to be called with each row of the csv file.
any help would be greately appreciated.
Feb 8 '10 #5
please give me some info...
thanks in advance.
Feb 9 '10 #6
amitpatel66
2,367 Expert 2GB
No, SQLLOADER doesnt work that way through a procedure. You will need to put the data in to a file (CSV, any other delimiter) and then call the SQLLOADER.

Prerequisites for INSERT:
-------------------------------------

1. Control File for SQL Loader
2. Data file to be created everytime you need to insert the data in to the oracle database

UPDATE:
---------------

If you are looking at updating the database column then you will need to create a file for the data to be updated, and call a procedure that will read the data using UTL_FILE package from the file and does the update.
Feb 10 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Kiran Dalvi | last post by:
Hi, I have following problem scenario ..... I have a XML of the format .... <Data> <Employee> <EmpName>Kiran</EmpName> <EmpID>100</EmpID> </Employee>
2
by: Steve_CA | last post by:
Hello all, I just started a new job this week and they complain about the length of time it takes to load data into their data warehouse, which they do once a month. From what I can gather,...
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...
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...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.