zoukankan      html  css  js  c++  java
  • 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设置多个存储过程参数并调用存储过程。

  • 相关阅读:
    frog-jump
    nth-digit
    binary-watch
    elimination-game
    evaluate-division
    random-pick-index
    integer-replacement
    rotate-function
    longest-substring-with-at-least-k-repeating-characters
    decode-string
  • 原文地址:https://www.cnblogs.com/zhutouying/p/3143981.html
Copyright © 2011-2022 走看看