Sybase Adaptive Server Anywhere Reference page 1005

Table of Contents

Advertisement

xp_write_file system procedure
Function
Syntax
Permissions
See also
Description
Example
Chapter 14 System Procedures and Functions
CREATE VARIABLE mystring CHAR(254) ;
xp_scanf( 'Hello World!', 'Hello %s', mystring )
Writes data to a file from a SQL statement.
[ variable = CALL ] xp_write_file ( filename , file_contents )
DBA authority required.
"xp_read_file system procedure" on page 985
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.
Consider a table
t1
that has the following columns:
A filename relative to the server.
filename
A LONG BINARY column holding an image.
picture
The following statement unloads the pictures into the named files:
SELECT xp_write_file( filename, picture)
FROM t1
987

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents