Oracle to Excel
What options are available for getting data from Oracle to Excel ?
I can think of two, but I'm sure there must be alternatives using XML etc ?
1) MS Query is a tool within Excel, that pulls the data across using ODBC via
a query that you construct from Excel.
2) Use utl_file to write to a CSV file, then load the CSV file.
Whichever solution I use I'd like to automate it.
null
Use Oracle Transparent Gateway for ODBC, see
here for more info, http://technet.oracle.com/doc/gateways/tg4odbc/ch3.htm#167
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Chris Freville:
What options are available for getting data from Oracle to Excel ?
I can think of two, but I'm sure there must be alternatives using XML etc ?
1) MS Query is a tool within Excel, that pulls the data across using ODBC via
a query that you construct from Excel.
2) Use utl_file to write to a CSV file, then load the CSV file.
Whichever solution I use I'd like to automate it.
<HR></BLOCKQUOTE>
null
Similar Messages
-
Query Data From Oracle to Excel
Dear all,
Please guide me to solve.
Regards
DharmaQuestion's Caption is : Data From Oracle to Excel
While you are asking :
data in execel (windows ) move to Oracle Database table (Linux *64)Anyway, if your question is export data from Excel to Oracle then below thread may be of your interest which are saying that you have to install Dg4ODBC on Windows and use the ODBC driver there.
When running DG4ODBC on Unix you need an ODBC driver on this Unix box which can connect to the MS Excel file. I'm not aware of any suitable driver so far that fulfills the ODBC level 3 standard required for DG4ODBC.
So instead of using DG4ODBC, get the Windows software of DG4ODBC and install it on a Windows machine. You can then connect from your Oracle database to the Dg4ODBC listener on Windows which then spawns the DG4ODBC process. This DG4ODBC process then uses the MS Excel ODBC driver to connect to the Excel sheet.
https://cn.forums.oracle.com/forums/thread.jspa?messageID=10466197
For this purpose there is separate forum too : [url https://forums.oracle.com/forums/forum.jspa?forumID=63] Heterogeneous Connectivity
Regards
Girish Sharma -
Getting data stored in ref cursor ( got from store proc in oracle) to excel sheet)
Hey, I am trying to Get data stored in ref cursor ( got from store proc in oracle) to excel sheet in a virtual folder using ssis.
I am getting errors and cant do it. If anyone can help meHi Nabin000,
The Oracle stored procedure doesn't work with SSIS source adapters such as OLE DB Source because the data provider doesn't provide metadata for the source adapter. To achieve your goal, you can use a Script Component as source to call
the Oracle stored procedure by using System.Data.OracleClient OracleDataReader, and get the rows and add them to the pipeline buffer. For more information, please see:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/1d0b3a1b-8792-469c-b0d1-f2fbb9e9ff20/dump-oracle-ref-cursor-into-ms-sql-staging-table-using-ssis
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/fcdaa97e-8415-4c3e-8ffd-1ad45b590d57/executing-an-oracle-stored-procedure-from-ssis?forum=sqlintegrationservices
http://msdn.microsoft.com/en-us/library/system.data.oracleclient.oracledatareader(VS.90).aspx
Regards,
Mike Yin
TechNet Community Support -
Extract data from Oracle in excel file
Hi,
I have a requirement where in I need to extract data from Oracle in excel file and the excel worksheet name should be "Data".
for eg. excel file name "AR Data_DDMMYY" and excel worksheet name "Data"
I have used the UTL_FILE API to extract the tab delimited data which can be opened in excel but it is not exactly an excel file as the worksheet name is same as the file name.
I tried using utl_file.fcopy and frename.
Is there any way to do this using PLSQL?
select * from v$version;
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
"CORE 10.2.0.5.0 Production"
TNS for HPUX: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - ProductionSample Code:
declare
cursor c is
select * from scott.emp;
v varchar2(100);
f utl_file.file_type;
file_name varchar2(100) := 'AR Data.xls';
dir varchar2(50) := 'CESDIR191710';
--select * from dba_directories
begin
f := utl_file.fopen(dir, file_name, 'W');
v := 'EMPNO'||chr(9)||'ENAME'||chr(9)||'JOB'||chr(9)||'SAL'||chr(9)||'HIREDATE'||chr(9)||'DEPTNO';
utl_file.put_line(f, v);
for i in c
loop
v := i.empno||chr(9)||i.ename||chr(9)||i.job||chr(9)||i.sal||chr(9)||i.hiredate||chr(9)||i.deptno;
utl_file.put_line(f, v);
end loop;
utl_file.fclose(f);
--utl_file.frename(dir, file_name, dir, replace(file_name, '.xls', '_')||to_char(sysdate, 'MMDDYY')||'.xls', false);
utl_file.fcopy(dir, file_name, dir, replace(file_name, '.xls', '_')||to_char(sysdate, 'MMDDYY')||'.xls');
end;Thanks
ImranImran Soudagar wrote:
Hi,
I was able to generate the excel 2007 file with the data using the package from below link;
http://technology.amis.nl/2011/02/19/create-an-excel-file-with-plsql/
but the requirement is to generate excel 2003 file.
I tried changing the .xlsx to .xls and it gives a note while opening the file "The file you are trying to open, abc.xls, is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?"Then you have three options:
1) stop using anton's package and find another one that supports the old and deprecated version of Excel 2003
2) write your own package to produce an Excel file.
3) Upgrade your version of Excel to a recent version
I tried the programs from other links on the forum but I am still getting this message. The client does not want this message to be displayed as the excel file works as an input to another system.
Can anyone help me with the issue?
Also, is it true that the programatically generated excel file is actually an xml file which is renamed to .xls and hence it shows the message while opening such files?Yes, Excel supports several different formats for it's files. By default, if you save an XLS files from Excel, it writes it out in a Microsoft proprietary binary format, which you would be hard pushed to replicate easily from PL/SQL. Excel also has the ability to save it's files as XML format, which is more readable and easier to produce programatically, whilst still allowing you to have multiple sheets, formulas and formatting included in it. That's the format that most people who need formatting and multiple sheets opt for when programatically generating their data as excel workbooks. (There's also an SLYK format that people used to use before that, but it's not as flexible)
If you want to write your own, the easiest thing to do is to start with a blank workbook in Excel, and put in your basic requirements e.g. a couple of named sheets, and some data in different formats (number, date, text etc.) and different formatting options etc. Save that file in XML format from Excel and then open up the file using notepad/wordpad to look at the structure. There'll be a whole load of redundant rubbish Microsoft put in there, but you should be able to figure out the basic structure of XML required to give you what you want. -
Hi,
I want to know how can data be spooled from Oracle table to MS Excel.Is this done with MS Query if so how can that be done?Any other solutions are appreciated.
Thanks,
VenkataYou will be much better off writing an excel spreadsheet that queries the data directly.
First of all you need to create an ODBC connection to the database using ODBC admin.
Then
(1) fire up a new excel worksheet.
(2) Choose Data->Get External Data->New Query
(3) Connect using ODBC
(4) choose any table, columns, etc - it doesn't matter.
(5) at the end pane tick the MS query button. to edit the query press the SQL button.
Easy. Be aware that (i) your query resides in the cell you started with, usually A1, and (ii) if you want to format the columns in the spreadsheet you need to uncheck the formatting boxes in MS Query -
Data from oracle to excel very urgent
hi all,
im using servlets for fetching the data from oracle , i want to display the data which i get from orcle in excel sheet. A code snippet regarding this is highly appreciated...
Thanks in advanceJust visit Jakarta's POI API. It is simple. You can create workbooks, cells etc. You can apply styles, insert charts. And its very simple
-
Transfer Data from Oracle to EXCEL
Hello,
I would like to transfer data from an oracle table into an EXCEL-Spreadsheet -
while doing it, I got the error message
"-1002 : 37000 : java.sql.SQLException:[Microsoft][ODBC Excel Driver]'C$_0Output is not a valid name..."
I think I have correctly defined a logical + physical schema for the excel-file (test works and counts rows), and as knowledg-modules I use:
LKM: SQL to SQL and
IKM: SQL Control Append
Does anybody have an idea how to avoid this error-message and to make the transfer working?
Edited by: user10874105 on Jan 30, 2009 7:19 AMHi Ramesh,
yes, this points to the right solution -
The only issue that remains is that by default ODBC-Setting for EXCEL is limitted to 255 Chars.
Otherwise it works perfect! -
Oracle SQL/ Excel Visual Basic Consulting Opportunity in New York City
Hello:
Is anyone interested in a consulting opportunity?
I am marketing director for a catalog/internet business in Manhattan. I am running Oracle 9.2i . We use the datawarehouse for many marketing/merchandising reports. I have SQL code embedded in Excel workbooks using an ODBC interface. The SQL code gets the data and then I have a lot of Visual Basic macros that run and create the reports.
I need someone to come in and help me optimize the queries and macros (since I am self-taught on both SQL and VB there is LOTS of room for improvement).
Since some of the reports are popular, I am getting overwhelmed with requests for new reports and it is taking time away from my marketing responsibilities.
If anyone out there is interested, please let me know
ThanksHello:
Is anyone interested in a consulting opportunity?
I am marketing director for a catalog/internet
business in Manhattan. I am running Oracle 9.2i .Sounds interesting, but as you can see in my profile, I'm not able to just "come in". Maybe someone else here wants to pick up this opportunity.
We use the datawarehouse for many
y marketing/merchandising reports. I have SQL code
embedded in Excel workbooks using an ODBC interface.Reminds me of one of my customers that had a ms access frontend and oracle backend.
The SQL code gets the data and then I have a lot of
f Visual Basic macros that run and create the
reports. Memories comin' back ... ;-)
I need someone to come in and help me optimize the
queries and macros (since I am self-taught on both
SQL and VB there is LOTS of room for improvement). I'd say one approach could be to move some of the logic to views or pipelined functions, maybe ref cursors.
Since some of the reports are popular, I am getting
overwhelmed with requests for new reports and it is
taking time away from my marketing responsibilities.Maybe it's also time to rethink the tool selection? ms access or a decent report generator could be an option.
C. -
Hi,
I've created Excel reports following the steps found in
http://technet.oracle.com/products/reports/htdocs/getstart/demonstrations/index.html, Output to Excel with Oracle 9i Report.
This works great when I am running in my local OC4J, but it does not work in the Reports Server environment.
The report url just does not work. I tried to add other parameters like desformat, destype, mimetype and it will work with a small resultset but it includes the headers files in rows like a delimited file output and it's not using the format created.
Is there any known problems with the Reports Server on this? Any workaround?
Thanks,
AlbertThe delimiteddata works as per the datamodel only.
Arrange the fields in datamodel as per the output of the report and if there are any fields in data nodel which you dont want to display Make the property "Exclude from XML output" as Yes from the property pallette.
Thanks,
Ashok -
Hi
I want to transfer the Oracle*report output in a Excell file or .csv. But i want to tranfer only some data of my report with their heading column.
can somebody help me?
tks
AleHello Samim,
the best to begin with might be searching this forum for EXCEL or SPREADSHEET.
Regards
Marcus -
Oracle to Excel Convertion -reg
Dears,
Currently i am using TOAD for Oracle excel convertion purpose. but our client users want all reports (currently all reports in pdf format) in excel. Any possible tool is aviable. I could not give TOAD due to security purpose.
Please give your's valuable suggestion with soultions
Kodiyarasu.P
Chettinad Cements,
Karur,TN,IndiaYou have a couple of choices. If your client doesn't want spend money, you could extract the data into a CSV file and then use Excel to open it as mentioned by other members. Or you could pay for a more comprehensive tool like Excel-DB
We like Excel-DB actually - saved a ton of development effort over the years for the many one-off reports that our Finance and Actuarial departments request every year. -
Aggregated data from oracle to excel report
Hi all,
I have a requirement where i need to fill in an excel report using aggregated data in oracle tables.
example: i need to find total number of employees in each department and the total salaries of each department. My excel report looks like below
DEPT|total employees| total salaries
dept 10|15|75000
dept 20|0|0
dept 30|20|100000
dept 40|5|25000
TOTAL|40|200000
declare
begin
execute immediate 'insert into abc select count(empid),sum(sal), dept_id from emp group by dept_id';
end;
the above query gives me the aggreagted output and then i need to manually insert the data into the excel report. Instead i need an oracle procedure that will automatically insert the data from abc table into the excel report.
i know that the utl_file is used to export the data, but never used.
any help will be really appreciated.
Thanks
SHi,
Output Oracle report into HTML:
sqlplus user/pass@inst
SQL> set feed off markup html on spool on
SQL> spool C:\MyReport.html
<br>
SQL> select * from SomeTable;
SQL> spool off
<br>
SQL> set markup html off spool off;
<br>
SQL>
- Open obtained html report with browser; Output Oracle report into EXCEL:
sqlplus user/pass@inst
SQL> set feed off markup html on spool on
SQL> spool C:\MyReport.xls
<br>
SQL> select * from SomeTable;
SQL> spool off
<br>
SQL> set markup html off spool off;
<br>
SQL>
- Open obtained xls with Excel;
- In case of warning message "The file you're trying to open ... is in a different format ...
Do you want to open the file now? - press "Yes"
{code}
Good luck!
http://dba-star.blogspot.com/ -
Oracle To Excel sheet or text files
Requirement:
We might have to get data from different column from different tables based on queries and store it in an Excel or Text files(using delimiters).
This needs to be scheduled as a daily job. Is there any oracle tools available to do this efficiently?
I also have chance to do this in Java using Apache POI but would like to know good options available with Oracle itself.
If the tool is built in with Oracle 10G then it will be good.Hello user12094414.
You've identified two basic requirements; 1) output to a file & 2) output the file daily.
Some of the current responses already identify several different ways to output to a file. However, unless I'm mistaken, none of these address automating the task.
Before getting too involved in trying to come up with a solution to a problem that may already have been solved, what tools are already available in your environment to perform automation? Oracle offers a scheduling package in the form of dbms_job, but you'll want to check with your DBAs as to whether this is an approved automation option or not. What OS does the database or remote server run on?
As with most posts on this forum, the more information that you can provide, the better the response. You'll find that in many environments that the scheduling solution has a direct bearing on the method of data retrieval.
Best of luck,
Luke -
Oracle BI Office Add-In for Excel (Failed to insert Oracle BI view due to )
Dear all,
I receive the following error message when I change the Prompts in Oracle BI Excel Add-In:
Failed to insert Oracle BI view due to processing query error.
I think it has something to do with the performance of the development database.
Is there a configuration file and a parameter the eliminate this error message?
Regards,
StefanI've seen this error occur when the Flash ActiveX control is not installed on the machine that is viewing the Excel content because the charts views use Flash. You can fix this by downloading the Shockwave Flash control from www.adobe.com
-
How do I import the data from Excel (.xls) file into Oracle Database table
I have an excel file with 5 columns of 5000 rows.
I have to import 5000 rows of data into my oracle table with
same column names & Data types.
What is the best advise for this ?
Thanks.
SriniYou can connect to Oracle from Excel directly. I know you can read data but am not sure if you can export data.
Other option is to import the data into Access.
Create an ODBC connection for Oracle
Use the to connect to Oracle from Access
Export data to Oracle from Access
Shakti
http://www.impact-sol.com
Developers of Guggi Oracle - Tool for DBAs and Developers
Maybe you are looking for
-
Our satellite company's Fair Access Policy allows: 425 mb max per 24 hours, but it seems like we often go over that amount by just surfing the internet. We have 2 adults and 3 kids who use Mac computers. Is there a way to view the amount of KB's or
-
Configuration to Post Prodcution Order GR to quality stock
Hi Friends, what are the necessary configuration setting to post Production GR stock to quality stock instead of unrestricted?
-
Can I ad images to an ibook project when in the middle of creating it
can I ad images to an ibook project when in the middle of creating
-
i switch from my .me account to icloud
-
Upgrading late 2008 Macbook Pro to Snow Leopard?
I read some articles that say one should stick with the OS that shipped with one's notebook. Is this true? Can I upgrade a Macbook Pro (late 08) to Snow Leopard or is it better to stick with Leopard? Also, will upgrading delete my files? Ive created