日期:2014-05-16 浏览次数:20460 次
CREATE OR REPLACE FUNCTION F_OBTAIN_FTP_ATTRVALUE (apsi_record_id IN VARCHAR2) RETURN VARCHAR2 IS attributevalue VARCHAR2 (4000); CURSOR cur IS SELECT attribute_value FROM t_apsi_prod_attr_record WHERE apsi_prod_record_id = apsi_record_id AND attribute_value IS NOT NULL; BEGIN attributevalue := ' '; FOR c IN cur LOOP --if(attributevalue='') then -- dbms_output.put_line('none^^'); -- end if; --dbms_output.put_line('begin^^'||attributevalue); -- dbms_output.put_line('c.ATTRIBUTE_VALUE'||c.ATTRIBUTE_VALUE); IF (attributevalue = ' ') THEN attributevalue := c.attribute_value; DBMS_OUTPUT.put_line ('begin attributevalue^^' || attributevalue); ELSE attributevalue := attributevalue || '|' || c.attribute_value; DBMS_OUTPUT.put_line ('end attributevalue^^' || attributevalue); END IF; END LOOP; RETURN attributevalue; END;