thanks jdorlon, I know about dbms_output but I wanted to have a "cleaner" way of doing it, I want the user to just execute the procedure and a file will be writen.