• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 485
  • Last Modified:

Text File generation in oracle

Can anybody tell me, how to generate text file in oracle without using UTL_FILE_DIR ?
0
gotetioracle
Asked:
gotetioracle
2 Solutions
 
Alexander Eßer [Alex140181]Software DeveloperCommented:
http://www.orafaq.com/node/848

see chapter "Unloading data into an external file..."
0
 
gotetioracleAuthor Commented:
hi Alex140181,

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

Regards,
GSK
0
 
Alexander Eßer [Alex140181]Software DeveloperCommented:
Did you READ the chapter from my link above?!? -> no use of UTL_FILE
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
gotetioracleAuthor Commented:
i read but the document does not tell how to write a data from a table to a csv file.
0
 
johnsoneSenior Oracle DBACommented:
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
 
slightwv (䄆 Netminder) Commented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now