Shell script calls a stored procedure with parameters

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.