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).
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]);
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. |
To format messages containing non-character substitutions, use the TO_CHAR function on the argument (see the example below).
/*
** 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));