Si te enredaste con el link anterior luego de leerlo puedes probar con este ejemplo:
you can write a procedure as follows
-------------------------------------------
create or replace procedure exportfile as
filename UTL_FILE.FILE_TYPE;
output varchar(10);
begin
filename:=UTL_FILE.FOPEN('HDOC','sample.csv','w',32767);
select ename||','||deptno||'\n' into output from emp where eno=100;
utl_file.putf(filename,output);
utl_file.fclose(filename);
exception
when no_data_found then
utl_file.fclose(filename);
when others then
dbms_output.put_line(sqlerrm);
utl_file.fclose_all;
end;
-----------------------------------------------
In the above procedure the data which have to be sent to different columns are separated by ',' which is included into the variable 'output' using '||' operator in the query statement.
the '\n' is added to mark the end of the row.
the procedure generates a csv file
for multiple rows you can use a cursor and run the putf() function in loop.