1. 程式人生 > >linux shell 執行oracle儲存過程

linux shell 執行oracle儲存過程

在linux下用shell執行oracle的儲存過程

####	函式
####	說		明:執行oracle儲存過程
####	輸入引數:{資料庫tns}{資料庫使用者名稱}{資料庫密碼}{儲存過程名}{批處理日期}
####  輸出引數:儲存過程執行結果
function exe_proc
{
	oracle_sid=$1
	user_name=$2
	user_pwd=$3
	proc_name=$4
	etl_date=$5
error_code=`
sqlplus -S -L /nolog<<EOF
connect $user_pwd/[email protected]
$oracle_sid set termout off; set echo off; set feedback off; set heading off; set pagesize 0; var ora_return_code number; call $proc_name($etl_date,:ora_return_code); select :ora_return_code from dual; quit EOF` echo $error_code }