bat调用带参数存储过程

@bat调用sql文件

  sqlplus user/pass@orcl @F:\factory.sql

@将所有的存储过程封装在sql中

  factory.sql:exec pro_factory(&identifier,&param);

@pro_factory.pro存储过程封装所有的子存储过程,并设置参数identifier区分不同的存储过程

create or replace procedure pro_factory(identifier in number, param in varchar2) is
begin
  if identifier=0 then
    pro_1(param);
    pro_2(param);
    pro_3(param);
    elsif identifier=1  then pro_1(param);
    elsif identifier=2  then pro_2(param);
    elsif identifier=3  then pro_3(param);
    else
      dbms_output.put_line('存储过程编号不存在!');
  end if;
end pro_factory;
/

@&identifier是从bat设置的参数

这样就实现了bat设置多个存储过程参数并调用存储过程。

 

转载于:https://www.cnblogs.com/zhutouying/p/3143981.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值