Home » Infrastructure » Unix » call a stored procedure with parameters from shell script
call a stored procedure with parameters from shell script [message #238130] |
Wed, 16 May 2007 15:59  |
oraanu
Messages: 22 Registered: September 2005 Location: Boston
|
Junior Member |
|
|
Hi,
I need to call a procedure with parameters in my shell script.
I have created a local function in my unix shell script.
unset -f TruncCommonTbls
function TruncCommonTbls
#**********************************************************************
# Purpose:
# To call the sql to truncate the claim_format,claim_format_info
#**********************************************************************
{
typeset -i tempRC=${ESUCCESS}
typeset thisFunc="TruncCommonTbls "
DisplayFuncStats ${thisFunc} "enter"
#------------------------------------------
# run plsql to load final table
#------------------------------------------
sqlplus -s ${DB_LOGIN} >> ${sqlLogFile} <<-EOF
set heading off
whenever sqlerror exit failure
begin
dbadmin.truncate_table('COMMON','CLAIM_FORMAT');
end;
/
list
EOF
tempRC=${?}
#------------------------------------------
# error handling
#------------------------------------------
egrep -i "ORA-|ERROR" ${sqlLogFile} >/dev/null && \
{
echow "Could not truncate central tables!"
tempRC=${EFAILURE}
} || \
{
echoi "Tables truncated successfully!"
tempRC=${ESUCCESS}
}
} # end TruncCommonTbls
when I run my shell script it is not giving any error but the table is not truncated.
can anyone please help me.
Thanks,
Anu
|
|
|
|
Goto Forum:
Current Time: Thu May 01 22:57:41 CDT 2025
|