happened to have one handy - this works for 9i only

CREATE DIRECTORY test_dir AS 'c:\temp';

CREATE OR REPLACE PROCEDURE test
AS
v_output_file1 utl_file.file_type;
BEGIN
/* Ensure TEST_DIR below is in all caps */
/* Third argument below is W which overwrites file each time, change to A to append */

v_output_file1 := utl_file.fopen('TEST_DIR', 'my_test.csv', 'W');
FOR cursor_emp IN (SELECT empnom,ename, deptno FROM emp)
LOOP
utl_file.put_line(v_output_file1, cursor_emp.empno || ',' || cursor_emp.ename || ',' || cursor_emp.deptno);
END LOOP;
utl_file.fclose_all;
END;
/