Export Oracle table using Stored Procedure to an excel file - oracle

I am using SQL Developer 1.5.5 and I need to export some tables from an Oracle 11g database to an xls file. I have tried using spool, but I cannot put in a stored procedure as error comes up. Is there some other alternative to do this?
I am trying to create reports from data base by executing the procedure.
Thanks.

Anton Scheffer (from AMIS.NL) wrote an APEX plugin to load Oracle data into a Excel file. It works very well and it can be used alone (without APEX) with a additional work.
Check out: http://technology.amis.nl/2011/02/19/create-an-excel-file-with-plsql/
You can also use SQLX (see http://technology.amis.nl/2006/01/20/generate-anative-excel-file-with-sqlx/) but it could be very complex depending on what you ha

Related

How to use bcp utility with oracle dB or any other better options

I have a csv file which has to be bulk imported to oracle dB. I was working on other sybase dB engine before so I had a sample script which has the environment setup for it. Right now I have to do the process in a oracle dB so what should be the first line I know about the rest other parameters but want to know the path which has to be defined when I write
path/bcp dbtable in data.txt
If anyone could help what should be the path for oracle dB
The primary tools for bulk or flat file loading are:
SQL*Loader
External Tables (and here)
GUI Tools like SQL*Developer
It is much more cumbersome, but if necessary you can roll your own solution with the UTL_FILE PL/SQL package.

How to create flat file from toad for oracle using script OR stored procedure?

I need to create a flat file using script/stored procedure in toad for oracle. I can't use UTL_FILE here because of the privilege reason.
Please do not suggest me export wizard.
Thanks in advance.
Creating an external table that writes into a file might be an option too: External Table Concepts
The advantage is you can use/execute it anywhere (Toad, procedure call in DB, SQL console, etc)
If you need it only once or a few times I would use as already mentioned: spool file or the dbms_output package.

How to export database from Oracle Application Express

Really would appreciate any help whatsoever on this one.
How to generate DDL from Application Express... including the actual data.
I can create a DDL; but one which contains none of the necessary inserts into the database tables. :<
There is no command console in Application Express.
You could use another tool, such as SQL Developer, which can export the data as INSERT statements; alternatively, use Oracle's schema export utility (expdp) which can either export just the data or the entire schema if you like.

Bulk export in oracle 8i

How can I export data from Oracle 8i database using command which I can run through oracle cli?
My biggest problem is, the data should be exported based in the query I use...
For ex,
select * from emp where emp_id>4
should dump the records having emp_id>4.
I don't have permission to use functions.
Please help!!
Oracle provides a set of tools that are designed for exporting data (the exp tool, for instance). These don't run via the SQL*PLUS command line (which I assume is what you mean by CLI), although they do connect via NET*8. From Oracle 8i onwards, you can use the query parameter to limit the rows exported:
exp scott/tiger tables=emp query="where deptno=10"
But you have to have the Oracle client installed and be able to connect to the database via SQL*NET.
If all you have is the ability to run queries, you're out of luck unless you can write a query that generates a CSV (tricky if you don't have the ability to call/write functions). It sounds to me like all you have access to is a web interface.

Import and Export Data plus schema using SQLDeveloper 3.0.04

i am newbie to oracle and i like to export database from remote database and import it on local machine. eOn both machines i have oracle 10.2.
I need to know how to export/import schema and data from oracle 10.2 using SQLDeveloper 3.0.0.4.
To export from remote database, i have used export Tool-> Database Export -> export wizard.
and at the end i have got only sql file with DDL and DML statements but somewhere in file it is written
"Cannot render Table DDL for object XXX.TABLE_NAME with DBMS_METADATA attempting internal generator error.
I have ignored previously mentioned message and tried to run those DDL and DML statements but all this ended up with errors.
Is it possible that all this tied with read-only database user? More over, i dont find any table under tables but also tables under other users in SqlDeveloper.
Thanks in advance
As a test, can you select one object in the tree, and navigate to the script panel? SQLDEV also uses DBMS_METADATA to generate those scripts.
Also, as a work-around, try using DataPump to export and import your data. It will be much more efficient for moving around larger schemas.
Your note about not seeing tables under indicates your schema doesn't actually own any tables. You may be working with synonyms that allow you to query objects as if they are in your account. You could be running into a privilege issue, but your error message doesn't indicate that. Error messages often come in bunches, and the very first one is usually the most important.
If you could try using the EXPORT feature say against a very simple schema like SCOTT as a test, this should indicate whether there is a problem with your account settings or with the software.
I'm not sure with SQL Developer 3.0 but with version 3.1 you can follow this:
SQL Developer 3.1 Data Pump Wizards (expdp, impdp)

Resources