linux shell 执行oracle存储过程

来源:互联网 发布:淘宝性保健品吗 编辑:程序博客网 时间:2024/06/07 01:24

在linux下用shell执行oracle的存储过程


####函数####说明:执行oracle存储过程####输入参数:{数据库tns}{数据库用户名}{数据库密码}{存储过程名}{批处理日期}####  输出参数:存储过程执行结果function exe_proc{oracle_sid=$1user_name=$2user_pwd=$3proc_name=$4etl_date=$5error_code=`sqlplus -S -L /nolog<<EOFconnect $user_pwd/$user_pwd@$oracle_sidset 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;quitEOF`echo$error_code}


原创粉丝点击