A script-enabled browser is required for this page to function properly.

TEXT_IO.Putf

Description

Formats and writes a message to an open file, or outputs the message to the Interpreter. You can embed up to five "%s" patterns within format (e.g., '%s %s %s'). The "%s" patterns are replaced with successive character arg values (e.g., `Check', `each', `value.'). "/n" patterns are replaced with newline characters (i.e., carriage returns).

Syntax


PROCEDURE Text_IO.Putf
   (arg    VARCHAR2);

PROCEDURE Text_IO.Putf
   (file   file_type,
    arg    VARCHAR2);

PROCEDURE Text_IO.Putf
   (file   file_type,
    format VARCHAR2,
   [arg1 [,..., arg5] VARCHAR2]);

PROCEDURE Text_IO.Putf
   (format VARCHAR2,
   [arg1 [,..., arg5] VARCHAR2]);

Parameters

Parameter Description
arg An argument that specifies the value to be displayed (e.g., character string, variable).
format Specifies the format of the message to be displayed.
file A variable that specifies an open file.

Usage Notes

To format messages containing non-character substitutions, use the TO_CHAR function on the argument (see the example below).

Example


 /*
** Write a line to the output file, using the
** TO_CHAR(SYSDATE) call to represent the substituted
** character variable.
*/
Text_IO.Putf(out_file,'Today is %s/n',
  TO_CHAR(SYSDATE));