PLSQL Oracle存储过程(实例分析)

 

1、结构

.spc是包头文件 .bdy是包体文件      spc是bdy的声明

spc文件实例:

不带返回值的


   PROCEDURE sp_gen_buylease_report
  (
     i_operator   IN pt.toper, 
     i_address    IN pt.taddress, 
     i_func_no    IN pt.tfuncno, 
     o_errcode    OUT pt.terrcode,
     o_errmsg     OUT pt.terrmsg 
   );

带返回值的


  FUNCTION fn_calc_discount_rate_bsflag
  (
    i_trade_date         IN pt.tsdate,         
    i_due_date           IN pt.tsdate,         
    i_contract           IN clear.tc_foreign_clear_price.contract_id%TYPE,
    i_bs_flag            IN clear.tc_foreign_discount_rate.bs_flag%TYPE,   
    o_errcode            OUT pt.terrcode,                        
    o_errmsg             OUT pt.terrmsg                    
  ) RETURN NUMBER;

你可能感兴趣的:(数据库)