如何将此代码转换为具有相同输出的函数?
declare
record_name employees%ROWTYPE;
begin
FOR record_name IN (SELECT (a.first_name || ' ' || a.last_name) complete_name,
b.DEPARTMENT_NAME complete_name2
FROM employees a , departments b
WHERE ROWNUM < 1000 and a.DEPARTMENT_ID=b.DEPARTMENT_ID)
LOOP
DBMS_OUTPUT.PUT_LINE('Employee name: ' || record_name.complete_name
||'DEPARTMENT name: '||record_name.complete_name2);
END LOOP;
END;