`

包学习

 
阅读更多

包:

create or replace package MyTestPkg is

  -- Author  : WANGTL
  -- Created : 2011-9-15 13:47:06
  -- Purpose : forTest
  -- Public function and procedure declarations
--  function < FunctionName > (< Parameter > < Datatype >) return < Datatype >;
 function getCustNameCode(v_custId in cm_customer.cust_id%type)
    return varchar2 ;
end MyTestPkg;
/
create or replace package body MyTestPkg is
  function getCustNameCode(v_custId in cm_customer.cust_id%type)
    return varchar2 is
    Result varchar2(100);
  begin
    select t.cust_code || ' ' || t.cust_name
      into Result
      from so1.cm_customer t
     where t.cust_id = v_custId;
    return(Result);
  end getCustNameCode;

end MyTestPkg;
/

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics