473,405 Members | 2,310 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,405 software developers and data experts.

Multiple inserts into JET / ORACLE

Jo
Hi,

In SQL Server I can batch many insert statements ie : Create one string that
looks thus :

szSQL = "insert into xxx (..., ..., ...) values (..., ..., ...)"
szSQL += "insert into xxx (..., ..., ...) values (..., ..., ...)"
szSQL += "insert into xxx (..., ..., ...) values (..., ..., ...)"

(obviously with correct values in)

and then run the command obj with (szSQL, oConn)

I am using the OleDBCommand / connection object.

Why can't I do this with JET or Oracle? Is there any way to batch to JET or
ORACLE?

PS : I have tried comma seperation and newlines but to no avail

Provider is MS JET 4.0 Ole DB Provider for Access
and MS Ole DB Provider for Oracle (using :Oracle Data Access Software for
Windows Release 9.2.0.4.0 November 2003)

thanks
Johan


Nov 16 '05 #1
4 5161
Johan,

As a general rule, you should not be constructing queries with embedded
values in them. You should be creating parameterized queries.

However, to address your concern, it's very possible that the JET and
Oracle providers do not support the batching of commands, and you would have
to send them one by one.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jo" <jo****@thepub.co.za> wrote in message
news:F_********************@is.co.za...
Hi,

In SQL Server I can batch many insert statements ie : Create one string
that
looks thus :

szSQL = "insert into xxx (..., ..., ...) values (..., ..., ...)"
szSQL += "insert into xxx (..., ..., ...) values (..., ..., ...)"
szSQL += "insert into xxx (..., ..., ...) values (..., ..., ...)"

(obviously with correct values in)

and then run the command obj with (szSQL, oConn)

I am using the OleDBCommand / connection object.

Why can't I do this with JET or Oracle? Is there any way to batch to JET
or
ORACLE?

PS : I have tried comma seperation and newlines but to no avail

Provider is MS JET 4.0 Ole DB Provider for Access
and MS Ole DB Provider for Oracle (using :Oracle Data Access Software for
Windows Release 9.2.0.4.0 November 2003)

thanks
Johan

Nov 16 '05 #2
Jo,

switch to the ODP.Net provider, then use the array bind - that will give you
a 5x improvement.

better yet, use client side arrays and server side stored procedures with
bulk collect - that will give you another 5x improvement.

here is a link that may help a bit:
http://www.onecustomer.com/TechArticles/TechArt17.html

regards
roy fine
"Jo" <jo****@thepub.co.za> wrote in message
news:F_********************@is.co.za...
Hi,

In SQL Server I can batch many insert statements ie : Create one string that looks thus :

szSQL = "insert into xxx (..., ..., ...) values (..., ..., ...)"
szSQL += "insert into xxx (..., ..., ...) values (..., ..., ...)"
szSQL += "insert into xxx (..., ..., ...) values (..., ..., ...)"

(obviously with correct values in)

and then run the command obj with (szSQL, oConn)

I am using the OleDBCommand / connection object.

Why can't I do this with JET or Oracle? Is there any way to batch to JET or ORACLE?

PS : I have tried comma seperation and newlines but to no avail

Provider is MS JET 4.0 Ole DB Provider for Access
and MS Ole DB Provider for Oracle (using :Oracle Data Access Software for
Windows Release 9.2.0.4.0 November 2003)

thanks
Johan

Nov 16 '05 #3
Jo
I need to make this as fast possible and if you actually trace a
parameterised command you will see it actually passes more network traffic
than a standard insert statement. Some of the tables I work with have more
than 500 columns (not my design!!!! - Financial services industry) so the
size increases exponentially and hence the transfer is slower as there are
millions or rows.

thanks anyway

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:u3*************@TK2MSFTNGP11.phx.gbl...
Johan,

As a general rule, you should not be constructing queries with embedded values in them. You should be creating parameterized queries.

However, to address your concern, it's very possible that the JET and
Oracle providers do not support the batching of commands, and you would have to send them one by one.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jo" <jo****@thepub.co.za> wrote in message
news:F_********************@is.co.za...
Hi,

In SQL Server I can batch many insert statements ie : Create one string
that
looks thus :

szSQL = "insert into xxx (..., ..., ...) values (..., ..., ...)"
szSQL += "insert into xxx (..., ..., ...) values (..., ..., ...)"
szSQL += "insert into xxx (..., ..., ...) values (..., ..., ...)"

(obviously with correct values in)

and then run the command obj with (szSQL, oConn)

I am using the OleDBCommand / connection object.

Why can't I do this with JET or Oracle? Is there any way to batch to JET
or
ORACLE?

PS : I have tried comma seperation and newlines but to no avail

Provider is MS JET 4.0 Ole DB Provider for Access
and MS Ole DB Provider for Oracle (using :Oracle Data Access Software for Windows Release 9.2.0.4.0 November 2003)

thanks
Johan


Nov 16 '05 #4
Jo
Read the article - very informative. However the code needs to be generic as
the app needs to connect to any datasource so I cannot switch to a specific
provider and handle some DB's differently as the client wants to connect to
"ANYTHING".
If there is a serious speed problem then I will start writing specific Data
layers for each provider that they wish to connect to...

thanks for your input.
J

"Roy Fine" <rl****@twt.obfuscate.net> wrote in message
news:uE**************@TK2MSFTNGP15.phx.gbl...
Jo,

switch to the ODP.Net provider, then use the array bind - that will give you a 5x improvement.

better yet, use client side arrays and server side stored procedures with
bulk collect - that will give you another 5x improvement.

here is a link that may help a bit:
http://www.onecustomer.com/TechArticles/TechArt17.html

regards
roy fine
"Jo" <jo****@thepub.co.za> wrote in message
news:F_********************@is.co.za...
Hi,

In SQL Server I can batch many insert statements ie : Create one string

that
looks thus :

szSQL = "insert into xxx (..., ..., ...) values (..., ..., ...)"
szSQL += "insert into xxx (..., ..., ...) values (..., ..., ...)"
szSQL += "insert into xxx (..., ..., ...) values (..., ..., ...)"

(obviously with correct values in)

and then run the command obj with (szSQL, oConn)

I am using the OleDBCommand / connection object.

Why can't I do this with JET or Oracle? Is there any way to batch to JET

or
ORACLE?

PS : I have tried comma seperation and newlines but to no avail

Provider is MS JET 4.0 Ole DB Provider for Access
and MS Ole DB Provider for Oracle (using :Oracle Data Access Software for Windows Release 9.2.0.4.0 November 2003)

thanks
Johan


Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Raj Kotaru | last post by:
Hi, In sqlplus, I can insert a single row using: insert into employee (name, salary, hiredate) values ('xyz', '86378', sysdate); Is there a modification of the insert command that will...
1
by: Brian Marasca | last post by:
I know that Oracle has extensive support for XML, but I can't seem to find any documentation on using an XML document to do multiple inserts into a relational table. Note, I'm *not* trying to...
2
by: Joe | last post by:
Hey, I'm going to give some background on my situation in case anyone can point out a way around my problem altogether... for the problem itself, please skip to the bottom of the post. thanks....
1
by: Primo | last post by:
Hello, I am building a data management application with the following processes: Process 1 is a Windows service which uses FileSystemWatcher to monitor a directory. Process 2 opens a file...
9
by: dan | last post by:
within a loop i am building a sql insert statement to run against my (programatically created) mdb. it works but it seems unreasonably SLOW! Sorry, dont have the code here but the jist is very...
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...
7
by: =?Utf-8?B?QVRT?= | last post by:
HOWTO Run multiple SQL statements from ASP/ADO to an Oracle 10g. Please help, I'm trying to write an ASP page to use ADO to run a long query against an Oracle 10g database, to create tables,...
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...
58
by: bonneylake | last post by:
Hey Everyone, Well recently i been inserting multiple fields for a section in my form called "serial". Well now i am trying to insert multiple fields for the not only the serial section but also...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.