Excel data into Oracle table

  • Thread starter Thread starter EWill
  • Start date Start date
E

EWill

I'm trying to insert data from Excel into Oracle.

I have a couple questions regarding this topic:

1) What is the syntax to insert multiple rows (Do I need to loop through each row ?)

2) What is the syntax to insert multiple rows from multiple columns.

Thanks for your assistance.
 
Erik,

I believe the only way you can upload data to an Oracle DB
is to loop through your rows. You will need Oracle client
installed on the PC you are uploading from. I would
recommend creating an ODBC connection to simply the
creation of the connection object (obviously the TNSblock
must be set). I would recommend using the Command object
and appending parameters to it rather than concatentating
values into a single string (unless your values are really
simple, no chance of an apostrophe or quotation marks in
the uploaded values).

-Tim
 
Does anyone have specfic examples ?




Tim said:
Erik,

I believe the only way you can upload data to an Oracle DB
is to loop through your rows. You will need Oracle client
installed on the PC you are uploading from. I would
recommend creating an ODBC connection to simply the
creation of the connection object (obviously the TNSblock
must be set). I would recommend using the Command object
and appending parameters to it rather than concatentating
values into a single string (unless your values are really
simple, no chance of an apostrophe or quotation marks in
the uploaded values).

-Tim
 
Not Oracle, but the idea is the same.

This might be a help for getting data to and from Excel and Access: It
includes examples of using variables in SQL queries.
http://www.bygsoftware.com/examples/sql.html

Or you can get there from the "Excel with Access Databases" section on page:
http://www.bygsoftware.com/examples/examples.htm

It demonstrates how to use SQL in Excel's VBA to:

* create a database,
* create a table and add data to it,
* select data from a table,
* delete a table,
* delete a database.

You can also download the demonstration file called "excelsql.zip".

The code is open and commented.


--

Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"
 
Back
Top