Home » SQL & PL/SQL » SQL & PL/SQL » Querying data from excel sheet
Querying data from excel sheet [message #205231] Fri, 24 November 2006 00:36 Go to next message
monasingh
Messages: 229
Registered: May 2006
Location: Mumbai
Senior Member

Hi,
I have to create a query where I have to access the data from tables in database as well as from an excel sheet.

The query to extract data from excel sheet can be something like :
SELECT sheet1_.col1, sheet1_col2 FROM sheet1$ Sheet1_

I do not know the syntax to do so.
Please suggest me as how can I access data from excel without creating a table.

Thanks,
Mona
Re: Querying data from excel sheet [message #205234 is a reply to message #205231] Fri, 24 November 2006 00:43 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,

 try to convert the .xls file to .csv format and then create an external table.



regards,
Re: Querying data from excel sheet [message #205247 is a reply to message #205234] Fri, 24 November 2006 01:00 Go to previous messageGo to next message
monasingh
Messages: 229
Registered: May 2006
Location: Mumbai
Senior Member

I do not have to do anything with the excel sheets. They are placed in network and we have to access the data without changing anything. We do not have to create any object out of them.
I simply have to access the data from sheet of excel sheet that is available to everyone in network and the excel sheet is read only.

Thanks,
Mona
Re: Querying data from excel sheet [message #205253 is a reply to message #205247] Fri, 24 November 2006 01:14 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It is easier to say than to do. Simply (as you've put it), it can't be done. Oracle can not read directly from an Excel file. If you want to get access to this data, you'll have to follow Dhananjay's advice: CSV file and external table or, if your Oracle version does not support it, SQL*Loader.
Re: Querying data from excel sheet [message #205259 is a reply to message #205253] Fri, 24 November 2006 01:33 Go to previous messageGo to next message
monasingh
Messages: 229
Registered: May 2006
Location: Mumbai
Senior Member

Thanks littlefoot for your advice. So there is no other way but to create external tables.

Thanks,
Mona
Re: Querying data from excel sheet [message #205262 is a reply to message #205259] Fri, 24 November 2006 01:44 Go to previous message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As far as I can tell, yes ... external table or SQL*Loader.
Previous Topic: Spool tables data in a text file using Stored Procedure
Next Topic: Difference between IN and EXISTS
Goto Forum:
  


Current Time: Fri Dec 09 11:47:53 CST 2016

Total time taken to generate the page: 0.12252 seconds