Export data from oracle to excel file
Hello
I've written a procedure and the procedure, I stored a data in a TABLE .
I want to export the data to excel the file of the proceedings.
How can I do?
Thanks in advance,
Elad
Elad says:
Hi yoyo,.
I did as suggested Padders:
OPEN FOR L_ref_cursor
SELECT *.
TABLE (l_result_tbl);
l_cursor_number: = DBMS_SQL. TO_CURSOR_NUMBER (l_ref_cursor);
as_xlsx.query2sheet (l_cursor_number);
If I change Anton plugin (as you suggested), I get this error message when I try to run my code (my procedure):
ORA-01001: Invalid cursor
ORA-06512: at "SYS." DBMS_SQL", line 1575
If I do not change the plugin, the excel file is empty...
Ah yes, as the explains docu
The
DBMS_SQL
cursor that is returned by the Function TO_CURSOR_NUMBER performs in the same way as aDBMS_SQL
cursor that has already been run. As a result, the callEXECUTE
for this cursor will cause an error.
Therefore, remove the following line also:
t_r: = dbms_sql.execute (t_c);
Tags: Database
Similar Questions
-
Extract data from Oracle into excel file
Hello
I have a requirement where in I need to extract data from Oracle into excel file and the worksheet excel name should be 'given '.
for example. Excel 'AR Data_DDMMYY' file name and the name of the "Data" sheet excel
I used the UTL_FILE API to extract the data delimited by tabs that you can open in excel, but it's not exactly an excel file as the name of the worksheet is the same as the name of the file.
I tried to use utl_file.fcopy and frename.
Is it possible to do it using PLSQL?
Select * from version of v$.
Example Code: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 - Production
Thank youdeclare 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;
ImranHello
I tried to change the .xlsx to .xls and it gives a note at the opening of the file "the file you are trying to open, abc.xls, is in a different format that it is specified by the file extension. Check that the file is not corrupted and precedes from a trusted source before you open the file. Do you want to open it now? »
When you rename the file does not solve your problem.
Anton Scheffer package generates a file in format xlsx Office 2010. When rename you it with the .xls extension, then Office 2010 will give you the warning that the file format does not match the extension.but the requirement has to generate excel 2003 file.
The xml_spreadsheet package writes a format that was introduced with Office 2003, but you must use .xml as extension in other Office 2010 will give you the same caveat.
To write the real xls version (binary), you can use Apache POI. You will need to import Java classes in your db and write a PL/SQL wrapper. Or you can use one of the options above, writing the output to a windows server and then use Excel to open and save in the required format.You must decide whether it is easier to write the binary xls format or to convince the customer to accept other formats that can be opened with Excel.
Concerning
Marcus -
Do not export data from table to Excel
Why the invoke node export data to Excel product empty Excel sheet with no data?
If I manually highlight the table on the front panel control, and rerun the VI data get exported. How we highlights the data in the table automatically?
I thought that at first too, but after testing (before that I posted ) I see the order does not matter. Only the selection is copied to. If nothing is selected the journal will be empty.
Note: you can select cells programmatically using a property node (selection start and size of the selection).
So it doesn't seem to be a bug...
-
problem loading data from oracle table excel table / oracle
Hi all
I'm working on the form of data transformation 2 different sources to a target table only oracle.
My first source - excel sheet.
2nd source - oracle table.
Creation of data servers, dsn(for excel), reversing everything done very well.
When I try to display the data there is a problem.
EXCEL - serial number column is displayed as 1.0,2.0,.3.0 etc. need 1,2,3,4,5...
Oracle tables-> after that reverse it does not display the data types for the selected columns.
I am not able to create a join and run.
Help, please.
Thank you
Chaitanya.Hello
Just a thought, why not u cast TO_NUMBER to the interface mapping for the serial number column?
Thank you
Guru -
Export data from Oracle table to a .csv file by putting a condition on the value of a column
Hello gurus,
I have the following data in my table
ROWID name version date
1 oracle 11.1 20/12/2013
Java 2 7 12/10/2011
1 oracle 12.1 28/12/2013
1 oracle 10.2 12/06/2010
Now I need a general sql/plsql code who wrote the columns with a specific value to the rowid.
My output should look like
1,Oracle,11.1,12/20/2013
1,Oracle,12.1,12/28/2013
1,Oracle,10.2,06/12/2010
Here, I want to pass the value as a parameter dynamically
Can someone help me with the sql/plsql.
Hello
If you use the IN operator:
Select rowid_col
|| ',' || name_col
|| ',' || version_col
|| ',' || To_char (date_col, 'HH24:MI:SS of Mon-DD-YYYY') AS csv_text
from your_table
where rowid_col IN (& input_values);
then & input_values can be a unique number (e.g. 1) or a list separated by commas (for example, 1,2,3) numbers. Don't put NO space around the comma.
-
Export data from the database to excel file using the procedure
Hello
I need to export data from database to oracle 10 g for the excel file, I try this code:
First, I create directory to the user sys and give permition to user that I'm working on it
then I run this codecreate or replace directory PALPROV_REPORTS as 'c:\temp'; grant read, write on directory PALPROV_REPORTS to user12 ;
the problem appears asdeclare output utl_file.file_type; begin output := utl_file.fopen( 'user12' , 'emp1.slk', 'w',32000 ); utl_file.put_line(output, 'line one: some text'); utl_file.fclose( output ); end;
ORA-29280: invalid path ORA-06512: at "SYS." UTL_FILE", line 29 ORA-06512: at"SYS." UTL_FILE", line 448 ORA-06512: at line 4
Notice that I use the operating system windows as a client and a linux as a server databaseThe file will be written to the database server or your GNU / linux and I'm quite sure, there is no folder named "c:\temp" on linux. It will probably be ' / tmp' on a unix server.
And open the file, you must give the name logic directory 'PALPROV_REPORTS' it instead of the user name "utilisateur12".
-
Export data from the database Table in the CSV file with OWB mapping
Hello
is it possible to export data from a database table in a CSV with an owb mapping. I think that it should be possible, but I didn't yet. Then someone can give me some tips how to handle this? Someone has a good article on the internet or a book where such a problem is described.
Thank you
Greetings DanielHi Daniel,.
But how do I set the variable data file names in the mapping?
Look at this article on blog OWB
http://blogs.Oracle.com/warehousebuilder/2007/07/dynamically_generating_target.htmlKind regards
Oleg -
Export data from the forms to Excel
Hello
I am facing a problem with exporting data from a form to excel.
When I go to the menu - and file-> export. The export starts then progress, then disappears.
If I do just steps above and hold down the CTRL key... the excel opens.
I remember there was a setting to recognize that this export goes to Excel. But have forgotten what I did to solve the problem.
My pop Blocker is turned off.
If anyone can help out me... that would be greatly appreciated.
Thank youHello
In the browser, please add the URL of the application to the trusted sites list and sign the application again.
Also, be sure that no errors are reported in the log database (no space).
Export option in menu Apps does not work under Windows-XP OS
Export option in menu Apps does not work under Windows-XP OSExport form data to Excel the FILE using file > EXPORT
Export form data to Excel the FILE using file > EXPORTKind regards
Hussein -
How to export data from the table with the colouring of cells according to value.
Hi all
I use jdeveloper 11.1.1.6
I want to export data from the table with a lot of formatting. as for color cells based on value and so much. How to do this?
You can find us apache POI-http://poi.apache.org/
See this http://www.techartifact.com/blogs/2013/08/generate-excel-file-in-oracle-adf-using-apache-poi.html
-
Hello. Is it possible to export data from a table in Oracle using SQL Loader? If Yes, can you tell a good examples?
Hello
Hello. Is it possible to export data from a table in Oracle using SQL Loader?
No, with SQL * Loader, you can load data from external files into tables not export.
coil c:\temp\empdata.txt
sqlplusabc.sql (assumes that abc.sql runs select * from emp)
spool offIt cannot work like this, because the declaration of the COIL is not recognized outside the SQL * Plus the term.
But, you can include the statement of the COIL in abc.sql like this:
spool c:\temp\empdata.txt select * from emp; spool off
Then, you just have to run the SQL script as follows:
sqlplus
@abc.sql However, I advise you to use Oracle SQL Developer, this is a free tool and with it you can export a Table in several types of format (html, xml, csv, xls,...).
Please find attached a link to this tool:
http://www.Oracle.com/technetwork/developer-tools/SQL-Developer/Overview/index.html
Hope this helps.
Best regards
Jean Valentine -
Does anyone have a good experience, export data from cubesavvy?
Merry Christmas / Happy holidays everyone.
Does anyone have a good experience, export data from ASO using cubesavvy?
I tried but the filters don't seem to work. I entered about 9 filters - with the members and parents to 9 dimensions. However, the native text file that it created does not seem to use these filters. I select 'Member = FY15' but it has exported the native file, had FY12. I think this tool takes the native text file it generates and create a report of the column from it.
http://www.cubesavvy.com/parse-ASO-export-to-columns/
We use it because our financial report and the Smartview crashes when we tried to explore the zero level for Dept (we have more than 5 thousand), projects (more than 5,000) and accounts (more than 200). It looks like a simple report. Our report EN used to support 20 minutes now it crashes. We must perhaps compact contour and use the motion tracking.
R,
David
Hi David,
Harry Gates here, the developer of cubeSavvy. Dozens of people successfully using the export ASO Analyzer feature, with and without filters. This includes a few very large companies with big data and the large contours (100s of exports of GBs and hundreds of thousands of members). If the filters are not limit the written lines, it has been my experience that the names of typical members in do not match those of the file.
You can reach me at [email protected] if you have any other questions. You can also send me your otl and export, if they are not too sensitive and I'll take a look.
Kind regards
Harry
-
Possibility to integrate data from Oracle EBS in Amazon cloud Cloud of planning via FDMEE
Hi experts,
I just entered a case more about FDMEE.
I want to know is it possible to integrate data from Oracle EBS on Amazon cloud TO cloud of planning by FDMEE.
Oracle EBS (Amazon Cloud)-> FDMEE-> planning and budgeting of the Cloud Services
Please let me know about the opportunity and the necessary measures to be taken for the integration of the data.
~ Thank you
They are separate environments first - an existing one in Amazon Cloud and another within the Oracle offer. Oracle allows not currently SEEP for connections to a system of source book, the only option available is a function file upload.
I think, in part because they do not want to expose SEEP to the external environments for reasons of maintenance and security.
-
Export the result to an Excel file
I use the attached script to export the inventory then as excel file. I used LucDtechnical of this post to store information in a CSV temp and later, save them to a XLS file. I need to perform a certain formatting in the report, as to change the size of the font of the header, adding some background colors.
Do not the formatting as I am exporting to a CSV file. Is there another way to achieve the formatting?
You can take a look at my post Export-Xlsx, the suite and ordered data .
-
How do I export data from one day to backup disk.
Hi all
Here we have a requirement like, we need to download the data from one day to the external drive and we must compire the exported data and the data in the table.
I googled and I have discovered that using expdp command we can export the table content, but my Question is how do I export data from one day. My table having 2 years of data and I need download the data of only one day.
expdp scott/tiger@db10g tables = EMP, DEPT = TEST_DIR dumpfile = EMP_DEPT.dmp expdpEMP_DEPT.log = logfile directory
Can someone tell me how to download data from one day to the table & compare data exported with the data in the table. (I know both exported and data of the table data will be the same that we are downloading data of the actual table, but for tests, I need to know how to compare).
Thank you
SreeHowever, I do not understand the scenario but here is a way to compare:
(1) change the name of the table newly created in another name
(2) import the exported file once againyou will have the same data in both tables
-
SOS! -Error to load data from Oracle 11 g to Essbase using ODI
Hi all.
I want to load data from oracle database to essbase using ODI.
I have set up correctly the Hyperion essbase physical and logical topology manager and got the structure ESSBASE BASIC app DEMO.
The problem is.
1. when I try see data right click on the table of essbase.
va.sql.SQLException: driver must be specified
at com.sunopsis.sql.SnpsConnection.a (SnpsConnection.java)
at com.sunopsis.sql.SnpsConnection.testConnection (SnpsConnection.java)
at com.sunopsis.sql.SnpsConnection.testConnection (SnpsConnection.java)
at com.sunopsis.graphical.frame.b.jc.bE (jc.java)
at com.sunopsis.graphical.frame.bo.bA (bo.java)
at com.sunopsis.graphical.frame.b.ja.dl (ja.java)
to com.sunopsis.graphical.frame.b.ja. < init > (ja.java)
to com.sunopsis.graphical.frame.b.jc. < init > (jc.java)
I got the answer of partisan Oracle it's ok, just omit it. The second problem will appear.
2 create an interface between the oracle and essbase database, click on the option ' staging of deffirent from the area of the "(ce qui signifie que la mise en scène est créé à la base de données oracle) target, and using IKM SQL for Hyperion Essbase (metadata), run this interface".
org.apache.bsf.BSFException: exception of Jython:
Traceback (innermost last):
"< String >" file, line 61, in there?
com.hyperion.odi.essbase.ODIEssbaseException: invalid value specified [RULES_FILE] for the load option [null]
at com.hyperion.odi.essbase.ODIEssbaseMetaWriter.validateLoadOptions (unknown Source)
at com.hyperion.odi.essbase.AbstractEssbaseWriter.beginLoad (unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (unknown Source)
at java.lang.reflect.Method.invoke (unknown Source)
at org.python.core.PyReflectedFunction.__call__ (PyReflectedFunction.java)
at org.python.core.PyMethod.__call__ (PyMethod.java)
at org.python.core.PyObject.__call__ (PyObject.java)
at org.python.core.PyInstance.invoke (PyInstance.java)
to org.python.pycode._pyx1.f$ 0 (< string >: 61)
to org.python.pycode._pyx1.call_function (< string >)
at org.python.core.PyTableCode.call (PyTableCode.java)
at org.python.core.PyCode.call (PyCode.java)
at org.python.core.Py.runCode (Py.java)
at org.python.core.Py.exec (Py.java)
I am very confused by it. Someone give me a solution or other docs.
Ethan.Hello
You say that you are loading, but you chose the KM for the loading of metadata?
If you load metadata then you must provide a rules file, if you are loading and then choose the KM - IKM SQL for Hyperion Essbase (DATA)Ok?
See you soon
John
http://John-Goodwin.blogspot.com/
Maybe you are looking for
-
Qosmio F60 - 10L Bios does not work
Hey there, I just bought a Toshiba Qosmio F60 - 10L.Now the Bios no longer works. Every time I want to enter the menu of the Bios with "F2" the computer restarts instantly. Last week, the motherboard was changed.But now, after I set a supervisor pass
-
Question about different types of shared variables
Hello I'm trying to use shared variables to pass data between several screws but I do not understand the types. Like, what is the difference between unique process and publish shared network variable? Also between absolute and relative target. I've
-
My status bar (I think that's the name), is generally down vertically. All of a sudden it's on the right horizontally. How can I get this back where it belongs?
-
"windows cannot read the disk in drive D": I tried all types of recorded discs,.
Disk drive is internal in a laptop inspiron 8200, I tried cd & dvd, with photos, music, movies, etc.
-
Help, please