Sybase Adaptive Server Anywhere Reference page 1004

Table of Contents

Advertisement

System extended stored procedures
Example
xp_sprintf system procedure
Function
Syntax
Permissions
Description
Example
xp_scanf system procedure
Function
Syntax
Permissions
Description
Example
986
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.
The following statement inserts an image into a column named
table
t1
(assuming all other columns can accept NULL):
INSERT INTO t1 ( picture)
SELECT xp_read_file( 'portrait.gif' )
Builds up a string from a format string and a set of input strings.
[ variable = CALL ] xp_sprintf ( out-string ,
...
format-string
...
[ input-string , ... ] )
None.
xp_sprintf builds up a string from a format string and a set of input strings.
The format-string can contain up to fifty string placeholders (%s). These
placeholders are filled in by the input-string arguments.
All arguments must be strings of less than 254 characters.
The following statements put the string Hello World! into the variable
mystring.
CREATE VARIABLE mystring CHAR(254) ;
xp_sprintf( mystring, 'Hello %s', 'World!' )
Extracts substrings from an input string and a format string.
[ variable = CALL ] xp_scanf ( in-string ,
format-string
...
...
[ output-string , ... ] )
None.
xp_scanf extracts substrings from an input string and a format string. The
format-string can contain up to fifty string placeholders (%s). The values of
these placeholders are placed in the output-string variables.
All arguments must be strings of less than 254 characters.
The following statements put the string
mystring.
picture
into the variable
World!
of the

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents