Contents Index xp_msver system procedure xp_sprintf system procedure

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

xp_read_file system procedure

Function 

Returns the contents of a file as a LONG BINARY variable.

Syntax 

variable = CALL ] xp_read_file ( filename )

Permissions 

DBA authority required

See also 

xp_write_file system procedure

Description 

The function reads the contents of the named file, and returns the result as a LONG BINARY value.

The filename is relative to the starting directory of the database server.

The function can be useful for inserting entire documents or images stored in files into tables. If the file cannot be read, the function returns NULL.

Example 

The following statement inserts an image into a column named picture of the table t1 (assuming all other columns can accept NULL):

INSERT INTO t1 ( picture)
SELECT xp_read_file( 'portrait.gif' )

Contents Index xp_msver system procedure xp_sprintf system procedure