C# batch inserts to Oracle

How do I execute multiple insert statements in a single call?  I've tried several variations and I just get a host of various errors indicating I don't know what I'm doing.

I've stripped down my command to the most basic, just tell me what I need for 2 and I can get that repeated.
INSERT INTO MyTable (MyColumn) VALUES (1)
INSERT INTO MyTable (MyColumn) VALUES (2)

I am pretty sure I am just missing a command separator or some command to indicate it is multiple statements (or both).
LVL 4
SkipFireAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SriVaddadiCommented:
Semi colon (;)  is the batch separator in Oracle
0
SkipFireAuthor Commented:
How does that apply to ORACLE?
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

SriVaddadiCommented:
You are executing the query against the Oracle data provider right?

So your queries should adhere to oracle syntax
0
VenabiliCommented:
How does what apply to Oracle? The SqlDataAdapter? It's .NET, you do the inserts from .NET - that's where you are using it. And it is supported by the data Provider for Oracle (see the MSDN link)
0
SriVaddadiCommented:
SqlDataAdapter does not apply to Oracle it is Sql Server specific object. You have to use OracleDataAdapter if you want to System.Data.OracleClient.OracleDataAdapter
0
SkipFireAuthor Commented:
SriVaddadi - I am executing with an OracleCommand.ExecuteNonQuery(), and I know it needs to conform to the Oracle syntax, I'm just not sure what syntax I need to do a batch insert.  When I use a ; at the end of each insert statement I get an error stating "invalid character".  If I remove the ; I get command not properly ended.
0
SriVaddadiCommented:
Use ExecuteOracleNonQuery method and try
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SkipFireAuthor Commented:
Changed to execute individually.  Required to use dotConnect in production instead of the Oracle provider, so unable to test ExecuteOracleNonQuery.
0
VenabiliCommented:
SriVaddadi - that's what happens when I am thinking about one language and answering about another - I forget  that there were two classes here. :)
0
SriVaddadiCommented:
Venabili - I can understand. We would be in touch with the api methods which we mostly use. I guess you are more with SQL Server and I am a bit mix of both. :)
0
VenabiliCommented:
:) More a Java thing here really - we do not have separate implementations there - not for such things anyway. :) And yeah - had been doing some SQL server stuff in .NET lately and kinda forgot for a while that the SQL ones in .NET are for the SQL server, not for the SQL itself.

Seems like the asker is ok now so all is good.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.