Excel Spreadsheet - Best way to perform an Oracle Query on a cell

Posted by Jamie on Stack Overflow See other posts from Stack Overflow or by Jamie
Published on 2010-06-02T09:56:10Z Indexed on 2010/06/02 11:13 UTC
Read the original article Hit count: 255

Filed under:
|
|
|
|

Hi there,

I have an Excel Spreadsheeet.

There is a cell containing a concatenated name and surname (don't ask why), for example:

Cell A2 BLOGGSJOE

On this cell, I would like to run the following SQL and output it to cell A3, A4 and A5

SELECT i.id, i.forename, i.surname FROM individual i  WHERE UPPER(REPLACE('" & A2 & "', ' ', '')) =  UPPER(REPLACE(i.surname|| i.forename, ' ', ''))  AND NVL(i.ind_efface, 'N') = 'N'

Any idea how I could perform an oracle query on each cell and return the result?

I have enabled an oracle datasource connection in Excel, just not sure what to do now.

Is this a stupid approach, and can you recommend a better more proficient way?

Thanks muchly! I lack the necessary experience in this type of thing! :-)

EDIT: I am aware that I could just write a simple ruby/php/python/whatever script to loop through the excel spreadsheet (or csv file), and then perform the query etc. but i thought there might be a quick way in excel itself.

© Stack Overflow or respective owner

Related posts about sql

Related posts about database