Documentation Source Text

Check-in [9cbe2e4d08]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Documentation for the printf() SQL function.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9cbe2e4d08364a8796cd5ab7d4aad3b74c5e2179
User & Date: drh 2013-12-17 16:33:15.284
Context
2014-01-15
03:02
Clarify some sentences in the documentation on ANALYZE. (check-in: 5fc1073e06 user: drh tags: trunk)
2013-12-17
16:33
Documentation for the printf() SQL function. (check-in: 9cbe2e4d08 user: drh tags: trunk)
2013-12-16
21:42
When the request URI for static content contains extra path elements, report the error as 404 instead of 301. (check-in: 155df5701c user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to pages/changes.in.
15
16
17
18
19
20
21

22
23
24
25
26
27
28
proc chng {date desc {options {}}} {
  global nChng aChng
  set aChng($nChng) [list $date $desc $options]
  incr nChng
}

chng {2014-02-?? (3.8.3)} {

<li>Added [SQLITE_DETERMINISTIC] as an optional bit in the 4th argument to the
    [sqlite3_create_function()] and related interfaces, providing applications with
    the ability to create new functions that can be factored out of inner loops when
    they have constant arguments.
<li>Add [SQLITE_READONLY_DBMOVED] error code, returned at the beginning of a
    transaction, to indicate that the underlying database file has been renamed
    or moved out from under SQLite.







>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
proc chng {date desc {options {}}} {
  global nChng aChng
  set aChng($nChng) [list $date $desc $options]
  incr nChng
}

chng {2014-02-?? (3.8.3)} {
<li>Added the [printf()] SQL function.
<li>Added [SQLITE_DETERMINISTIC] as an optional bit in the 4th argument to the
    [sqlite3_create_function()] and related interfaces, providing applications with
    the ability to create new functions that can be factored out of inner loops when
    they have constant arguments.
<li>Add [SQLITE_READONLY_DBMOVED] error code, returned at the beginning of a
    transaction, to indicate that the underlying database file has been renamed
    or moved out from under SQLite.
Changes to pages/lang.in.
2273
2274
2275
2276
2277
2278
2279













2280
2281
2282
2283
2284
2285
2286
  ^The nullif(X,Y) function returns its first argument if the arguments are
  different and NULL if the arguments are the same.  ^The nullif(X,Y) function
  searches its arguments from left to right for an argument that defines a
  collating function and uses that collating function for all string
  comparisons.  ^If neither argument to nullif() defines a collating function
  then the BINARY is used.
}














funcdef {quote(X)} {} {
  ^The quote(X) function returns the text of an SQL literal which
  is the value of its argument suitable for inclusion into an SQL statement.
  ^Strings are surrounded by single-quotes with escapes on interior quotes
  as needed.  ^BLOBs are encoded as hexadecimal literals.
  ^Strings with embedded NUL characters cannot be represented as string







>
>
>
>
>
>
>
>
>
>
>
>
>







2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
  ^The nullif(X,Y) function returns its first argument if the arguments are
  different and NULL if the arguments are the same.  ^The nullif(X,Y) function
  searches its arguments from left to right for an argument that defines a
  collating function and uses that collating function for all string
  comparisons.  ^If neither argument to nullif() defines a collating function
  then the BINARY is used.
}

funcdef {printf(FORMAT,...)} {} {
  ^(The printf(FORMAT,...) SQL function works like the [sqlite3_mprintf()] C-language
  function and the printf() function from the standard C library.)^
  The first argument is a format string that specifies how to construct the output
  string using values taken from subsequent arguments.  ^If the FORMAT argument is
  missing or NULL then the result is NULL.  ^The %n format is silently ignored and
  does not consume an argument.  ^The %p format is an alias for %X.  ^The %z format
  is interchangable with %s.  ^(If there are too few arguments in the argument list,
  missing arguments are assumed to have a NULL value, which is translated into
  0 or 0.0 for numeric formats or an empty string for %s.)^
}
  

funcdef {quote(X)} {} {
  ^The quote(X) function returns the text of an SQL literal which
  is the value of its argument suitable for inclusion into an SQL statement.
  ^Strings are surrounded by single-quotes with escapes on interior quotes
  as needed.  ^BLOBs are encoded as hexadecimal literals.
  ^Strings with embedded NUL characters cannot be represented as string