Hi,
How to call a stored procedure from shell script and vice-versa?
Thanks
Printable View
Hi,
How to call a stored procedure from shell script and vice-versa?
Thanks
I think its like calling a sql batch program.
For example:
shell1.exe
---------
sqlplus system/manager @batch1.sql
exit
batch1.sql
----------
execute dbms.refresh_db('fast');
exit
I think u can not do the reverse...u may opt to use
scheduler or crontab to call the shell script.
Am i right davey :) or partly
You can combine the shell script and the sql script into a single shell script. I assume in the example that oraenv is in /usr/local/bin. On some UNIX platforms it's located elsewhere
To call a shell script from a stored procedure your looking at Java in the database on external procedures in C or similar.PHP Code:
#
# Set up the oracle environment
#
export ORACLE_SID=TESTDB
export ORAENV_ASK=NO
export PATH=/usr/local/bin:$PATH
#
. oraenv
#
sqlplus username/password <<EOF
exec myprocedure;
exit
EOF