日期:2014-05-16 浏览次数:20446 次
create function getGuarantyInfo("BCSERIALNO" varchar(40)) Returns varchar(40) LANGUAGE SQL begin ATOMIC Declare sReturn varchar(10) Default ''; For v_cur as (select getItemName('GuarantyType',GuarantyType) as GuarantyType,GuarantorName as GuarantyName from GUARANTY_CONTRACT where SerialNo in (Select ObjectNo from Contract_RELATIVE where SerialNo=BCSERIALNO and ObjectType = 'GuarantyContract')) Do set sReturn=v_cur.GuarantyType||'-'||v_cur.GuarantyName||';'||sReturn; End for; return sReturn; end