The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Transfer file from local unix server to remote server indira Shell Programming and Scripting 2 05-03-2007 07:35 AM
passing unix variable to sqlplus without a file name sakthi.abdullah UNIX for Advanced & Expert Users 3 12-12-2006 06:35 AM
SQLPLUS from a remote server chittari Shell Programming and Scripting 5 08-08-2006 03:37 AM
SSH key code versus server key code Texan Security 1 04-12-2006 12:57 PM
Increase width of Spool file handynas UNIX for Dummies Questions & Answers 2 11-20-2001 09:24 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-31-2007
vprevin vprevin is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 2
code to FTP the spool file from Sqlplus to the unix server.

I have a sqlplus report and inside that report I have the following piece of code to mail the report output to the email id.

My requirement is, instead of emailing the output I want to FTP that script to a different unix server (say ip as 10.10.1.1). How to modify this code to FTP the spool file to the unix server.

IF :g_email_to IS NOT NULL THEN
SELECT name INTO :g_dbname FROM v$database;
:g_host_cmd := 'echo "sending email ..."; sync; sync; sync; '||'uuencode '||:g_spool_file||' '||:g_attach_file
||' | mailx -r "oraclefinancials_'||:g_dbname||'"';
:g_host_cmd2 := 'cat '||:g_spool_file||' >> '||:g_outfile;

IF :g_prog_title IS NOT NULL THEN
IF instr(:g_prog_title,' ') > 0 THEN
v_quote := '''';
ELSE
v_quote := NULL;
END IF;
:g_host_cmd := :g_host_cmd||' -s '||v_quote||:g_prog_title||v_quote;
END IF;

IF instr(:g_email_to,' ') > 0 THEN
v_quote := '''';
ELSE
v_quote := NULL;
END IF;
:g_host_cmd := :g_host_cmd||' '||v_quote||:g_email_to||v_quote||'; echo done';
ELSE
:g_spool_file := NULL;
:g_host_cmd := 'exit';
:g_host_cmd2 := 'exit';
END IF;
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:52 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0