TEXT_IO.PUTF
built-in procedureThis procedure 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
(for example, %s %s %s
). The %s
patterns are replaced with successive character arg
values
(for example, Check
, each
, value
). \n
patterns are replaced with newline characters (that is, 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 |
|
An argument that specifies the value to be displayed (for example, character string, variable). |
|
Specifies the format of the message to be displayed. |
|
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));
About the TEXT_IO
built-in package
Copyright © 1984, 2005, Oracle. All rights reserved.