Hex Artifact Content
Not logged in

Artifact e1c545c9f929105391de823d15f0fd338741fcc0:

Wiki page [SQL Log] by sandro 2014-08-27 12:44:29.
0000: 44 20 32 30 31 34 2d 30 38 2d 32 37 54 31 32 3a  D 2014-08-27T12:
0010: 34 34 3a 32 39 2e 30 31 32 0a 4c 20 53 51 4c 5c  44:29.012.L SQL\
0020: 73 4c 6f 67 0a 50 20 61 35 62 34 64 33 64 65 62  sLog.P a5b4d3deb
0030: 38 30 32 34 62 36 33 62 30 34 31 30 30 64 38 37  8024b63b04100d87
0040: 66 61 35 35 66 62 38 66 33 32 34 35 64 33 31 0a  fa55fb8f3245d31.
0050: 55 20 73 61 6e 64 72 6f 0a 57 20 34 30 32 34 0a  U sandro.W 4024.
0060: 3c 68 32 3e 53 51 4c 20 53 74 61 74 65 6d 65 6e  <h2>SQL Statemen
0070: 74 73 20 4c 6f 67 20 61 73 20 69 6d 70 6c 65 6d  ts Log as implem
0080: 65 6e 74 65 64 20 69 6e 20 76 65 72 73 69 6f 6e  ented in version
0090: 20 34 2e 30 2e 30 3c 2f 68 32 3e 0d 0a 3c 61 20   4.0.0</h2>..<a 
00a0: 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77  href="https://ww
00b0: 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 66 6f  w.gaia-gis.it/fo
00c0: 73 73 69 6c 2f 6c 69 62 73 70 61 74 69 61 6c 69  ssil/libspatiali
00d0: 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 34 2e 32  te/wiki?name=4.2
00e0: 2e 30 2d 64 6f 63 22 3e 62 61 63 6b 3c 2f 61 3e  .0-doc">back</a>
00f0: 0d 0a 3c 68 33 3e 54 68 65 20 22 3c 69 3e 73 71  ..<h3>The "<i>sq
0100: 6c 5f 73 74 61 74 65 6d 65 6e 74 73 5f 6c 6f 67  l_statements_log
0110: 3c 2f 69 3e 22 20 74 61 62 6c 65 3c 2f 68 33 3e  </i>" table</h3>
0120: 0d 0a 54 68 69 73 20 6e 65 77 20 74 61 62 6c 65  ..This new table
0130: 20 77 69 6c 6c 20 62 65 20 61 75 74 6f 6d 61 74   will be automat
0140: 69 63 61 6c 6c 79 20 63 72 65 61 74 65 64 20 69  ically created i
0150: 6e 20 61 6e 79 20 6e 65 77 20 44 42 20 70 72 69  n any new DB pri
0160: 6d 65 64 20 75 73 69 6e 67 20 3c 69 3e 6c 69 62  med using <i>lib
0170: 73 70 61 74 69 61 6c 69 74 65 3c 2f 69 3e 20 76  spatialite</i> v
0180: 65 72 73 69 6f 6e 20 34 2e 30 2e 30 2c 20 61 6e  ersion 4.0.0, an
0190: 64 20 74 68 65 20 69 6e 74 65 6e 64 65 64 20 73  d the intended s
01a0: 63 6f 70 65 20 69 73 20 73 75 70 70 6f 72 74 69  cope is supporti
01b0: 6e 67 20 74 68 65 20 6e 65 77 20 3c 62 3e 53 51  ng the new <b>SQ
01c0: 4c 20 4c 6f 67 3c 2f 62 3e 20 66 61 63 69 6c 69  L Log</b> facili
01d0: 74 79 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 69 3e  ty.<br><br>..<i>
01e0: 6c 69 62 73 70 61 74 69 61 6c 69 74 65 3c 2f 69  libspatialite</i
01f0: 3e 20 76 65 72 73 69 6f 6e 20 34 2e 30 2e 30 20  > version 4.0.0 
0200: 6e 6f 77 20 69 6e 63 6c 75 64 65 73 20 74 77 6f  now includes two
0210: 20 41 50 49 73 20 64 69 72 65 63 74 6c 79 20 73   APIs directly s
0220: 75 70 70 6f 72 74 69 6e 67 20 74 68 65 20 53 51  upporting the SQ
0230: 4c 20 4c 6f 67 3a 20 3c 69 3e 3c 62 3e 67 61 69  L Log: <i><b>gai
0240: 61 49 6e 73 65 72 74 49 6e 74 6f 53 71 6c 4c 6f  aInsertIntoSqlLo
0250: 67 28 29 3c 2f 62 3e 3c 2f 69 3e 20 61 6e 64 20  g()</b></i> and 
0260: 3c 69 3e 3c 62 3e 67 61 69 61 55 70 64 61 74 65  <i><b>gaiaUpdate
0270: 53 71 6c 4c 6f 67 28 29 3c 2f 62 3e 3c 2f 69 3e  SqlLog()</b></i>
0280: 2e 3c 62 72 3e 0d 0a 42 6f 74 68 20 3c 62 3e 73  .<br>..Both <b>s
0290: 70 61 74 69 61 6c 69 74 65 5f 67 75 69 3c 2f 62  patialite_gui</b
02a0: 3e 20 61 6e 64 20 3c 62 3e 73 70 61 74 69 61 6c  > and <b>spatial
02b0: 69 74 65 20 43 4c 49 3c 2f 62 3e 20 74 6f 6f 6c  ite CLI</b> tool
02c0: 73 20 6e 6f 77 20 66 75 6c 6c 79 20 73 75 70 70  s now fully supp
02d0: 6f 72 74 20 74 68 65 20 53 51 4c 20 4c 6f 67 20  ort the SQL Log 
02e0: 66 61 63 69 6c 69 74 79 3b 20 61 6e 64 20 72 61  facility; and ra
02f0: 74 68 65 72 20 6f 62 76 69 6f 75 73 6c 79 20 61  ther obviously a
0300: 6e 79 20 74 68 69 72 64 20 70 61 72 74 79 20 74  ny third party t
0310: 6f 6f 6c 20 69 73 20 77 65 6c 63 6f 6d 65 20 69  ool is welcome i
0320: 6e 20 65 78 70 6c 6f 69 74 69 6e 67 20 74 68 69  n exploiting thi
0330: 73 20 63 6f 6f 6c 20 6e 65 77 20 66 65 61 74 75  s cool new featu
0340: 72 65 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 54 68 65  re.<br><br>..The
0350: 20 66 6f 6c 6c 6f 77 69 6e 67 20 65 78 61 6d 70   following examp
0360: 6c 65 20 65 78 70 6c 61 69 6e 73 20 68 6f 77 20  le explains how 
0370: 61 6c 6c 20 74 68 69 73 20 70 72 61 63 74 69 63  all this practic
0380: 61 6c 6c 79 20 77 6f 72 6b 73 2e 3c 62 72 3e 3c  ally works.<br><
0390: 62 72 3e 0d 0a 3c 74 61 62 6c 65 20 77 69 64 74  br>..<table widt
03a0: 68 3d 22 31 30 30 25 22 20 62 67 63 6f 6c 6f 72  h="100%" bgcolor
03b0: 3d 22 23 66 34 66 34 66 34 22 20 62 6f 72 64 65  ="#f4f4f4" borde
03c0: 72 3d 22 31 22 20 63 65 6c 6c 73 70 61 63 69 6e  r="1" cellspacin
03d0: 67 3d 22 34 22 20 63 65 6c 6c 70 61 64 64 69 6e  g="4" cellpaddin
03e0: 67 3d 22 34 22 3e 3c 74 72 3e 0d 0a 3c 74 64 20  g="4"><tr>..<td 
03f0: 62 67 63 6f 6c 6f 72 3d 22 23 65 38 65 38 65 38  bgcolor="#e8e8e8
0400: 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22  " align="center"
0410: 3e 3c 62 3e 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d  ><b>id</b></td>.
0420: 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 65  .<td bgcolor="#e
0430: 38 65 38 65 38 22 20 61 6c 69 67 6e 3d 22 63 65  8e8e8" align="ce
0440: 6e 74 65 72 22 3e 3c 62 3e 74 69 6d 65 5f 73 74  nter"><b>time_st
0450: 61 72 74 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74  art</b></td>..<t
0460: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 65 38 65 38  d bgcolor="#e8e8
0470: 65 38 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65  e8" align="cente
0480: 72 22 3e 3c 62 3e 74 69 6d 65 5f 65 6e 64 3c 2f  r"><b>time_end</
0490: 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63  b></td>..<td bgc
04a0: 6f 6c 6f 72 3d 22 23 65 38 65 38 65 38 22 20 61  olor="#e8e8e8" a
04b0: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62  lign="center"><b
04c0: 3e 75 73 65 72 5f 61 67 65 6e 74 3c 2f 62 3e 3c  >user_agent</b><
04d0: 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f  /td>..<td bgcolo
04e0: 72 3d 22 23 65 38 65 38 65 38 22 20 61 6c 69 67  r="#e8e8e8" alig
04f0: 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62 3e 73 71  n="center"><b>sq
0500: 6c 5f 73 74 61 74 65 6d 65 6e 74 3c 2f 62 3e 3c  l_statement</b><
0510: 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f  /td>..<td bgcolo
0520: 72 3d 22 23 65 38 65 38 65 38 22 20 61 6c 69 67  r="#e8e8e8" alig
0530: 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62 3e 73 75  n="center"><b>su
0540: 63 63 65 73 73 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a  ccess</b></td>..
0550: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 65 38  <td bgcolor="#e8
0560: 65 38 65 38 22 20 61 6c 69 67 6e 3d 22 63 65 6e  e8e8" align="cen
0570: 74 65 72 22 3e 3c 62 3e 65 72 72 6f 72 5f 63 61  ter"><b>error_ca
0580: 75 73 65 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72  use</b></td></tr
0590: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e  >..<tr><td align
05a0: 3d 22 72 69 67 68 74 22 3e 31 38 3c 2f 74 64 3e  ="right">18</td>
05b0: 3c 74 64 3e 32 30 31 32 2d 30 39 2d 30 34 54 32  <td>2012-09-04T2
05c0: 32 3a 32 36 3a 30 33 2e 35 34 35 5a 3c 2f 74 64  2:26:03.545Z</td
05d0: 3e 09 3c 74 64 3e 32 30 31 32 2d 30 39 2d 30 34  >.<td>2012-09-04
05e0: 54 32 32 3a 32 36 3a 30 33 2e 36 39 32 5a 3c 2f  T22:26:03.692Z</
05f0: 74 64 3e 3c 74 64 3e 73 70 61 74 69 61 6c 69 74  td><td>spatialit
0600: 65 20 43 4c 49 3c 2f 74 64 3e 3c 74 64 3e 0d 0a  e CLI</td><td>..
0610: 53 45 4c 45 43 54 20 72 2e 6e 6f 6d 65 5f 72 65  SELECT r.nome_re
0620: 67 2c 20 70 2e 6e 6f 6d 65 5f 70 72 6f 2c 20 63  g, p.nome_pro, c
0630: 2e 6e 6f 6d 65 5f 63 6f 6d 3c 62 72 3e 0d 0a 46  .nome_com<br>..F
0640: 52 4f 4d 20 63 6f 6d 32 30 31 31 20 41 53 20 63  ROM com2011 AS c
0650: 3c 62 72 3e 0d 0a 4a 4f 49 4e 20 70 72 6f 76 32  <br>..JOIN prov2
0660: 30 31 31 20 41 53 20 70 20 4f 4e 20 28 63 2e 63  011 AS p ON (c.c
0670: 6f 64 5f 70 72 6f 20 3d 20 70 2e 63 6f 64 5f 70  od_pro = p.cod_p
0680: 72 6f 29 3c 62 72 3e 0d 0a 4a 4f 49 4e 20 72 65  ro)<br>..JOIN re
0690: 67 32 30 31 31 20 41 53 20 72 20 4f 4e 20 28 63  g2011 AS r ON (c
06a0: 2e 63 6f 64 5f 72 65 67 20 3d 20 72 2e 63 6f 64  .cod_reg = r.cod
06b0: 5f 72 65 67 29 3c 62 72 3e 0d 0a 57 48 45 52 45  _reg)<br>..WHERE
06c0: 20 63 2e 63 6f 64 5f 72 65 67 20 3d 20 31 30 3c   c.cod_reg = 10<
06d0: 62 72 3e 0d 0a 4f 52 44 45 52 20 42 59 20 63 2e  br>..ORDER BY c.
06e0: 6e 6f 6d 65 5f 70 72 6f 2c 20 63 2e 6e 6f 6d 65  nome_pro, c.nome
06f0: 5f 63 6f 6d 3b 3c 2f 74 64 3e 3c 74 64 20 61 6c  _com;</td><td al
0700: 69 67 6e 3d 22 72 69 67 68 74 22 3e 30 3c 2f 74  ign="right">0</t
0710: 64 3e 3c 74 64 3e 6e 6f 20 73 75 63 68 20 63 6f  d><td>no such co
0720: 6c 75 6d 6e 3a 20 63 2e 6e 6f 6d 65 5f 70 72 6f  lumn: c.nome_pro
0730: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e  </td></tr>..<tr>
0740: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
0750: 22 3e 31 39 3c 2f 74 64 3e 3c 74 64 3e 32 30 31  ">19</td><td>201
0760: 32 2d 30 39 2d 30 34 54 32 32 3a 32 36 3a 31 33  2-09-04T22:26:13
0770: 2e 35 36 32 5a 3c 2f 74 64 3e 09 3c 74 64 3e 32  .562Z</td>.<td>2
0780: 30 31 32 2d 30 39 2d 30 34 54 32 32 3a 32 36 3a  012-09-04T22:26:
0790: 31 33 2e 37 33 37 5a 3c 2f 74 64 3e 3c 74 64 3e  13.737Z</td><td>
07a0: 73 70 61 74 69 61 6c 69 74 65 20 43 4c 49 3c 2f  spatialite CLI</
07b0: 74 64 3e 3c 74 64 3e 0d 0a 53 45 4c 45 43 54 20  td><td>..SELECT 
07c0: 72 2e 6e 6f 6d 65 5f 72 65 67 2c 20 70 2e 6e 6f  r.nome_reg, p.no
07d0: 6d 65 5f 70 72 6f 2c 20 63 2e 6e 6f 6d 65 5f 63  me_pro, c.nome_c
07e0: 6f 6d 3c 62 72 3e 0d 0a 46 52 4f 4d 20 63 6f 6d  om<br>..FROM com
07f0: 32 30 31 31 20 41 53 20 63 3c 62 72 3e 0d 0a 4a  2011 AS c<br>..J
0800: 4f 49 4e 20 70 72 6f 76 32 30 31 31 20 41 53 20  OIN prov2011 AS 
0810: 70 20 4f 4e 20 28 63 2e 63 6f 64 5f 70 72 6f 20  p ON (c.cod_pro 
0820: 3d 20 70 2e 63 6f 64 5f 70 72 6f 29 3c 62 72 3e  = p.cod_pro)<br>
0830: 0d 0a 4a 4f 49 4e 20 72 65 67 32 30 31 31 20 41  ..JOIN reg2011 A
0840: 53 20 72 20 4f 4e 20 28 63 2e 63 6f 64 5f 72 65  S r ON (c.cod_re
0850: 67 20 3d 20 72 2e 63 6f 64 5f 72 65 67 29 3c 62  g = r.cod_reg)<b
0860: 72 3e 0d 0a 57 48 45 52 45 20 63 2e 63 6f 64 5f  r>..WHERE c.cod_
0870: 72 65 67 20 3d 20 31 30 3c 62 72 3e 0d 0a 4f 52  reg = 10<br>..OR
0880: 44 45 52 20 42 59 20 70 2e 6e 6f 6d 65 5f 70 72  DER BY p.nome_pr
0890: 6f 2c 20 63 2e 6e 6f 6d 65 5f 63 6f 6d 3b 3c 2f  o, c.nome_com;</
08a0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69  td><td align="ri
08b0: 67 68 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 3e 73  ght">1</td><td>s
08c0: 75 63 63 65 73 73 3c 2f 74 64 3e 3c 2f 74 72 3e  uccess</td></tr>
08d0: 0d 0a 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d  ..<tr><td align=
08e0: 22 72 69 67 68 74 22 3e 32 30 3c 2f 74 64 3e 3c  "right">20</td><
08f0: 74 64 3e 32 30 31 32 2d 30 39 2d 30 34 54 32 32  td>2012-09-04T22
0900: 3a 32 37 3a 30 33 2e 31 39 39 5a 3c 2f 74 64 3e  :27:03.199Z</td>
0910: 09 3c 74 64 3e 32 30 31 32 2d 30 39 2d 30 34 54  .<td>2012-09-04T
0920: 32 32 3a 32 37 3a 30 33 2e 33 37 30 5a 3c 2f 74  22:27:03.370Z</t
0930: 64 3e 3c 74 64 3e 73 70 61 74 69 61 6c 69 74 65  d><td>spatialite
0940: 5f 67 75 69 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 53  _gui</td><td>..S
0950: 45 4c 45 43 54 20 72 2e 6e 6f 6d 65 5f 72 65 67  ELECT r.nome_reg
0960: 2c 20 70 2e 6e 6f 6d 65 5f 70 72 6f 2c 20 63 2e  , p.nome_pro, c.
0970: 6e 6f 6d 65 5f 63 6f 6d 3c 62 72 3e 0d 0a 46 52  nome_com<br>..FR
0980: 4f 4d 20 63 6f 6d 32 30 31 31 20 41 53 20 63 3c  OM com2011 AS c<
0990: 62 72 3e 0d 0a 4a 4f 49 4e 20 70 72 6f 76 32 30  br>..JOIN prov20
09a0: 31 31 20 41 53 20 70 20 4f 4e 20 28 63 2e 63 6f  11 AS p ON (c.co
09b0: 64 5f 70 72 6f 20 3d 20 70 2e 63 6f 64 5f 70 72  d_pro = p.cod_pr
09c0: 6f 29 3c 62 72 3e 0d 0a 4a 4f 49 4e 20 72 65 67  o)<br>..JOIN reg
09d0: 32 30 31 31 20 41 53 20 72 20 4f 4e 20 28 63 2e  2011 AS r ON (c.
09e0: 63 6f 64 5f 72 65 67 20 3d 20 72 2e 63 6f 64 5f  cod_reg = r.cod_
09f0: 72 65 67 29 3c 62 72 3e 0d 0a 57 48 45 52 45 20  reg)<br>..WHERE 
0a00: 63 2e 63 6f 64 5f 72 65 67 20 3d 20 39 3c 62 72  c.cod_reg = 9<br
0a10: 3e 0d 0a 4f 52 44 45 52 20 42 59 20 63 2e 6e 6f  >..ORDER BY c.no
0a20: 6d 65 5f 63 6f 6d 20 44 45 53 43 3c 2f 74 64 3e  me_com DESC</td>
0a30: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
0a40: 22 3e 31 3c 2f 74 64 3e 3c 74 64 3e 73 75 63 63  ">1</td><td>succ
0a50: 65 73 73 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c  ess</td></tr>..<
0a60: 2f 74 61 62 6c 65 3e 3c 62 72 3e 0d 0a 3c 75 6c  /table><br>..<ul
0a70: 3e 0d 0a 3c 6c 69 3e 74 68 65 20 3c 62 3e 69 64  >..<li>the <b>id
0a80: 3c 2f 62 3e 20 63 6f 6c 75 6d 6e 20 69 73 20 74  </b> column is t
0a90: 68 65 20 3c 75 3e 65 76 65 6e 74 20 49 44 3c 2f  he <u>event ID</
0aa0: 75 3e 20 28 3c 69 3e 50 72 69 6d 61 72 79 20 4b  u> (<i>Primary K
0ab0: 65 79 3c 2f 69 3e 2c 20 75 6e 69 71 75 65 6c 79  ey</i>, uniquely
0ac0: 20 69 64 65 6e 74 69 66 79 69 6e 67 20 65 61 63   identifying eac
0ad0: 68 20 73 69 6e 67 6c 65 20 53 51 4c 20 53 74 61  h single SQL Sta
0ae0: 74 65 6d 65 6e 74 20 69 6e 74 6f 20 74 68 65 20  tement into the 
0af0: 4c 6f 67 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  Log).</li>..<li>
0b00: 74 68 65 20 3c 62 3e 74 69 6d 65 5f 73 74 61 72  the <b>time_star
0b10: 74 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 74 69 6d  t</b> and <b>tim
0b20: 65 5f 65 6e 64 3c 2f 62 3e 20 63 6f 6c 75 6d 6e  e_end</b> column
0b30: 73 20 63 6f 6e 74 61 69 74 73 20 74 68 65 20 3c  s contaits the <
0b40: 69 3e 74 69 6d 65 73 74 61 6d 70 73 3c 2f 69 3e  i>timestamps</i>
0b50: 20 6d 65 61 73 75 72 65 64 20 69 6d 6d 65 64 69   measured immedi
0b60: 61 74 65 6c 79 20 62 65 66 6f 72 65 20 61 6e 64  ately before and
0b70: 20 61 66 74 65 72 20 65 78 65 63 75 74 69 6e 67   after executing
0b80: 20 74 68 65 20 53 51 4c 20 73 74 61 74 65 6d 65   the SQL stateme
0b90: 6e 74 20 69 74 73 65 6c 66 2e 3c 2f 6c 69 3e 0d  nt itself.</li>.
0ba0: 0a 3c 6c 69 3e 74 68 65 20 3c 62 3e 75 73 65 72  .<li>the <b>user
0bb0: 5f 61 67 65 6e 74 3c 2f 62 3e 20 63 6f 6c 75 6d  _agent</b> colum
0bc0: 6e 20 69 64 65 6e 74 69 66 79 20 74 68 65 20 74  n identify the t
0bd0: 6f 6f 6c 20 62 65 69 6e 67 20 75 73 65 64 20 74  ool being used t
0be0: 6f 20 65 78 65 63 75 74 65 64 20 74 68 65 20 53  o executed the S
0bf0: 51 4c 20 73 74 61 74 65 6d 65 6e 74 2e 3c 2f 6c  QL statement.</l
0c00: 69 3e 0d 0a 3c 6c 69 3e 74 68 65 20 3c 62 3e 73  i>..<li>the <b>s
0c10: 71 6c 5f 73 74 61 74 65 6d 65 6e 74 3c 2f 62 3e  ql_statement</b>
0c20: 20 63 6f 6c 75 6d 6e 20 63 6f 6e 74 61 69 6e 73   column contains
0c30: 20 74 68 65 20 53 51 4c 20 73 74 61 74 65 6d 65   the SQL stateme
0c40: 6e 74 20 62 6f 64 79 2e 3c 2f 6c 69 3e 0d 0a 3c  nt body.</li>..<
0c50: 6c 69 3e 74 68 65 20 3c 62 3e 73 75 63 63 65 73  li>the <b>succes
0c60: 73 3c 2f 62 3e 20 63 6f 6c 75 6d 6e 20 28 3c 69  s</b> column (<i
0c70: 3e 62 6f 6f 6c 65 61 6e 3c 2f 69 3e 29 20 74 65  >boolean</i>) te
0c80: 6c 6c 73 20 69 66 20 74 68 65 20 73 74 61 74 65  lls if the state
0c90: 6d 65 6e 74 20 65 78 65 63 75 74 69 6f 6e 20 77  ment execution w
0ca0: 61 73 20 73 75 63 63 65 73 73 66 75 6c 20 6f 72  as successful or
0cb0: 20 6e 6f 74 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e   not.</li>..<li>
0cc0: 74 68 65 20 3c 62 3e 65 72 72 6f 72 5f 63 61 75  the <b>error_cau
0cd0: 73 65 3c 2f 62 3e 20 77 69 6c 6c 20 63 6f 6e 74  se</b> will cont
0ce0: 61 69 6e 20 74 68 65 20 3c 75 3e 65 72 72 6f 72  ain the <u>error
0cf0: 20 6d 65 73 73 61 67 65 3c 2f 75 3e 20 65 76 65   message</u> eve
0d00: 6e 74 75 61 6c 6c 79 20 72 65 74 75 72 6e 65 64  ntually returned
0d10: 20 62 79 20 53 51 4c 69 74 65 2e 3c 2f 6c 69 3e   by SQLite.</li>
0d20: 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 0d 0a 59 6f 75  ..</ul><br>..You
0d30: 20 63 61 6e 20 6c 65 61 72 6e 20 6d 6f 72 65 20   can learn more 
0d40: 61 62 6f 75 74 20 74 68 65 20 53 51 4c 20 4c 6f  about the SQL Lo
0d50: 67 20 61 73 20 61 63 74 75 61 6c 6c 79 20 69 6d  g as actually im
0d60: 70 6c 65 6d 65 6e 74 65 64 20 62 79 20 74 68 65  plemented by the
0d70: 20 3c 62 3e 73 70 61 74 69 61 6c 69 74 65 5f 67   <b>spatialite_g
0d80: 75 69 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 73 70  ui</b> and <b>sp
0d90: 61 74 69 61 6c 69 74 65 20 43 4c 49 3c 2f 62 3e  atialite CLI</b>
0da0: 20 74 6f 6f 6c 73 20 62 79 20 72 65 61 64 69 6e   tools by readin
0db0: 67 20 74 68 69 73 20 3c 61 20 68 72 65 66 3d 22  g this <a href="
0dc0: 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61  https://www.gaia
0dd0: 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c  -gis.it/fossil/l
0de0: 69 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b  ibspatialite/wik
0df0: 69 3f 6e 61 6d 65 3d 74 6f 6f 6c 73 2d 34 2e 30  i?name=tools-4.0
0e00: 22 3e 57 69 6b 69 20 70 61 67 65 3c 2f 61 3e 0d  ">Wiki page</a>.
0e10: 0a 3c 68 34 3e 53 74 72 69 63 74 6c 79 20 72 65  .<h4>Strictly re
0e20: 6c 61 74 65 64 20 28 61 6e 64 20 72 65 61 6c 6c  lated (and reall
0e30: 79 20 75 73 65 66 75 6c 29 20 53 51 4c 20 51 75  y useful) SQL Qu
0e40: 65 72 79 3c 2f 68 34 3e 0d 0a 49 6e 20 6f 72 64  ery</h4>..In ord
0e50: 65 72 20 74 6f 20 64 69 72 65 63 74 6c 79 20 67  er to directly g
0e60: 65 74 20 74 68 65 20 65 78 65 63 75 74 69 6f 6e  et the execution
0e70: 20 74 69 6d 69 6e 67 73 20 28 65 78 70 72 65 73   timings (expres
0e80: 73 65 64 20 69 6e 20 3c 69 3e 6d 69 6c 6c 69 73  sed in <i>millis
0e90: 65 63 6f 6e 64 73 3c 2f 69 3e 29 20 79 6f 75 20  econds</i>) you 
0ea0: 73 69 6d 70 6c 79 20 68 61 76 65 20 74 6f 20 75  simply have to u
0eb0: 73 65 20 61 6e 64 20 53 51 4c 20 71 75 65 72 79  se and SQL query
0ec0: 20 6c 69 6b 65 20 74 68 65 20 66 6f 6c 6c 6f 77   like the follow
0ed0: 69 6e 67 20 6f 6e 65 3a 0d 0a 3c 74 61 62 6c 65  ing one:..<table
0ee0: 20 62 67 63 6f 6c 6f 72 3d 22 23 65 30 65 30 65   bgcolor="#e0e0e
0ef0: 30 22 20 63 65 6c 6c 73 70 61 63 69 6e 67 3d 22  0" cellspacing="
0f00: 38 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22  8" cellpadding="
0f10: 34 22 3e 3c 74 72 3e 0d 0a 3c 74 64 3e 53 45 4c  4"><tr>..<td>SEL
0f20: 45 43 54 20 69 64 2c 20 4a 75 6c 69 61 6e 44 61  ECT id, JulianDa
0f30: 79 28 74 69 6d 65 5f 65 6e 64 29 20 2d 20 4a 75  y(time_end) - Ju
0f40: 6c 69 61 6e 44 61 79 28 74 69 6d 65 5f 73 74 61  lianDay(time_sta
0f50: 72 74 29 20 41 53 20 6d 69 6c 6c 69 73 2c 20 73  rt) AS millis, s
0f60: 71 6c 5f 73 74 61 74 65 6d 65 6e 74 3c 62 72 3e  ql_statement<br>
0f70: 0d 0a 46 52 4f 4d 20 73 71 6c 5f 73 74 61 74 65  ..FROM sql_state
0f80: 6d 65 6e 74 73 5f 6c 6f 67 3c 62 72 3e 0d 0a 57  ments_log<br>..W
0f90: 48 45 52 45 20 73 75 63 63 65 73 73 20 3d 20 31  HERE success = 1
0fa0: 3b 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 3c 2f 74  ;..</td></tr></t
0fb0: 61 62 6c 65 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 3c  able><br>..<hr><
0fc0: 62 72 3e 0d 0a 3c 61 20 68 72 65 66 3d 22 68 74  br>..<a href="ht
0fd0: 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67  tps://www.gaia-g
0fe0: 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 62  is.it/fossil/lib
0ff0: 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b 69 3f  spatialite/wiki?
1000: 6e 61 6d 65 3d 34 2e 32 2e 30 2d 64 6f 63 22 3e  name=4.2.0-doc">
1010: 62 61 63 6b 3c 2f 61 3e 0a 5a 20 61 64 64 62 63  back</a>.Z addbc
1020: 65 38 30 37 38 62 38 39 35 39 30 39 61 38 61 36  e8078b895909a8a6
1030: 63 62 33 30 37 64 65 39 39 65 32 0a              cb307de99e2.