Computing.Net > Forums > Unix > SQL 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.

SQL in shell script

Reply to Message Icon

Name: Nirmala
Date: October 20, 2003 at 01:34:11 Pacific
OS: Unix
CPU/Ram: P4
Comment:

Hi
i have written a shell script which runs some sql queries in oracle.
the code looks like this

sqlplus username@NJCMTOMS/password < $HOME/devel/oms/arg/cleanupsql.sh

cleanupsql.sh has the sqls to be executed.

This works fine if i run from the prompt but when i run from a cron,then cron is not able to find sqlplus.i also tried giving the absolute path for sqlplus ,still no success.




Sponsored Link
Ads by Google

Response Number 1
Name: Nails
Date: October 20, 2003 at 13:33:52 Pacific
Reply:

Hi:

This is a common problem with any shell script that runs fine from the command line, but fails from cron.

You need to set up your environment in the script - primarily PATH and any environmental variables ORACLE requires.

Regards,

Nails


0
Reply to Message Icon

Related Posts

See More







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: SQL in shell script

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

Unix shell script runing SQL files www.computing.net/answers/unix/unix-shell-script-runing-sql-files/5286.html

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