unix shell script to execute procedure with passing parameters [message #231487] |
Tue, 17 April 2007 04:54 |
rajasekharam
Messages: 12 Registered: July 2005
|
Junior Member |
|
|
Hi,
I have screen which was desined in PL/SQL Catridges in apps. In that screen some enterable fields these values r the passing parameters to create value sets, functions, menus etc in apps by using front end screens. Now in that screen i have a button. when i click that button it have to create unix shell script which i need to run this script in unix to compile the package which we have written and pass those screen feild values to the package.
Please give me some thing replated to this idea or if u have any script related script send to me.
Thanks
Rajasekharam
|
|
|
|
Re: unix shell script to execute procedure with passing parameters [message #233241 is a reply to message #231487] |
Wed, 25 April 2007 05:51 |
nmacdannald
Messages: 460 Registered: July 2005 Location: Stockton, California - US...
|
Senior Member |
|
|
#!/bin/ksh
#@(#)hotbackup_start -- starts S2000 hotbackup
###
# Korn script to start hot backup of the S2000 database
#
###
#
# Inform operator what job they have requested
# Ask if they wish to continue
#
echo " "
echo "*****"
echo Starting hot backup of S2000 database
echo "Continue? (Y/N)"
read answer
echo " "
if [[ "$answer" = [Yy]* ]]
then
df -k /u26
echo `date`
thedir=`pwd`
echo " "
echo Enter password for S2000 ORADBA
sttyops=`stty -g`
stty -echo
echo "Password: "\\c
read password
echo " "
stty $sttyops
#
# Start the hot backup job
#
sqlplus ORADBA/$password << EOF
@$thedir/hotbackup_start
exit
EOF
echo `date`
fi
|
|
|
|
|
|
Re: unix shell script to execute procedure with passing parameters [message #357288 is a reply to message #357101] |
Tue, 04 November 2008 10:57 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
to initiate the load while connected to the database, yes I'd use an external table or utl_file package to read the external file (available on the DB server machine). The main advantage is no passwd in external script. To initiate the load from a scipt, you could use sql*loader to load the data into a table and then process the data from there (using trigger to call the proc), or just use sqlplus. Simplified example (date format ommitted, default error handling etc)...
my_host>>cat t.txt
10/31/2008
11/01/2008
my_host>>cat t.txt | sed "s/^/exec my_proc(\'/;s/$/\');/" > tmp.sql
my_host>>cat tmp.sql
exec my_proc('10/31/2008');
exec my_proc('11/01/2008');
my_host>>echo exit | sqlplus -s scott/tiger@dev @tmp.sql
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
my_host>>
|
|
|