Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Daily SQL Update Statement Execution
In article <v4Mz4.1256$kv6.71320_at_newsread1.prod.itd.earthlink.net>,
mprovost_at_liquidgolf.com says...
> I need to run an update sql statement once a day. How can I automate this?
If you're using UNIX, the following should do the trick;
vi ~/bin/my_script # Create $HOME/bin/my_script
# Source your profile
. /home/my_userid/.profile
sqlplus << EOF
connect my_oracle_id/my_oracle/pwd
<< Remaining sql commands >>
exit
EOF
### end my_script
# Ensure script is executable
chmod 755 ~/bin/my_script
# Edit your crontab
crontab -e
0 0 * * * /usr/bin/ksh /home/my_userid/bin/my_script
### end
--
![]() |
![]() |