We Need to Pass 3 Parameters to the Script to Execute the Package.
They are
1.Database server name
2.Package name.procedure name
3.procedure parameter delimited by commas, if any
#!/usr/bin/ksh
## ---------------------------------------------------------------------------------------
## Program Name xxmcf_runpkg_frm_batchsrv.prog
## TYPE shell script
## Input Params
## 1.Database server name
## 2.Package name.procedure name
## 3.procedure params delimited by commas, if any
##
##
## Output Parms NA
##
##
## AUTHOR Chandra Sekhar K
## DATE 29-NOV-2010
## VERSION 1.0
## DESCRIPTION This script will be executed on CCDEV40,
## and will run a package existing on CCDEV39
##--------------------------------------------------------------------------------------------
## Assigning parameters
DB_SRV=$1
PROC_NAME=$2
PROC_PARAMS=$3
export ORACLE_BASE=/mcf11gR1/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11gR1
PATH=$PATH:$ORACLE_HOME/bin:.export PATH
echo "-----------PARAMETERS ENTERED-------------"
echo " "
echo "procedure name is " $PROC_NAME
echo "procedure params are "$PROC_PARAMS
echo " "
echo "----------RUNNING PACKAGE STARTS-------------"
echo " "
conn_id=`ls|grep $1 /MCFFTP/scripts/bin/conn_string.txt | cut -d "=" -f 2-`
if [ "$3" = "" ]
then
echo "Package params are null."
sqlplus $conn_id <<-EOF21
set heading off
set feedback off
set verify off
set serveroutput on
begin
$PROC_NAME;
end;
/
COMMIT;
exit
EOF21
else
echo "Procedure requires parameters."
sqlplus $conn_id <<-EOF22
set heading off
set feedback off
set verify off
set serveroutput on
begin
$PROC_NAME($PROC_PARAMS);
end;
/
COMMIT;
exit
EOF22
fi
exit 1
They are
1.Database server name
2.Package name.procedure name
3.procedure parameter delimited by commas, if any
#!/usr/bin/ksh
## ---------------------------------------------------------------------------------------
## Program Name xxmcf_runpkg_frm_batchsrv.prog
## TYPE shell script
## Input Params
## 1.Database server name
## 2.Package name.procedure name
## 3.procedure params delimited by commas, if any
##
##
## Output Parms NA
##
##
## AUTHOR Chandra Sekhar K
## DATE 29-NOV-2010
## VERSION 1.0
## DESCRIPTION This script will be executed on CCDEV40,
## and will run a package existing on CCDEV39
##--------------------------------------------------------------------------------------------
## Assigning parameters
DB_SRV=$1
PROC_NAME=$2
PROC_PARAMS=$3
export ORACLE_BASE=/mcf11gR1/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11gR1
PATH=$PATH:$ORACLE_HOME/bin:.export PATH
echo "-----------PARAMETERS ENTERED-------------"
echo " "
echo "procedure name is " $PROC_NAME
echo "procedure params are "$PROC_PARAMS
echo " "
echo "----------RUNNING PACKAGE STARTS-------------"
echo " "
conn_id=`ls|grep $1 /MCFFTP/scripts/bin/conn_string.txt | cut -d "=" -f 2-`
if [ "$3" = "" ]
then
echo "Package params are null."
sqlplus $conn_id <<-EOF21
set heading off
set feedback off
set verify off
set serveroutput on
begin
$PROC_NAME;
end;
/
COMMIT;
exit
EOF21
else
echo "Procedure requires parameters."
sqlplus $conn_id <<-EOF22
set heading off
set feedback off
set verify off
set serveroutput on
begin
$PROC_NAME($PROC_PARAMS);
end;
/
COMMIT;
exit
EOF22
fi
exit 1
No comments:
Post a Comment