function F_ReturnDescription(varID in varchar2) return varchar2 is numDataCount number(12); mytable ly_familyproperty%rowtype; begin select count(1) into numDataCount from ly_familyproperty t where t.id = varID; if numDataCount = 0 then return ''; end if; select * into mytable from ly_familyproperty where id = varID; /* 1:公積金;2:社保;3:企業所得稅繳納情況;4:工商登記情況;5:個人所得稅繳納情況; 6:非居住類房屋情況;7:機動車輛登記情況;8:其他財產 */ if mytable.propertype = '1' then return '月繳存額:' || mytable.MONEY || '元'; elsif mytable.propertype = '2' then return '月繳存額:' || mytable.MONEY || '元'; elsif mytable.propertype = '3' then return '月繳納基數:' || mytable.MONEY || '元'; elsif mytable.propertype = '4' then return '工商主體名稱:' || mytable.BUSINESS_TITLE || ';' || '登記時間:' || to_char(mytable.CHECK_TIME, 'yyyy-mm-dd') || ';' || '出資額:' || mytable.MONEY || '萬元'; elsif mytable.propertype = '5' then return '月繳納基數:' || mytable.MONEY || '元'; elsif mytable.propertype = '6' then return '房屋地址:' || mytable.ADDRESS || ';建築面積:' || mytable.BUILDAREA || ';發證時間:' || to_char(mytable.CHECK_TIME, 'yyyy-mm-dd') || ';產權證號:' || mytable.PRONUM; elsif mytable.propertype = '7' then return '品牌:' || mytable.brand || ';排量:' || mytable.EXHAUST_VOLUME || ';車輛使用性質:' || mytable.USE_NATURE || ';登記時間:' || to_char(mytable.CHECK_TIME, 'yyyy-mm-dd'); elsif mytable.propertype = '8' then return mytable.business_title; else return ''; end if; end F_ReturnDescription;