`

函数学习

 
阅读更多

函数:

create or replace function MyFun1(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 MyFun1;
--函数调用
--select t.cust_id,t.cust_code,t.cust_name,getCustNameCode(t.cust_id) from so1.cm_customer t
--select getCustNameCode(89101110014395) from dual;

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics