|
Sybernet / Supplied Procedures Reference
Release 3.00 JUL 23, 2006 |
|
The sprintf() function places output in consecutive bytes starting at the beginning BUF which is set to NULL upon entering this function. It is the user's responsibility to ensure that enough storage is available.
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 SPRINTF
(
@BUF VARCHAR(255) OUTPUT
, @FMT VARCHAR(255)
, ... VARCHAR(255)
) ;
| Parameter | Description |
|---|---|
buf |
Output buffer. |
fmt |
Format. |
... |
Zero or more parameters. |
The following block illustrates how to call sprintf:
declare
@buf varchar(30)
begin
exec http.dbo.sprintf @buf output,'%s\n','Hello World'
select @buf
end