Solved

Text File generation in oracle

Posted on 2013-06-18
6
470 Views
Last Modified: 2013-06-29
Can anybody tell me, how to generate text file in oracle without using UTL_FILE_DIR ?
0
Comment
Question by:gotetioracle
6 Comments
 
LVL 13

Assisted Solution

by:Alexander Eßer [Alex140181]
Alexander Eßer [Alex140181] earned 250 total points
ID: 39255509
http://www.orafaq.com/node/848

see chapter "Unloading data into an external file..."
0
 

Author Comment

by:gotetioracle
ID: 39255665
hi Alex140181,

I want to generate a text file from the sql query output without using  UTL_FILE_DIR .

Regards,
GSK
0
 
LVL 13

Expert Comment

by:Alexander Eßer [Alex140181]
ID: 39255671
Did you READ the chapter from my link above?!? -> no use of UTL_FILE
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:gotetioracle
ID: 39255787
i read but the document does not tell how to write a data from a table to a csv file.
0
 
LVL 34

Expert Comment

by:johnsone
ID: 39255953
I'm a little confused.  Are you trying to avoid using the UTL_FILE_DIR parameter, or the UTL_FILE package.

You can use UTL_FILE without setting UTL_FILE_DIR.  You just have to have a directory object within Oracle that points to the directory where you want the file to be placed.  They are created with the CREATE DIRECTORY command.  Doc for CREATE DIRECTORY -> http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_5007.htm#i2061958
0
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 250 total points
ID: 39256004
There is always sqlplus and the spool command.

There are several ways to generate a CSV.  If you are using 11G, I suggest the LISTAGG function.

If not, I suggest the XMLAGG approach:
http://www.experts-exchange.com/Database/Oracle/Q_24914739.html#a25864822

There are more listed here:
http://www.oracle-base.com/articles/misc/string-aggregation-techniques.php
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Oracle Finace 3 48
select query - oracle 16 82
ORA-12560: TNS:protocol adapter error 8 50
Best RAID for a BDD Oracle 4 27
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now