Documentation Source Text

Check-in [86e05fde50]
Login

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

Overview
Comment:Clarification to the order of arguments in like() and glob().
Timelines: family | ancestors | descendants | both | branch-3.25
Files: files | file ages | folders
SHA3-256: 86e05fde50fbab3798dd2f4cec510f0872a35cfdc72ce08f99f258969c3254bd
User & Date: drh 2018-09-25 19:28:49
Context
2018-09-25
19:32
Version 3.25.2 check-in: 8c31c0cd8c user: drh tags: release, version-3.25.2, branch-3.25
19:28
Clarification to the order of arguments in like() and glob(). check-in: 86e05fde50 user: drh tags: branch-3.25
19:28
Update the sha3 sum for sqlite3.c for version 3.25.2. check-in: 31377cc26a user: dan tags: branch-3.25
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/lang.in.

2442
2443
2444
2445
2446
2447
2448
2449





2450
2451
2452
2453
2454
2455
2456
2457
....
2498
2499
2500
2501
2502
2503
2504






2505
2506
2507
2508
2509
2510
2511
  2 arguments.
}

funcdef {glob(X,Y)} {} {
  ^The glob(X,Y) function is equivalent to the
  expression "<b>Y GLOB X</b>".
  Note that the X and Y arguments are reversed in the glob() function
  relative to the infix [GLOB] operator.





  ^If the [sqlite3_create_function()] interface is used to
  override the glob(X,Y) function with an alternative implementation then
  the [GLOB] operator will invoke the alternative implementation.
}

funcdef {ifnull(X,Y)} {} {
  ^The ifnull() function returns a copy of its first non-NULL argument, or
  NULL if both arguments are NULL.  ^Ifnull() must have exactly 2 arguments.
................................................................................
funcdef {like(X,Y) like(X,Y,Z)} {} {
  ^The like() function is used to implement the
  "<b>Y LIKE X &#91;ESCAPE Z&#93;</b>" expression. 
  ^If the optional ESCAPE clause is present, then the
  like() function is invoked with three arguments.  ^Otherwise, it is
  invoked with two arguments only. Note that the X and Y parameters are
  reversed in the like() function relative to the infix [LIKE] operator.






  ^The [sqlite3_create_function()] interface can be used to override the
  like() function and thereby change the operation of the
  [LIKE] operator.  When overriding the like() function, it may be important
  to override both the two and three argument versions of the like() 
  function. Otherwise, different code may be called to implement the
  [LIKE] operator depending on whether or not an ESCAPE clause was 
  specified.







|
>
>
>
>
>
|







 







>
>
>
>
>
>







2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
....
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
  2 arguments.
}

funcdef {glob(X,Y)} {} {
  ^The glob(X,Y) function is equivalent to the
  expression "<b>Y GLOB X</b>".
  Note that the X and Y arguments are reversed in the glob() function
  relative to the infix [GLOB] operator.  Y is the string and X is the
  pattern.  So, for example, the following expressions are equivalent:
  <blockquote><pre>
     name LIKE '*helium*'
     glob('*helium*',name)
  </pre></blockquote>
  <p>^If the [sqlite3_create_function()] interface is used to
  override the glob(X,Y) function with an alternative implementation then
  the [GLOB] operator will invoke the alternative implementation.
}

funcdef {ifnull(X,Y)} {} {
  ^The ifnull() function returns a copy of its first non-NULL argument, or
  NULL if both arguments are NULL.  ^Ifnull() must have exactly 2 arguments.
................................................................................
funcdef {like(X,Y) like(X,Y,Z)} {} {
  ^The like() function is used to implement the
  "<b>Y LIKE X &#91;ESCAPE Z&#93;</b>" expression. 
  ^If the optional ESCAPE clause is present, then the
  like() function is invoked with three arguments.  ^Otherwise, it is
  invoked with two arguments only. Note that the X and Y parameters are
  reversed in the like() function relative to the infix [LIKE] operator.
  X is the pattern and Y is the string to match against that pattern.
  Hence, the following expressions are equivalent:
  <blockquote><pre>
     name LIKE '%neon%'
     like('%neon%',name)
  </pre></blockquote>
  ^The [sqlite3_create_function()] interface can be used to override the
  like() function and thereby change the operation of the
  [LIKE] operator.  When overriding the like() function, it may be important
  to override both the two and three argument versions of the like() 
  function. Otherwise, different code may be called to implement the
  [LIKE] operator depending on whether or not an ESCAPE clause was 
  specified.