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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PL/SQL -- Spooling to a different server

Status
Not open for further replies.

toddyl

Technical User
Sep 26, 2005
102
US
Hi,

I have a series of Oracle sql scripts that retrieve data and output them to csv files on the local machine (a SUN server). These scripts use a select statement and the spool command.

Right now I am doing: spool /usr/home/myuser/Report.csv in my SQL scripts

I have been asked if I can change the output to be written to a different machine -- a windows box.

Does anyone know if this is possible and how can I do this from the PL/SQL spool command?

Is it possible to do something like spool '255.255.255.255/C:\My Report Directory\myreport.csv'

Thanks,

toddyl
 
Not sure if it can be done this way ...
I don't think so, but someone else may know better.

Did you consider Samba ?
A Unix file system on your server, that can be mounted on a Windows machine.
 
Yes, Samba, which allows a Windows DFS-mount to a Unix file system, would allow the Windows machine to directly access a file spooled from a Unix origin.

And just one slight adjustment, Toddy, to your nomenclature:
...can I do this from the PL/SQL spool command?
PL/SQL has no "spool" command; only SQL*Plus has a "spool" command.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I can provide you with low-cost, remote Database Administration services: see our website and contact me via www.dasages.com]
 
Unfortunately our IT department do not want to give Samba access to the box I am working on and so I have been asked to try and do this via SQL PLUS (and not PL/SQL as I incorrectly said earlier :) thanks Mufasa for pointing this out)

Is there a way to do this using the spool command?
 

As mentioned before: Only if you can "mount" the disk on the Unix box -- Or make Unix directory available as Network drive (maybe sing samba).

[3eyes]

----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Are you allowed to install software on the Windows box? There is a package called "Unix services for Windows" (at least for Win2000 and 2003).
With this you can export Windows-directories as NFS-filesystems, which your SUN can mount without anything installed there.

Stefan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top