"Alex Naumenko" <alexn (AT) esna (DOT) com> wrote
Quote:
Hi,
Does ASA 9.0.2 has a standard way (like some command or internal stored
procedure) to write to a file (append to existing one) from the code in
stored procedure or trigger?
Or the only way is to write DLL and call it from SP or trigger?
Thanks,
Alex. |
Hello, please take a look at the xp_write_file procedure (I use it
requently). But please note that DBA authority is required. Also, this
procedure saves onto the disk, where the database's dbsrv9.exe is running
from (that means, if you are connected to database server with a client from
a remote machine, the procedure will save on the server's disk).
There's almost no way to append to a file from within a stored procedure.
OUTPUT statement is permitted. There are several workarounds though:
1. You could load the entire file (for example using xp_read_file), add
something and write it again
2. You can smartly use the UNLOAD SELECT statement to append something to a
file
Hope that helped.
Pavel