/ Check-in [d42c9636]
Login

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

Overview
Comment:Add documentation of the REPLACE, TRIM, LTRIM, and RTRIM functions. (CVS 3699)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d42c9636205a1a649cffcaeabff2b9b32016db31
User & Date: drh 2007-03-17 18:22:58
Context
2007-03-19
05:54
Add new OS file method to return the sector-size of the underlying storage: sqlite3OsSectorSize() (CVS 3700) check-in: 5752d84d user: danielk1977 tags: trunk
2007-03-17
18:22
Add documentation of the REPLACE, TRIM, LTRIM, and RTRIM functions. (CVS 3699) check-in: d42c9636 user: drh tags: trunk
17:52
Added TRIM, LTRIM, and RTRIM functions. (CVS 3698) check-in: 6fe13eea user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to www/lang.tcl.

     1      1   #
     2      2   # Run this Tcl script to generate the lang-*.html files.
     3      3   #
     4         -set rcsid {$Id: lang.tcl,v 1.125 2007/03/09 14:43:25 danielk1977 Exp $}
            4  +set rcsid {$Id: lang.tcl,v 1.126 2007/03/17 18:22:58 drh Exp $}
     5      5   source common.tcl
     6      6   
     7      7   if {[llength $argv]>0} {
     8      8     set outputdir [lindex $argv 0]
     9      9   } else {
    10     10     set outputdir ""
    11     11   }
................................................................................
  1311   1311   If SQLite is configured to support UTF-8, then the number of UTF-8
  1312   1312   characters is returned, not the number of bytes.</td>
  1313   1313   </tr>
  1314   1314   
  1315   1315   <tr>
  1316   1316   <td valign="top" align="right">
  1317   1317   <a name="likeFunc"></a>
  1318         -like(<i>X</i>,<i>Y</i> [,<i>Z</i>])</td>
         1318  +like(<i>X</i>,<i>Y</i>)<br>
         1319  +like(<i>X</i>,<i>Y</i>,<i>Z</i>)</td>
  1319   1320   <td valign="top">
  1320   1321   This function is used to implement the "<b>X LIKE Y [ESCAPE Z]</b>"
  1321   1322   syntax of SQL. If the optional ESCAPE clause is present, then the
  1322   1323   user-function is invoked with three arguments. Otherwise, it is
  1323   1324   invoked with two arguments only. The 
  1324   1325   <a href="capi3ref.html#sqlite3_create_function">
  1325   1326   sqlite_create_function()</a> interface can be used to override this
................................................................................
  1344   1345   <tr>
  1345   1346   <td valign="top" align="right">lower(<i>X</i>)</td>
  1346   1347   <td valign="top">Return a copy of string <i>X</i> will all characters
  1347   1348   converted to lower case.  The C library <b>tolower()</b> routine is used
  1348   1349   for the conversion, which means that this function might not
  1349   1350   work correctly on UTF-8 characters.</td>
  1350   1351   </tr>
         1352  +
         1353  +<tr>
         1354  +<td valign="top" align="right">
         1355  +<a name="ltrimFunc">
         1356  +ltrim(<i>X</i>)<br>ltrim(<i>X</i>,<i>Y</i>)</td>
         1357  +<td valign="top">Return a string formed by removing any and all
         1358  +characters that appear in <i>Y</i> from the left side of <i>X</i>.
         1359  +If the <i>Y</i> argument is omitted, spaces are removed.</td>
         1360  +</tr>
         1361  +
  1351   1362   
  1352   1363   <tr>
  1353   1364   <td valign="top" align="right">max(<i>X</i>,<i>Y</i>,...)</td>
  1354   1365   <td valign="top">Return the argument with the maximum value.  Arguments
  1355   1366   may be strings in addition to numbers.  The maximum value is determined
  1356   1367   by the usual sort order.  Note that <b>max()</b> is a simple function when
  1357   1368   it has 2 or more arguments but converts to an aggregate function if given
................................................................................
  1386   1397   
  1387   1398   <tr>
  1388   1399   <td valign="top" align="right">random(*)</td>
  1389   1400   <td valign="top">Return a pseudo-random integer
  1390   1401   between -9223372036854775808 and +9223372036854775807.</td>
  1391   1402   </tr>
  1392   1403   
         1404  +<tr>
         1405  +<td valign="top" align="right">
         1406  +<a name="replaceFunc">
         1407  +replace(<i>X</i>,<i>Y</i>,<i>Z</i>)</td>
         1408  +<td valign="top">Return a string formed by substituting string <i>Z</i> for
         1409  +every occurrance of string <i>Y</i> in string <i>X</i>.  The BINARY
         1410  +collating sequence is used for comparisons.</td>
         1411  +</tr>
         1412  +
  1393   1413   <tr>
  1394   1414   <td valign="top" align="right">
  1395   1415   <a name="randomblobFunc">
  1396   1416   randomblob(<i>N</i>)</td>
  1397   1417   <td valign="top">Return a <i>N</i>-byte blob containing pseudo-random bytes.
  1398   1418   <i>N</i> should be a postive integer.</td>
  1399   1419   </tr>
................................................................................
  1401   1421   <tr>
  1402   1422   <td valign="top" align="right">round(<i>X</i>)<br>round(<i>X</i>,<i>Y</i>)</td>
  1403   1423   <td valign="top">Round off the number <i>X</i> to <i>Y</i> digits to the
  1404   1424   right of the decimal point.  If the <i>Y</i> argument is omitted, 0 is 
  1405   1425   assumed.</td>
  1406   1426   </tr>
  1407   1427   
         1428  +<tr>
         1429  +<td valign="top" align="right">
         1430  +<a name="rtrimFunc">
         1431  +rtrim(<i>X</i>)<br>rtrim(<i>X</i>,<i>Y</i>)</td>
         1432  +<td valign="top">Return a string formed by removing any and all
         1433  +characters that appear in <i>Y</i> from the right side of <i>X</i>.
         1434  +If the <i>Y</i> argument is omitted, spaces are removed.</td>
         1435  +</tr>
         1436  +
  1408   1437   <tr>
  1409   1438   <td valign="top" align="right">soundex(<i>X</i>)</td>
  1410   1439   <td valign="top">Compute the soundex encoding of the string <i>X</i>.
  1411   1440   The string "?000" is returned if the argument is NULL.
  1412   1441   This function is omitted from SQLite by default.
  1413   1442   It is only available the -DSQLITE_SOUNDEX=1 compiler option
  1414   1443   is used when SQLite is built.</td>
................................................................................
  1425   1454   <td valign="top">Return a substring of input string <i>X</i> that begins
  1426   1455   with the <i>Y</i>-th character and which is <i>Z</i> characters long.
  1427   1456   The left-most character of <i>X</i> is number 1.  If <i>Y</i> is negative
  1428   1457   the the first character of the substring is found by counting from the
  1429   1458   right rather than the left.  If SQLite is configured to support UTF-8,
  1430   1459   then characters indices refer to actual UTF-8 characters, not bytes.</td>
  1431   1460   </tr>
         1461  +
         1462  +<tr>
         1463  +<td valign="top" align="right">
         1464  +<a name="trimFunc">
         1465  +trim(<i>X</i>)<br>trim(<i>X</i>,<i>Y</i>)</td>
         1466  +<td valign="top">Return a string formed by removing any and all
         1467  +characters that appear in <i>Y</i> from both ends of <i>X</i>.
         1468  +If the <i>Y</i> argument is omitted, spaces are removed.</td>
         1469  +</tr>
         1470  +
  1432   1471   
  1433   1472   <tr>
  1434   1473   <td valign="top" align="right">typeof(<i>X</i>)</td>
  1435   1474   <td valign="top">Return the type of the expression <i>X</i>.  The only 
  1436   1475   return values are "null", "integer", "real", "text", and "blob".
  1437   1476   SQLite's type handling is 
  1438   1477   explained in <a href="datatype3.html">Datatypes in SQLite Version 3</a>.</td>