cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hello again, Can anybody tell me what the return values of system function xp_write_file() are (in SA12)? Documentation only says that "It returns 0 if successful, and non-zero if it fails." So what are those non-zero values and their meanings?

View Entire Topic
Former Member

I don't believe the lack of documentation is intentional. Here's a short summary:

  • if you do not have permission to execute xp_write_file(), the procedure returns -1 and an SQL error is generated (SQLCODE -121).
  • If there is a problem opening the file (an error was returned from the OS OPEN() call) then the procedure returns +1.