oracle - sqldeveloper 手动执行包 package的方法

时间:2021-11-05 22:43:50

比如建立一个包头如下:

create or replace PACKAGE LSG_OBC_ORDERS_HK01_EC_PKG
AS
  PROCEDURE LSG_OBC_HK01_main(
      errbuf OUT VARCHAR2,
      retcode OUT NUMBER,
      p_ou    IN VARCHAR2,
      p_from_date IN VARCHAR2,
      p_to_date IN VARCHAR2  );
      
  PROCEDURE Generate_ou_data (
      errbuf OUT VARCHAR2,
      retcode OUT NUMBER,
      p_ou    IN VARCHAR2,
      p_from_date IN date,
      p_to_date IN date
  );
  
      
END LSG_OBC_ORDERS_HK01_EC_PKG;

 

放在编译器中对应好 参数执行即可:

  ----执行---
  DECLARE
     aaaa VARCHAR2(100);
     retcode number;
     testvalue VARCHAR2(20);
     p_ou VARCHAR2(100);
     p_from_date  VARCHAR2(100);
     p_to_date  varchar2(100);
BEGIN
    p_ou := '1234';  --公司代码
    p_from_date := '20190201';
    p_to_date :=  '20190201';
    testvalue := 'First Test!';
    dbms_output.put_line( testvalue );
    LSG_OBC_ORDERS_HK01_EC_PKG.LSG_OBC_HK01_main(aaaa , retcode, p_ou  ,p_from_date,p_to_date );
 END;