I need to write the results of a query to a .csv file and ftp it from a stored procedure. The query part is no problem but I can't find anything on opening, writing to and ftp'ing the .csv file. Any ideas?
Software/Hardware used:
ASKED:
September 22, 2005 11:43 AM
UPDATED:
September 26, 2005 11:52 AM
What you really need is the ability to execute Operating System commands from PL/SQL. You can find useful code on this from AskTom on Oracle site or Metalink.
The particular implementation that I have uses Java store proc. This works well.
Sorry, I forgot to mention that I am using MS SQL Server.
You also forgot to mention what version of MS SQL Server you’re using, but start by looking into using BCP and format files in MSDN. BCP handles the opening and writing of the file; the format file defines it as a csv.
For the ftp part, go here http://www.sqlteam.com/item.asp?ItemID=6002