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

TEXT_IO.PUTF built-in procedure

This 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).

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 (for example, 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));

See also

About the TEXT_IO built-in package

TEXT_IO built-in package