Mainly has
#!/bin/bashsource /etc/profilesource ~/.bash_profile################################################ ################## #功能描述: Call a stored procedure with input parameters and output parameters # Execution period: Day # crontab: * 1 * * * * ${prog_path}call_prodedure.sh >> ${prog_path}call_prodedure.log 2&1# : Hongjie # creation time: 2016/07/13# Modify record: ################################################################## #programing pathprog_path=/utxt/softsmb/scripts/#database tnsnamedb_srv= "smb/[email protected]" #exportingexport_path =/utxt/softsmb/scripts/start_date= ' date + "%y-%m-%d %h:%m:%s" ' echo "START time:${start_date} "sqlplus -s ${db_srv} <<eofdeclare v_acct_date VARCHAR2 (8);--Input parameters tom_sqlcode varchar2 (100);--Output parameters ERR1 &NBSP;&NBSP;&NBSP;&NBSP;VARCHAR2 (100);--Output parameter begin err1 := '; tom_sqlcode := '; select to_char (sysdate-1, ' YYYYMMDD ') into v_acct_ Date from dual; pro_serv_delay_report_day (V_acct_date, err1, tom_sqlcode); end;/exiteofend_date= ' date + "%y-%m-%d %h:%m:%s" ' echo "End time:${end_date}"
This article from "Sima" blog, declined reprint!
Shell script calls a stored procedure with parameters