Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UTL_FILE utility

Status
Not open for further replies.

roche786

Programmer
Sep 5, 2002
24
US
Hello,

I am using the UTL_FILE utility to write to a file on the server. How do I get to the file from SQLPLUS .I mean how can i view the file from SQLPLUS .I tried GET but it says unable to open.

Kindly Advise.

Thanks
 
The only way I can think of to view the file from SQL*Plus is to define an external table based on the file and then do a SELECT on it. SQL*Plus is designed for viewing the database, not the file system. Unless you make the file part of the database, SQL*Plus is the wrong tool.
 
My apologies - you can also use the UTL_FILE package to read from the file.
 
Roche,

As usual, everything that Carp has said is correct. (BTW, Carp, can you please call me or e-mail me...the e-mail I have for you is bogus, I always get your voicemail at work, and your phone seems always busy at home...[I guess the Corgi business is booming, huh.] )

Additionally, the key here is
Roche said:
I am using the UTL_FILE utility to write to a file on the server...
By what method do you normally view the contents of files on your server (from your client)? If, for example, your client is a Windows-based PC and your server is a Unix-based machine, then I typically would view the contents of a server-side file by either a) logging into the server and using the "cat" or "more" commands, b) ftp-ing the file from the server to the client, then using a client-side "type" or "edit" command, or c) (if I am lucky, "Samba" is available to the Unix server from the PC and I can treat a Unix-side file as I would a client-side file.

Does this give you the information that you need?

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 17:14 (04Jan05) UTC (aka "GMT" and "Zulu"),
@ 10:14 (04Jan05) Mountain Time

Click here to Donate to Tsunami Relief. 100% of your contributions here go to the victims...0% to administration.
They were "The First-Responder" to the disaster, with relief deliveries arriving before Red Cross and U.S. aid.
 
How can you get to the file from SQLPLUS

sqlplus > $ <enter>
c:\cat filename
when you are done viewing
c:\exit
sqlplus>

 
Code:
How do I get to the file from SQLPLUS .I mean how can i view the file from SQLPLUS .I tried GET but it says unable to open.

If the file is on Unix (same as server) then you can view the cntent of file by
sql> host vi <file name>

or
sql> host more <file name>

Regards,
Gunjan
 
LHugh and Gunjan,

As I understand Roche's original post, s/he writes with the "UTL_FILE" package (which writes to the server only). Again, lacking confirmation disclosures from Roche, we do not know what operating systems apply to Roche's client and server environments. So far, our presumptions are that her/his server environment is Unix and the client environment is Windows.

Under those presumptions, I cannot see how your suggestions, above, will work. Could you clarify/explain?

Also, Roche, could you please clarify the operating systems that apply to your server and client environments?

Cheers,

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 17:36 (18Jan05) UTC (aka "GMT" and "Zulu"),
@ 10:36 (18Jan05) Mountain Time

Click here to Donate to Tsunami Relief. 100% of your contributions here go to the victims...0% to administration.
They were "The First-Responder" to the disaster, with relief deliveries arriving before Red Cross and U.S. aid.
 
Hi,

Yeah , the server is Unix and the client is windows.


Regards
roche
 
Hi,

In the above case (clien windows and server unix), our suggestion is not going to work. And I presumed a thing that (s)he has access to server and so based on that posted it. Well A LESSON LEARNED. Anyway I am also learning and its part of learning... :)

Regrads,
Gunjan
 
Right you are, matey. We're all learning something new every day. Anyone who claims they know it all would lie about other things, too. [wink]

Cheers,

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 08:36 (19Jan05) UTC (aka "GMT" and "Zulu"),
@ 01:36 (19Jan05) Mountain Time

Click here to Donate to Tsunami Relief. 100% of your contributions here go to the victims...0% to administration.
They were "The First-Responder" to the disaster, with relief deliveries arriving before Red Cross and U.S. aid.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top