xp_sprintf system procedure

Builds a result string from a set of input strings.

Syntax
xp_sprintf(
  output_buffer,
  format,
  parm [, parm2, ... ]
)
Arguments
  • output_buffer   Use this CHAR(254) parameter to specify the output buffer containing the result string.

  • format   Use this CHAR(254) parameter to specify how to format the result string, using placeholders (%s) for each parm argument. There can be up to fifty placeholders in the format argument, and there should be the same number of placeholders as parm arguments.

  • parm   These are the input strings that are used in the result string. You can specify up to 50 of these CHAR(254) arguments.

Remarks

The xp_sprintf system procedure builds up a string using the format argument and the parm argument(s), and puts the results in output_buffer.

Permissions

None

See also
Example

The following statements put the string Hello World! into the result variable.

CREATE VARIABLE result CHAR(254);
Call xp_sprintf( result, '%s %s', 'Hello', 'World!' );