EasyManua.ls Logo

Sybase Adaptive Server Anywhere - Page 1005

Sybase Adaptive Server Anywhere
1182 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 14 System Procedures and Functions
987
CREATE VARIABLE mystring CHAR(254) ;
xp_scanf( ’Hello World!’, ’Hello %s’, mystring )
xp_write_file system procedure
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:
filename A filename relative to the server.
picture A LONG BINARY column holding an image.
The following statement unloads the pictures into the named files:
SELECT xp_write_file( filename, picture)
FROM t1
Function
Syntax
Permissions
See also
Description
Example

Table of Contents

Related product manuals