Home » SQL & PL/SQL » SQL & PL/SQL » PL/SQL create text file from Oracle table data
PL/SQL create text file from Oracle table data [message #348365] Tue, 16 September 2008 09:28 Go to next message
mhakimjavadi
Messages: 37
Registered: July 2008
Member
Hi,

I am trying to create a flat file with the data from oracle table. I need the procedure create file in client PC. I need some example that helps me for that. Please advice.

Thanks
Re: PL/SQL create text file from Oracle table data [message #348768 is a reply to message #348365] Wed, 17 September 2008 22:54 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Is this a Forms or a PL/SQL question?

David
Re: PL/SQL create text file from Oracle table data [message #348961 is a reply to message #348365] Thu, 18 September 2008 07:10 Go to previous messageGo to next message
mhakimjavadi
Messages: 37
Registered: July 2008
Member
Hi David,

Thanks for your reply. This is PL/SQL question. I need to create a procedure for this job in PL/SQL.

Thanks
Re: PL/SQL create text file from Oracle table data [message #349065 is a reply to message #348961] Thu, 18 September 2008 15:15 Go to previous messageGo to next message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
On a client PC? As UTL_FILE manipulates with files on a server, you might map server directory to client's PC and access file(s) over the network.

In Forms, you might check use of the TEXT_IO package which manipulates files on a client machine.
Re: PL/SQL create text file from Oracle table data [message #349142 is a reply to message #349065] Fri, 19 September 2008 01:45 Go to previous messageGo to next message
_jum
Messages: 509
Registered: February 2008
Senior Member
You could use
SPOOL <flat_file>;
SELECT <statement>;

Have a look at the SET options and examples for SPOOL in the manual.
Re: PL/SQL create text file from Oracle table data [message #349145 is a reply to message #349142] Fri, 19 September 2008 01:59 Go to previous messageGo to next message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
SPOOL is the SQL*Plus command, and these do not work in PL/SQL procedures.
Re: PL/SQL create text file from Oracle table data [message #349291 is a reply to message #349065] Fri, 19 September 2008 13:05 Go to previous messageGo to next message
mhakimjavadi
Messages: 37
Registered: July 2008
Member
Thanks for your reply. I need to create procedure in PL/SQL. Do we have something same as TEXT_IO Package in oracle form for PL/SQL environment?
Re: PL/SQL create text file from Oracle table data [message #349292 is a reply to message #349291] Fri, 19 September 2008 13:07 Go to previous message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Carefully read Littlefoot's answer:
Littlefoot wrote on Thu, 18 September 2008 22:15
On a client PC? As UTL_FILE manipulates with files on a server, you might map server directory to client's PC and access file(s) over the network.
In Forms, you might check use of the TEXT_IO package which manipulates files on a client machine.


Regards
Michel

[Updated on: Fri, 19 September 2008 13:08]

Report message to a moderator

Previous Topic: Regarding Batch Job to retrieve data from Client DB to our local DB
Next Topic: Single quote to double quotes - please help
Goto Forum:
  


Current Time: Thu Dec 08 10:25:12 CST 2016

Total time taken to generate the page: 0.07179 seconds