Home » Open Source » Programming Interfaces » From Excel run a Sql Script
From Excel run a Sql Script [message #260475] Mon, 20 August 2007 01:38 Go to next message
kumarvk
Messages: 211
Registered: July 2004
Senior Member
Hi Experts,

Is there any way to run a sql script directly from excel and display the output directly into the worksheet?

Can anyone help?

Re: From Excel run a Sql Script [message #260476 is a reply to message #260475] Mon, 20 August 2007 01:43 Go to previous messageGo to next message
Michel Cadot
Messages: 59422
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Not directly but as you have VBA in Excel you can program almost what you want.
For instance spawning a SQL*Plus that executes the script and the read the spool. Or read the script and execute each line of the script through ODBC or the like. Or...

Regards
Michel
Re: From Excel run a Sql Script [message #260477 is a reply to message #260475] Mon, 20 August 2007 01:50 Go to previous messageGo to next message
Maaher
Messages: 7054
Registered: December 2001
Senior Member
Yes you can:

In Excel:
1. Menu Data -> Import external data -> Import Data.
2. Select the (ODBC) datasource or create a new one.
3. Select the table or write a query. Attention! This query should be ANSI compliant.

MHE
Re: From Excel run a Sql Script [message #260484 is a reply to message #260477] Mon, 20 August 2007 02:24 Go to previous messageGo to next message
Michel Cadot
Messages: 59422
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Does this work for a whole script?

Regards
Michel
Re: From Excel run a Sql Script [message #260489 is a reply to message #260484] Mon, 20 August 2007 02:34 Go to previous message
Maaher
Messages: 7054
Registered: December 2001
Senior Member
Michel Cadot wrote on Mon, 20 August 2007 09:24
Does this work for a whole script?
My bad. I didn't read the 'script' part the way you did.
I guess it all depends on what you call a script. If a script is a single SELECT statement: yes. If the script contains more SQL statements, you'd have to repeat the steps for each statement.

MHE
Previous Topic: Validations in interface in Oracle Apps 11i (merged)
Next Topic: Table Creating from Oracle/PHP HTML
Goto Forum:
  


Current Time: Thu Oct 23 03:07:01 CDT 2014

Total time taken to generate the page: 0.19342 seconds