oracle中如何调用存储过程

一、通过pls块来调用存储过程;

declare

 p_dzno varchar2(50);

 p_vchtype  VARCHAR2(50);

 p_productclass  VARCHAR2(50);

 p_dptcode  VARCHAR2(50);

 

begin

    p_vchtype:='MP';

    p_productclass:='03';

    p_dptcode:='206';

    

     PRODDATA.product_dz_proc.pd_getdzno(p_dzno,p_vchtype,p_productclass,p_dptcode);

     DBMS_OUTPUT.put_line(p_dzno);

end;


二、oracle 匿名块执行sql

declare

   CURSOR  flag_cur IS  select lp.product_code from lxg_product lp;  

   productInfo flag_cur%ROWTYPE;

   flag char(1);

begin

 for  productInfo in flag_cur loop

        select decode(

        (select count(g.product_code)

           from ahs_policy_product g

          where g.product_code=productInfo.product_code

            and g.updated_date > date '2015-07-01'

            and g.created_by not in ('BIS', 'PTP', 'pacard', 'admin')

            and g.created_by not in (select t.um_code from t_ptp_agent_account_info t)

            and rownum = 1),0,'N','Y') into flag from dual;

         DBMS_OUTPUT.PUT_LINE(productInfo.product_code ||','|| flag); 

 end loop;

end;

/

你可能感兴趣的:(oracle,如何)