Contents Index xp_scanf system procedure Adaptive Server Enterprise system and catalog procedures

ASA SQL Reference
  System Procedures and Functions
    System extended stored procedures
      Other system extended stored procedures

xp_write_file system procedure

Function 

Writes data to a file from a SQL statement.

Syntax 

variable = CALL ] xp_write_file ( filenamefile_contents )

Permissions 

DBA authority required

See also 

xp_read_file system procedure

Description 

The function writes file_contents to the file filename. It returns 0 if successful, and non-zero if it fails.

The filename is relative to the current working directory of the database server. If the file already exists, its contents are overwritten.

This function can be useful for unloading long binary data into files.

Example 

Consider a table t1 that has the following columns:

The following statement unloads the pictures into the named files:

SELECT xp_write_file( filename, picture)
FROM t1

Contents Index xp_scanf system procedure Adaptive Server Enterprise system and catalog procedures