函数:
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;