Can any one tell me how can I writh to a local file (C:/my_file.txt) from a procedure. I need to create sql statments and store them in a file for later execution.
I need to do this into a LOCAL file so I don't think that I can use UTL_FILE, is there any way to spool from a proc to a file??? or any other way to do this???
Have you looked at DBMS_OUTPUT?
Assuming you are running your procedure from SQL*Plus,
you should be able to do what you want.
enter the following in SQL*Plus :
set serveroutput on
-- this is the buffer size for the text
-- you are going to output from your
-- procedure. make it bigger if you need to.
-- call your procedure...
-- turn off dbms_output
set serveroutput off;
in your procedure, you can spool text like this :
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.
Have u tried "text_io" package?
Click Here to Expand Forum to Full Width