Computing.Net > Forums > Unix > ftp sql results in shell script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

ftp sql results in shell script

Reply to Message Icon

Name: Nirm Chett
Date: June 16, 2004 at 11:27:45 Pacific
OS: unix
CPU/Ram: dont know
Comment:

Hello
Can anybody explain how I can ftp the reult of a sql script in a shell script that is executed via a cronjob??I would like the result to be sent to a a folder on a different server or to a person's email address.Any help is appreciated.

thanks
NC




Sponsored Link
Ads by Google

Response Number 1
Name: thepubba
Date: June 16, 2004 at 20:16:30 Pacific
Reply:

Try piping your output to a mail program.

script.sql | mailx jlemieux@devnull


0

Response Number 2
Name: mesank
Date: June 17, 2004 at 00:02:56 Pacific
Reply:

hi
first create txt file like

txt.txt
Open Ip addresss
username
pwd
--if want to upload a file then
put filename
--if want to download a file
get filename
bye

after creating this text file.
call this text file from a batch file like

test.bat
ftp -s:txt.txt
here s =lower case
ftp is case sensitive
if wanna help for this
go to dos mode
ftp
help
or else
ftp
open tp address
remotehelp

try this i have implemented this in my database.
bye
sankar


0

Response Number 3
Name: wollie
Date: June 17, 2004 at 02:23:04 Pacific
Reply:

Hi NC,

why not logging the results of SQL with the spool - SQL statement into a file which you then can handle in any way you want ?

Or didn't I get your drift ?

W


0

Response Number 4
Name: Nirm Chett
Date: June 21, 2004 at 08:19:24 Pacific
Reply:

Hello All
Thanks for the help..I have the ouput going to a .lis file but can I include the mailx command in the same shell script that I am using to execute the .sql file?. i.e I want the output file to be emailed to the user as soon as the sql script is run..

-NC


0

Response Number 5
Name: David Perry
Date: June 21, 2004 at 12:23:20 Pacific
Reply:

Use the pipe command.

ls | mail user@host.com
ls | uuencode attachment.txt | mail user@host.com

( ls ; cat /filename ) | mail user@host.com


0

Related Posts

See More



Response Number 6
Name: Nirm Chett
Date: June 22, 2004 at 07:07:26 Pacific
Reply:

Hello
Thanks david for the help, when I use the mailx command by itself outside the script its emailing the output but when I include it in the script The output is not getting emailed..follwing is the script:
#!/bin/sh
#/home/test
#connect to db
sqlplus -s /nolog <<EOF
connect sql/sql@test
@recon.sql
mailx nims_2k1@yahoo.com < recon.lis
exit
EOF

where recon.lis is the output file.

thanks
NC


0

Response Number 7
Name: David Perry
Date: June 22, 2004 at 11:40:12 Pacific
Reply:

#!/bin/sh
#/home/test
#connect to db
sqlplus -s /nolog <<EOF
connect sql/sql@test
@recon.sql
exit
EOF
mailx nims_2k1@yahoo.com < recon.lis

# mailx is not a sqlplus command

# or

(sqlplus -s /nolog <<EOF
connect sql/sql@test
@recon.sql
exit
EOF ) | mailx nims_2k1@yahoo.com


0

Response Number 8
Name: WilliamRobertson
Date: June 22, 2004 at 15:44:03 Pacific
Reply:

Or even use DBMS_JOB and UTL_SMTP within Oracle, and not bother with cron, shell, SQL*Plus etc.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: ftp sql results in shell script

SQL in shell script www.computing.net/answers/unix/sql-in-shell-script/5538.html

loops in shell scripts!!! www.computing.net/answers/unix/loops-in-shell-scripts/5140.html

Using hex-code in shell script www.computing.net/answers/unix/using-hexcode-in-shell-script/4227.html