create or replace function test(Name in varchar2 ) return varchar2 is V_CONTAINERDESC varchar2( 8000 CHAR ); BEGIN FOR CUR1 IN (SELECT AREA ,ID FROM AREA where ID=Name or ID=176) LOOP V_CONTAINERDESC := V_CONTAINERDESC ||'你好'|| CUR1.AREA || '编号'||TO_CHAR(CUR1.ID); END LOOP; DBMS_OUTPUT.PUT_LINE(V_CONTAINERDESC); return V_CONTAINERDESC; end test;