Documentation Source Text

Check-in [1747b46fb5]
Login

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

Overview
Comment:Clarifications to core function documentation.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1747b46fb5c30c5e853af1081647b5db3f5bd82b
User & Date: drh 2009-02-02 02:15:01
Context
2009-02-02
13:04
Fix a typo on the homepage. check-in: b8436f59f5 user: drh tags: trunk
02:15
Clarifications to core function documentation. check-in: 1747b46fb5 user: drh tags: trunk
2009-01-30
02:25
Previous fix to althttpd.c contained bugs in the mimetype finder. This version has actually been tested on the website. check-in: 9e171b8ba5 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/lang.in.

1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
....
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
....
1494
1495
1496
1497
1498
1499
1500
1501
1502

1503
1504
1505
1506
1507
1508
1509
....
1520
1521
1522
1523
1524
1525
1526
1527

1528
1529
1530
1531
1532
1533
1534
....
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
  interface can
  be used to override this function and thereby change the operation
  of the [GLOB] operator.</td>
}

funcdef {ifnull(X,Y)} {} {
  Return a copy of the first non-NULL argument.  If
  both arguments are NULL then NULL is returned. This behaves the same as 
  [coalesce()].</td>
}

funcdef {hex(X)} {} {
  The argument is interpreted as a BLOB.  The result
  is a hexadecimal rendering of the content of that blob.
}

funcdef {last_insert_rowid()} {} {
  Return the [ROWID]
  of the last row insert from this
  connection to the database. 
  This is the same value that would be returned
  from the [sqlite3_last_insert_rowid()] API function.
}

funcdef {length(X)} {} {
  Return the string length of <i>X</i> in characters.
  If SQLite is configured to support UTF-8, then the number of UTF-8
  characters is returned, not the number of bytes.
}

funcdef {like(X,Y) like(X,Y,Z)} {} {
  This function is used to implement the "<b>Y LIKE X &#91;ESCAPE Z&#93;</b>"
  syntax of SQL. If the optional ESCAPE clause is present, then the
  user-function is invoked with three arguments. Otherwise, it is
  invoked with two arguments only. Note that the X and Y parameters are
................................................................................
  in the currently running SQL statement.  To load an extension that
  changes or deletes functions or collating sequences, use the
  [sqlite3_load_extension()] C-language API.</p>
}

funcdef {lower(X)} {} {
  Return a copy of string <i>X</i> with all ASCII characters
  converted to lower case.  The C library <b>tolower()</b> routine is used
  for the conversion, which means that this function might not
  work correctly on non-ASCII UTF-8 characters.
}

funcdef {ltrim(X) ltrim(X,Y)} {} {
  Return a string formed by removing any and all
  characters that appear in <i>Y</i> from the left side of <i>X</i>.
  If the <i>Y</i> argument is omitted, spaces are removed.
}

funcdef {max(X,Y,...)} {maxCoreFunc max} {
  Return the argument with the maximum value.  Arguments
  may be strings in addition to numbers.  The maximum value is determined
  by the usual sort order.  Note that <b>max()</b> is a simple function when
  it has 2 or more arguments but converts to an aggregate function if given
  only a single argument.
}

funcdef {min(X,Y,...)} {minCoreFunc min} {
  Return the argument with the minimum value.  Arguments
  may be strings in addition to numbers.  The minimum value is determined
  by the usual sort order.  Note that <b>min()</b> is a simple function when
  it has 2 or more arguments but converts to an aggregate function if given
  only a single argument.
}

funcdef {nullif(X,Y)} {} {
  Return the first argument if the arguments are different, 
  otherwise return NULL.
................................................................................
}

funcdef {quote(X)} {} {
  This routine returns a string which is the value of
  its argument suitable for inclusion into another SQL statement.
  Strings are surrounded by single-quotes with escapes on interior quotes
  as needed.  BLOBs are encoded as hexadecimal literals.
  The implementation of [VACUUM] uses this function. The function
  is also useful when writing triggers to implement undo/redo functionality.

}

funcdef {random()} {} {
  Return a pseudo-random integer
  between -9223372036854775808 and +9223372036854775807.
}

................................................................................
  lower(hex(randomblob(16)))
  </blockquote>
}

funcdef {replace(X,Y,Z)} {} {
  Return a string formed by substituting string <i>Z</i> for
  every occurrance of string <i>Y</i> in string <i>X</i>.  The [BINARY]
  collating sequence is used for comparisons.

}

funcdef {round(X) round(X,Y)} {} {
  Round off the number <i>X</i> to <i>Y</i> digits to the
  right of the decimal point.  If the <i>Y</i> argument is omitted, 0 is 
  assumed.
}
................................................................................
  Compute the soundex encoding of the string <i>X</i>.
  The string "?000" is returned if the argument is NULL.
  This function is omitted from SQLite by default.
  It is only available the -DSQLITE_SOUNDEX=1 compiler option
  is used when SQLite is built.
}

funcdef {sqlite_version(X)} {sqlite_version} {
  Return the version string for the SQLite library
  that is running.  Example:  "3.5.9"
}

funcdef {substr(X,Y,Z) substr(X,Y)} {} {
  Return a substring of input string <i>X</i> that begins
  with the <i>Y</i>-th character and which is <i>Z</i> characters long.







|
|




|











|
|
<







 







|
|
|









|
|
|





|
<
|







 







|
|
>







 







|
>







 







|







1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426

1427
1428
1429
1430
1431
1432
1433
....
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483

1484
1485
1486
1487
1488
1489
1490
1491
....
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
....
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
....
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
  interface can
  be used to override this function and thereby change the operation
  of the [GLOB] operator.</td>
}

funcdef {ifnull(X,Y)} {} {
  Return a copy of the first non-NULL argument.  If
  both arguments are NULL then NULL is returned. The ifnull() functions and
  [coalesce()] with two arguments are interchangeable.</td>
}

funcdef {hex(X)} {} {
  The argument is interpreted as a BLOB.  The result
  is a hexadecimal rendering of the content of that blob.  
}

funcdef {last_insert_rowid()} {} {
  Return the [ROWID]
  of the last row insert from this
  connection to the database. 
  This is the same value that would be returned
  from the [sqlite3_last_insert_rowid()] API function.
}

funcdef {length(X)} {} {
  Return the string length of <i>X</i> in characters if <i>X</i> is a string,
  or in bytes if <i>X</i> is a blob.

}

funcdef {like(X,Y) like(X,Y,Z)} {} {
  This function is used to implement the "<b>Y LIKE X &#91;ESCAPE Z&#93;</b>"
  syntax of SQL. If the optional ESCAPE clause is present, then the
  user-function is invoked with three arguments. Otherwise, it is
  invoked with two arguments only. Note that the X and Y parameters are
................................................................................
  in the currently running SQL statement.  To load an extension that
  changes or deletes functions or collating sequences, use the
  [sqlite3_load_extension()] C-language API.</p>
}

funcdef {lower(X)} {} {
  Return a copy of string <i>X</i> with all ASCII characters
  converted to lower case.  The default built-in lower() function works
  for ASCII characters only.  To do case conversions on non-ASCII
  characters, load the ICU extension.
}

funcdef {ltrim(X) ltrim(X,Y)} {} {
  Return a string formed by removing any and all
  characters that appear in <i>Y</i> from the left side of <i>X</i>.
  If the <i>Y</i> argument is omitted, spaces are removed.
}

funcdef {max(X,Y,...)} {maxCoreFunc max} {
  Return the argument with the maximum value.  Or return NULL if any argument
  is NULL.
  Note that <b>max()</b> is a simple function when
  it has 2 or more arguments but converts to an aggregate function if given
  only a single argument.
}

funcdef {min(X,Y,...)} {minCoreFunc min} {
  Return the argument with the minimum value. 

  Note that <b>min()</b> is a simple function when
  it has 2 or more arguments but converts to an aggregate function if given
  only a single argument.
}

funcdef {nullif(X,Y)} {} {
  Return the first argument if the arguments are different, 
  otherwise return NULL.
................................................................................
}

funcdef {quote(X)} {} {
  This routine returns a string which is the value of
  its argument suitable for inclusion into another SQL statement.
  Strings are surrounded by single-quotes with escapes on interior quotes
  as needed.  BLOBs are encoded as hexadecimal literals.
  SQLite uses this function internally in its implementation of [VACUUM]
  so if this function is overloading to provide incompatible behavior, the
  [VACUUM] command will likely cease to work.
}

funcdef {random()} {} {
  Return a pseudo-random integer
  between -9223372036854775808 and +9223372036854775807.
}

................................................................................
  lower(hex(randomblob(16)))
  </blockquote>
}

funcdef {replace(X,Y,Z)} {} {
  Return a string formed by substituting string <i>Z</i> for
  every occurrance of string <i>Y</i> in string <i>X</i>.  The [BINARY]
  collating sequence is used for comparisons.  If <i>Y</i> is an empty
  string then return <i>X</i> unchanged.
}

funcdef {round(X) round(X,Y)} {} {
  Round off the number <i>X</i> to <i>Y</i> digits to the
  right of the decimal point.  If the <i>Y</i> argument is omitted, 0 is 
  assumed.
}
................................................................................
  Compute the soundex encoding of the string <i>X</i>.
  The string "?000" is returned if the argument is NULL.
  This function is omitted from SQLite by default.
  It is only available the -DSQLITE_SOUNDEX=1 compiler option
  is used when SQLite is built.
}

funcdef {sqlite_version()} {sqlite_version} {
  Return the version string for the SQLite library
  that is running.  Example:  "3.5.9"
}

funcdef {substr(X,Y,Z) substr(X,Y)} {} {
  Return a substring of input string <i>X</i> that begins
  with the <i>Y</i>-th character and which is <i>Z</i> characters long.