I am running oracle and have a query which pulls some results from the database. I would like to write the results as a text file. How would I go about doing this?
If you are using PL/SQL then you can use the UTL_FILE package, the difference from using sql+ spool is that the files are written to the server file system. UTL_FILE has a number of limitations so an alternative on the server side would be to use Java stored procedures.