Home » SQL & PL/SQL » SQL & PL/SQL » How to create Text file on local machine (PL SQL)
How to create Text file on local machine [message #364565] Tue, 09 December 2008 02:05 Go to next message
shekhar.salunkhe
Messages: 154
Registered: January 2008
Location: Pune
Senior Member
Hello
I want to know about How to create Text file on local machine(not on server) ...?
Please Help me.
Re: How to create Text file on local machine [message #364567 is a reply to message #364565] Tue, 09 December 2008 02:17 Go to previous messageGo to next message
wmgonzalbo
Messages: 98
Registered: November 2008
Member
What do you mean by local machine?

You mean you want to write your query (queried) table in a text file?

If you are using TOAD, it has tool that generates text file or .xsl file and such..

[Updated on: Tue, 09 December 2008 02:18]

Report message to a moderator

Re: How to create Text file on local machine [message #364569 is a reply to message #364567] Tue, 09 December 2008 02:24 Go to previous messageGo to next message
dr.s.raghunathan
Messages: 540
Registered: February 2008
Senior Member
hi,
similar question raised by some other person too. There he expressed his inability to write text file using sqlldr in the client environment (local machine) and he is able to do that in the server

shekar please give some more information about your need.

yours
dr.s.raghuanthan
Re: How to create Text file on local machine [message #364571 is a reply to message #364569] Tue, 09 December 2008 02:32 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Creating text files on your client is something that is done by the local client software.
SQL*PLus has SPOOL to output to local files.
Oracle Forms has the Text_IO package to do it

The solution depends entirely on what local software you are running.
Re: How to create Text file on local machine [message #364803 is a reply to message #364571] Wed, 10 December 2008 02:08 Go to previous messageGo to next message
shekhar.salunkhe
Messages: 154
Registered: January 2008
Location: Pune
Senior Member
Sir
I have a text file on local machine.i want to load text file data into oracle table.I want to use plsql script.Can i do with utl_file.Can i create directory on local machine using create directory command.I can not use front end tool.
Re: How to create Text file on local machine [message #364804 is a reply to message #364803] Wed, 10 December 2008 02:23 Go to previous messageGo to next message
dr.s.raghunathan
Messages: 540
Registered: February 2008
Senior Member
i also failed using utl_file at client environment whereas successful at server
yours
dr.s.raghunathan
Re: How to create Text file on local machine [message #364806 is a reply to message #364803] Wed, 10 December 2008 02:26 Go to previous messageGo to next message
dr.s.raghunathan
Messages: 540
Registered: February 2008
Senior Member
sorry for suplement post.. While using apex 3.1.2 utilities data of local machine text file was easily converted into table using load/unload. Internally whether it is using utl_file concept or not, i do not know.
yours
dr.s.raghunathan
Re: How to create Text file on local machine [message #364811 is a reply to message #364565] Wed, 10 December 2008 02:44 Go to previous messageGo to next message
tmc01120
Messages: 1
Registered: April 2007
Junior Member
just declare the Text_IO.File_Type
and load the sql plus
Re: How to create Text file on local machine [message #364827 is a reply to message #364811] Wed, 10 December 2008 03:29 Go to previous messageGo to next message
panyam
Messages: 146
Registered: May 2008
Senior Member
Hi shekar,

using Sqlldr you can load the data ( of text file ) to the database.

C:\Documents and Settings\rp47976>sqlldr system/oracle

control = C:\nis_ctl.ctl

SQL*Loader: Release 10.2.0.1.0 - Production on Wed Dec 10 14:53:34 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Commit point reached - logical record count 6



SQL> select * From tt;

NAME            SALES
---------- ----------
John               10
Jennifer           15
Stella             20
Sophia             40
Greg               50
Jeff               20

6 rows selected.

SQL> 
Re: How to create Text file on local machine [message #364874 is a reply to message #364565] Wed, 10 December 2008 05:48 Go to previous messageGo to next message
shekhar.salunkhe
Messages: 154
Registered: January 2008
Location: Pune
Senior Member
Thanks for reply
I am attaching the sample text file.I want to put empno,name and date of bith into oracle table.I have to use plsql and no oracle server is available.How to put those record into oracle table
  • Attachment: sample.txt
    (Size: 0.40KB, Downloaded 335 times)
Re: How to create Text file on local machine [message #364882 is a reply to message #364565] Wed, 10 December 2008 05:57 Go to previous messageGo to next message
cookiemonster
Messages: 12422
Registered: September 2008
Location: Rainy Manchester
Senior Member
Tell your boss(es) to stop being so ridiculous?
PL/SQL runs in the Database.
Consequently it can ONLY access files on the database server.
You need to either use some other tool - sqlloader being an obvious choice, or get that file onto the database server.
Re: How to create Text file on local machine [message #364915 is a reply to message #364882] Wed, 10 December 2008 07:59 Go to previous message
joy_division
Messages: 4643
Registered: February 2005
Location: East Coast USA
Senior Member
cookiemonster wrote on Wed, 10 December 2008 06:57

You need to either use some other tool - sqlloader being an obvious choice, or get that file onto the database server.



Or...

Tell your boss to stop telling you how to do your job unless they want you to tell them how to do their job Wink
Previous Topic: outerjoin
Next Topic: SQL Query required for self join
Goto Forum:
  


Current Time: Thu Dec 08 21:53:53 CST 2016

Total time taken to generate the page: 0.09813 seconds