|
Sybernet / Supplied Procedures Reference
Release 3.00 JUL 23, 2006 |
|
The printf() function places output on the standard output stream.
The format (FMT) is composed of zero or more directives: ordinary characters, which are simply copied to the output stream and conversion specifications, each of which results in the fetching of zero or more arguments. The results are undefined if there are insufficient arguments for the format. If the format is exhausted while arguments remain, the excess arguments are evaluated but are otherwise ignored.
Patterned after its C namesake, the reader should refer to its man page for further documentation.
Procedure PRINTF
(
@FMT VARCHAR(255)
, ... VARCHAR(255)
) ;
| Parameter | Description |
|---|---|
fmt |
Format. |
... |
Zero or more parameters. |
The following block illustrates how to call printf:
declare
@width varchar(30)
begin
select @width = '20'
exec http.dbo.printf '%*s\n', @width, 'Hello World'
end