Artifact
a5b4d3deb8024b63b04100d87fa55fb8f3245d31:
Wiki page
[SQL Log] by
sandro
2014-08-27 12:34:43.
0000: 44 20 32 30 31 34 2d 30 38 2d 32 37 54 31 32 3a D 2014-08-27T12:
0010: 33 34 3a 34 33 2e 35 33 36 0a 4c 20 53 51 4c 5c 34:43.536.L SQL\
0020: 73 4c 6f 67 0a 50 20 64 35 38 35 65 39 33 39 31 sLog.P d585e9391
0030: 64 32 30 37 32 65 64 38 34 33 61 35 61 33 38 62 d2072ed843a5a38b
0040: 34 62 34 39 63 65 61 33 64 38 31 32 36 61 38 0a 4b49cea3d8126a8.
0050: 55 20 73 61 6e 64 72 6f 0a 57 20 34 30 35 30 0a U sandro.W 4050.
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 42 61 63 4.0.0</h2>..Bac
00a0: 6b 20 74 6f 20 3c 61 20 68 72 65 66 3d 22 68 74 k to <a href="ht
00b0: 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 tps://www.gaia-g
00c0: 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 is.it/fossil/lib
00d0: 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b 69 3f spatialite/wiki?
00e0: 6e 61 6d 65 3d 34 2e 32 2e 30 2d 64 6f 63 22 3e name=4.2.0-doc">
00f0: 6d 61 69 6e 20 70 61 67 65 3c 2f 61 3e 0d 0a 3c main page</a>..<
0100: 68 33 3e 54 68 65 20 22 3c 69 3e 73 71 6c 5f 73 h3>The "<i>sql_s
0110: 74 61 74 65 6d 65 6e 74 73 5f 6c 6f 67 3c 2f 69 tatements_log</i
0120: 3e 22 20 74 61 62 6c 65 3c 2f 68 33 3e 0d 0a 54 >" table</h3>..T
0130: 68 69 73 20 6e 65 77 20 74 61 62 6c 65 20 77 69 his new table wi
0140: 6c 6c 20 62 65 20 61 75 74 6f 6d 61 74 69 63 61 ll be automatica
0150: 6c 6c 79 20 63 72 65 61 74 65 64 20 69 6e 20 61 lly created in a
0160: 6e 79 20 6e 65 77 20 44 42 20 70 72 69 6d 65 64 ny new DB primed
0170: 20 75 73 69 6e 67 20 3c 69 3e 6c 69 62 73 70 61 using <i>libspa
0180: 74 69 61 6c 69 74 65 3c 2f 69 3e 20 76 65 72 73 tialite</i> vers
0190: 69 6f 6e 20 34 2e 30 2e 30 2c 20 61 6e 64 20 74 ion 4.0.0, and t
01a0: 68 65 20 69 6e 74 65 6e 64 65 64 20 73 63 6f 70 he intended scop
01b0: 65 20 69 73 20 73 75 70 70 6f 72 74 69 6e 67 20 e is supporting
01c0: 74 68 65 20 6e 65 77 20 3c 62 3e 53 51 4c 20 4c the new <b>SQL L
01d0: 6f 67 3c 2f 62 3e 20 66 61 63 69 6c 69 74 79 2e og</b> facility.
01e0: 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 69 3e 6c 69 62 <br><br>..<i>lib
01f0: 73 70 61 74 69 61 6c 69 74 65 3c 2f 69 3e 20 76 spatialite</i> v
0200: 65 72 73 69 6f 6e 20 34 2e 30 2e 30 20 6e 6f 77 ersion 4.0.0 now
0210: 20 69 6e 63 6c 75 64 65 73 20 74 77 6f 20 41 50 includes two AP
0220: 49 73 20 64 69 72 65 63 74 6c 79 20 73 75 70 70 Is directly supp
0230: 6f 72 74 69 6e 67 20 74 68 65 20 53 51 4c 20 4c orting the SQL L
0240: 6f 67 3a 20 3c 69 3e 3c 62 3e 67 61 69 61 49 6e og: <i><b>gaiaIn
0250: 73 65 72 74 49 6e 74 6f 53 71 6c 4c 6f 67 28 29 sertIntoSqlLog()
0260: 3c 2f 62 3e 3c 2f 69 3e 20 61 6e 64 20 3c 69 3e </b></i> and <i>
0270: 3c 62 3e 67 61 69 61 55 70 64 61 74 65 53 71 6c <b>gaiaUpdateSql
0280: 4c 6f 67 28 29 3c 2f 62 3e 3c 2f 69 3e 2e 3c 62 Log()</b></i>.<b
0290: 72 3e 0d 0a 42 6f 74 68 20 3c 62 3e 73 70 61 74 r>..Both <b>spat
02a0: 69 61 6c 69 74 65 5f 67 75 69 3c 2f 62 3e 20 61 ialite_gui</b> a
02b0: 6e 64 20 3c 62 3e 73 70 61 74 69 61 6c 69 74 65 nd <b>spatialite
02c0: 20 43 4c 49 3c 2f 62 3e 20 74 6f 6f 6c 73 20 6e CLI</b> tools n
02d0: 6f 77 20 66 75 6c 6c 79 20 73 75 70 70 6f 72 74 ow fully support
02e0: 20 74 68 65 20 53 51 4c 20 4c 6f 67 20 66 61 63 the SQL Log fac
02f0: 69 6c 69 74 79 3b 20 61 6e 64 20 72 61 74 68 65 ility; and rathe
0300: 72 20 6f 62 76 69 6f 75 73 6c 79 20 61 6e 79 20 r obviously any
0310: 74 68 69 72 64 20 70 61 72 74 79 20 74 6f 6f 6c third party tool
0320: 20 69 73 20 77 65 6c 63 6f 6d 65 20 69 6e 20 65 is welcome in e
0330: 78 70 6c 6f 69 74 69 6e 67 20 74 68 69 73 20 63 xploiting this c
0340: 6f 6f 6c 20 6e 65 77 20 66 65 61 74 75 72 65 2e ool new feature.
0350: 3c 62 72 3e 3c 62 72 3e 0d 0a 54 68 65 20 66 6f <br><br>..The fo
0360: 6c 6c 6f 77 69 6e 67 20 65 78 61 6d 70 6c 65 20 llowing example
0370: 65 78 70 6c 61 69 6e 73 20 68 6f 77 20 61 6c 6c explains how all
0380: 20 74 68 69 73 20 70 72 61 63 74 69 63 61 6c 6c this practicall
0390: 79 20 77 6f 72 6b 73 2e 3c 62 72 3e 3c 62 72 3e y works.<br><br>
03a0: 0d 0a 3c 74 61 62 6c 65 20 77 69 64 74 68 3d 22 ..<table width="
03b0: 31 30 30 25 22 20 62 67 63 6f 6c 6f 72 3d 22 23 100%" bgcolor="#
03c0: 66 34 66 34 66 34 22 20 62 6f 72 64 65 72 3d 22 f4f4f4" border="
03d0: 31 22 20 63 65 6c 6c 73 70 61 63 69 6e 67 3d 22 1" cellspacing="
03e0: 34 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 4" cellpadding="
03f0: 34 22 3e 3c 74 72 3e 0d 0a 3c 74 64 20 62 67 63 4"><tr>..<td bgc
0400: 6f 6c 6f 72 3d 22 23 65 38 65 38 65 38 22 20 61 olor="#e8e8e8" a
0410: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62 lign="center"><b
0420: 3e 69 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 >id</b></td>..<t
0430: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 65 38 65 38 d bgcolor="#e8e8
0440: 65 38 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 e8" align="cente
0450: 72 22 3e 3c 62 3e 74 69 6d 65 5f 73 74 61 72 74 r"><b>time_start
0460: 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 </b></td>..<td b
0470: 67 63 6f 6c 6f 72 3d 22 23 65 38 65 38 65 38 22 gcolor="#e8e8e8"
0480: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
0490: 3c 62 3e 74 69 6d 65 5f 65 6e 64 3c 2f 62 3e 3c <b>time_end</b><
04a0: 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f /td>..<td bgcolo
04b0: 72 3d 22 23 65 38 65 38 65 38 22 20 61 6c 69 67 r="#e8e8e8" alig
04c0: 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62 3e 75 73 n="center"><b>us
04d0: 65 72 5f 61 67 65 6e 74 3c 2f 62 3e 3c 2f 74 64 er_agent</b></td
04e0: 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 >..<td bgcolor="
04f0: 23 65 38 65 38 65 38 22 20 61 6c 69 67 6e 3d 22 #e8e8e8" align="
0500: 63 65 6e 74 65 72 22 3e 3c 62 3e 73 71 6c 5f 73 center"><b>sql_s
0510: 74 61 74 65 6d 65 6e 74 3c 2f 62 3e 3c 2f 74 64 tatement</b></td
0520: 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 >..<td bgcolor="
0530: 23 65 38 65 38 65 38 22 20 61 6c 69 67 6e 3d 22 #e8e8e8" align="
0540: 63 65 6e 74 65 72 22 3e 3c 62 3e 73 75 63 63 65 center"><b>succe
0550: 73 73 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 ss</b></td>..<td
0560: 20 62 67 63 6f 6c 6f 72 3d 22 23 65 38 65 38 65 bgcolor="#e8e8e
0570: 38 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 8" align="center
0580: 22 3e 3c 62 3e 65 72 72 6f 72 5f 63 61 75 73 65 "><b>error_cause
0590: 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a </b></td></tr>..
05a0: 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 <tr><td align="r
05b0: 69 67 68 74 22 3e 31 38 3c 2f 74 64 3e 3c 74 64 ight">18</td><td
05c0: 3e 32 30 31 32 2d 30 39 2d 30 34 54 32 32 3a 32 >2012-09-04T22:2
05d0: 36 3a 30 33 2e 35 34 35 5a 3c 2f 74 64 3e 09 3c 6:03.545Z</td>.<
05e0: 74 64 3e 32 30 31 32 2d 30 39 2d 30 34 54 32 32 td>2012-09-04T22
05f0: 3a 32 36 3a 30 33 2e 36 39 32 5a 3c 2f 74 64 3e :26:03.692Z</td>
0600: 3c 74 64 3e 73 70 61 74 69 61 6c 69 74 65 20 43 <td>spatialite C
0610: 4c 49 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 53 45 4c LI</td><td>..SEL
0620: 45 43 54 20 72 2e 6e 6f 6d 65 5f 72 65 67 2c 20 ECT r.nome_reg,
0630: 70 2e 6e 6f 6d 65 5f 70 72 6f 2c 20 63 2e 6e 6f p.nome_pro, c.no
0640: 6d 65 5f 63 6f 6d 3c 62 72 3e 0d 0a 46 52 4f 4d me_com<br>..FROM
0650: 20 63 6f 6d 32 30 31 31 20 41 53 20 63 3c 62 72 com2011 AS c<br
0660: 3e 0d 0a 4a 4f 49 4e 20 70 72 6f 76 32 30 31 31 >..JOIN prov2011
0670: 20 41 53 20 70 20 4f 4e 20 28 63 2e 63 6f 64 5f AS p ON (c.cod_
0680: 70 72 6f 20 3d 20 70 2e 63 6f 64 5f 70 72 6f 29 pro = p.cod_pro)
0690: 3c 62 72 3e 0d 0a 4a 4f 49 4e 20 72 65 67 32 30 <br>..JOIN reg20
06a0: 31 31 20 41 53 20 72 20 4f 4e 20 28 63 2e 63 6f 11 AS r ON (c.co
06b0: 64 5f 72 65 67 20 3d 20 72 2e 63 6f 64 5f 72 65 d_reg = r.cod_re
06c0: 67 29 3c 62 72 3e 0d 0a 57 48 45 52 45 20 63 2e g)<br>..WHERE c.
06d0: 63 6f 64 5f 72 65 67 20 3d 20 31 30 3c 62 72 3e cod_reg = 10<br>
06e0: 0d 0a 4f 52 44 45 52 20 42 59 20 63 2e 6e 6f 6d ..ORDER BY c.nom
06f0: 65 5f 70 72 6f 2c 20 63 2e 6e 6f 6d 65 5f 63 6f e_pro, c.nome_co
0700: 6d 3b 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e m;</td><td align
0710: 3d 22 72 69 67 68 74 22 3e 30 3c 2f 74 64 3e 3c ="right">0</td><
0720: 74 64 3e 6e 6f 20 73 75 63 68 20 63 6f 6c 75 6d td>no such colum
0730: 6e 3a 20 63 2e 6e 6f 6d 65 5f 70 72 6f 3c 2f 74 n: c.nome_pro</t
0740: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 d></tr>..<tr><td
0750: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 align="right">1
0760: 39 3c 2f 74 64 3e 3c 74 64 3e 32 30 31 32 2d 30 9</td><td>2012-0
0770: 39 2d 30 34 54 32 32 3a 32 36 3a 31 33 2e 35 36 9-04T22:26:13.56
0780: 32 5a 3c 2f 74 64 3e 09 3c 74 64 3e 32 30 31 32 2Z</td>.<td>2012
0790: 2d 30 39 2d 30 34 54 32 32 3a 32 36 3a 31 33 2e -09-04T22:26:13.
07a0: 37 33 37 5a 3c 2f 74 64 3e 3c 74 64 3e 73 70 61 737Z</td><td>spa
07b0: 74 69 61 6c 69 74 65 20 43 4c 49 3c 2f 74 64 3e tialite CLI</td>
07c0: 3c 74 64 3e 0d 0a 53 45 4c 45 43 54 20 72 2e 6e <td>..SELECT r.n
07d0: 6f 6d 65 5f 72 65 67 2c 20 70 2e 6e 6f 6d 65 5f ome_reg, p.nome_
07e0: 70 72 6f 2c 20 63 2e 6e 6f 6d 65 5f 63 6f 6d 3c pro, c.nome_com<
07f0: 62 72 3e 0d 0a 46 52 4f 4d 20 63 6f 6d 32 30 31 br>..FROM com201
0800: 31 20 41 53 20 63 3c 62 72 3e 0d 0a 4a 4f 49 4e 1 AS c<br>..JOIN
0810: 20 70 72 6f 76 32 30 31 31 20 41 53 20 70 20 4f prov2011 AS p O
0820: 4e 20 28 63 2e 63 6f 64 5f 70 72 6f 20 3d 20 70 N (c.cod_pro = p
0830: 2e 63 6f 64 5f 70 72 6f 29 3c 62 72 3e 0d 0a 4a .cod_pro)<br>..J
0840: 4f 49 4e 20 72 65 67 32 30 31 31 20 41 53 20 72 OIN reg2011 AS r
0850: 20 4f 4e 20 28 63 2e 63 6f 64 5f 72 65 67 20 3d ON (c.cod_reg =
0860: 20 72 2e 63 6f 64 5f 72 65 67 29 3c 62 72 3e 0d r.cod_reg)<br>.
0870: 0a 57 48 45 52 45 20 63 2e 63 6f 64 5f 72 65 67 .WHERE c.cod_reg
0880: 20 3d 20 31 30 3c 62 72 3e 0d 0a 4f 52 44 45 52 = 10<br>..ORDER
0890: 20 42 59 20 70 2e 6e 6f 6d 65 5f 70 72 6f 2c 20 BY p.nome_pro,
08a0: 63 2e 6e 6f 6d 65 5f 63 6f 6d 3b 3c 2f 74 64 3e c.nome_com;</td>
08b0: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
08c0: 22 3e 31 3c 2f 74 64 3e 3c 74 64 3e 73 75 63 63 ">1</td><td>succ
08d0: 65 73 73 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c ess</td></tr>..<
08e0: 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 tr><td align="ri
08f0: 67 68 74 22 3e 32 30 3c 2f 74 64 3e 3c 74 64 3e ght">20</td><td>
0900: 32 30 31 32 2d 30 39 2d 30 34 54 32 32 3a 32 37 2012-09-04T22:27
0910: 3a 30 33 2e 31 39 39 5a 3c 2f 74 64 3e 09 3c 74 :03.199Z</td>.<t
0920: 64 3e 32 30 31 32 2d 30 39 2d 30 34 54 32 32 3a d>2012-09-04T22:
0930: 32 37 3a 30 33 2e 33 37 30 5a 3c 2f 74 64 3e 3c 27:03.370Z</td><
0940: 74 64 3e 73 70 61 74 69 61 6c 69 74 65 5f 67 75 td>spatialite_gu
0950: 69 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 53 45 4c 45 i</td><td>..SELE
0960: 43 54 20 72 2e 6e 6f 6d 65 5f 72 65 67 2c 20 70 CT r.nome_reg, p
0970: 2e 6e 6f 6d 65 5f 70 72 6f 2c 20 63 2e 6e 6f 6d .nome_pro, c.nom
0980: 65 5f 63 6f 6d 3c 62 72 3e 0d 0a 46 52 4f 4d 20 e_com<br>..FROM
0990: 63 6f 6d 32 30 31 31 20 41 53 20 63 3c 62 72 3e com2011 AS c<br>
09a0: 0d 0a 4a 4f 49 4e 20 70 72 6f 76 32 30 31 31 20 ..JOIN prov2011
09b0: 41 53 20 70 20 4f 4e 20 28 63 2e 63 6f 64 5f 70 AS p ON (c.cod_p
09c0: 72 6f 20 3d 20 70 2e 63 6f 64 5f 70 72 6f 29 3c ro = p.cod_pro)<
09d0: 62 72 3e 0d 0a 4a 4f 49 4e 20 72 65 67 32 30 31 br>..JOIN reg201
09e0: 31 20 41 53 20 72 20 4f 4e 20 28 63 2e 63 6f 64 1 AS r ON (c.cod
09f0: 5f 72 65 67 20 3d 20 72 2e 63 6f 64 5f 72 65 67 _reg = r.cod_reg
0a00: 29 3c 62 72 3e 0d 0a 57 48 45 52 45 20 63 2e 63 )<br>..WHERE c.c
0a10: 6f 64 5f 72 65 67 20 3d 20 39 3c 62 72 3e 0d 0a od_reg = 9<br>..
0a20: 4f 52 44 45 52 20 42 59 20 63 2e 6e 6f 6d 65 5f ORDER BY c.nome_
0a30: 63 6f 6d 20 44 45 53 43 3c 2f 74 64 3e 3c 74 64 com DESC</td><td
0a40: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 align="right">1
0a50: 3c 2f 74 64 3e 3c 74 64 3e 73 75 63 63 65 73 73 </td><td>success
0a60: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 </td></tr>..</ta
0a70: 62 6c 65 3e 3c 62 72 3e 0d 0a 3c 75 6c 3e 0d 0a ble><br>..<ul>..
0a80: 3c 6c 69 3e 74 68 65 20 3c 62 3e 69 64 3c 2f 62 <li>the <b>id</b
0a90: 3e 20 63 6f 6c 75 6d 6e 20 69 73 20 74 68 65 20 > column is the
0aa0: 3c 75 3e 65 76 65 6e 74 20 49 44 3c 2f 75 3e 20 <u>event ID</u>
0ab0: 28 3c 69 3e 50 72 69 6d 61 72 79 20 4b 65 79 3c (<i>Primary Key<
0ac0: 2f 69 3e 2c 20 75 6e 69 71 75 65 6c 79 20 69 64 /i>, uniquely id
0ad0: 65 6e 74 69 66 79 69 6e 67 20 65 61 63 68 20 73 entifying each s
0ae0: 69 6e 67 6c 65 20 53 51 4c 20 53 74 61 74 65 6d ingle SQL Statem
0af0: 65 6e 74 20 69 6e 74 6f 20 74 68 65 20 4c 6f 67 ent into the Log
0b00: 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 ).</li>..<li>the
0b10: 20 3c 62 3e 74 69 6d 65 5f 73 74 61 72 74 3c 2f <b>time_start</
0b20: 62 3e 20 61 6e 64 20 3c 62 3e 74 69 6d 65 5f 65 b> and <b>time_e
0b30: 6e 64 3c 2f 62 3e 20 63 6f 6c 75 6d 6e 73 20 63 nd</b> columns c
0b40: 6f 6e 74 61 69 74 73 20 74 68 65 20 3c 69 3e 74 ontaits the <i>t
0b50: 69 6d 65 73 74 61 6d 70 73 3c 2f 69 3e 20 6d 65 imestamps</i> me
0b60: 61 73 75 72 65 64 20 69 6d 6d 65 64 69 61 74 65 asured immediate
0b70: 6c 79 20 62 65 66 6f 72 65 20 61 6e 64 20 61 66 ly before and af
0b80: 74 65 72 20 65 78 65 63 75 74 69 6e 67 20 74 68 ter executing th
0b90: 65 20 53 51 4c 20 73 74 61 74 65 6d 65 6e 74 20 e SQL statement
0ba0: 69 74 73 65 6c 66 2e 3c 2f 6c 69 3e 0d 0a 3c 6c itself.</li>..<l
0bb0: 69 3e 74 68 65 20 3c 62 3e 75 73 65 72 5f 61 67 i>the <b>user_ag
0bc0: 65 6e 74 3c 2f 62 3e 20 63 6f 6c 75 6d 6e 20 69 ent</b> column i
0bd0: 64 65 6e 74 69 66 79 20 74 68 65 20 74 6f 6f 6c dentify the tool
0be0: 20 62 65 69 6e 67 20 75 73 65 64 20 74 6f 20 65 being used to e
0bf0: 78 65 63 75 74 65 64 20 74 68 65 20 53 51 4c 20 xecuted the SQL
0c00: 73 74 61 74 65 6d 65 6e 74 2e 3c 2f 6c 69 3e 0d statement.</li>.
0c10: 0a 3c 6c 69 3e 74 68 65 20 3c 62 3e 73 71 6c 5f .<li>the <b>sql_
0c20: 73 74 61 74 65 6d 65 6e 74 3c 2f 62 3e 20 63 6f statement</b> co
0c30: 6c 75 6d 6e 20 63 6f 6e 74 61 69 6e 73 20 74 68 lumn contains th
0c40: 65 20 53 51 4c 20 73 74 61 74 65 6d 65 6e 74 20 e SQL statement
0c50: 62 6f 64 79 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e body.</li>..<li>
0c60: 74 68 65 20 3c 62 3e 73 75 63 63 65 73 73 3c 2f the <b>success</
0c70: 62 3e 20 63 6f 6c 75 6d 6e 20 28 3c 69 3e 62 6f b> column (<i>bo
0c80: 6f 6c 65 61 6e 3c 2f 69 3e 29 20 74 65 6c 6c 73 olean</i>) tells
0c90: 20 69 66 20 74 68 65 20 73 74 61 74 65 6d 65 6e if the statemen
0ca0: 74 20 65 78 65 63 75 74 69 6f 6e 20 77 61 73 20 t execution was
0cb0: 73 75 63 63 65 73 73 66 75 6c 20 6f 72 20 6e 6f successful or no
0cc0: 74 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 t.</li>..<li>the
0cd0: 20 3c 62 3e 65 72 72 6f 72 5f 63 61 75 73 65 3c <b>error_cause<
0ce0: 2f 62 3e 20 77 69 6c 6c 20 63 6f 6e 74 61 69 6e /b> will contain
0cf0: 20 74 68 65 20 3c 75 3e 65 72 72 6f 72 20 6d 65 the <u>error me
0d00: 73 73 61 67 65 3c 2f 75 3e 20 65 76 65 6e 74 75 ssage</u> eventu
0d10: 61 6c 6c 79 20 72 65 74 75 72 6e 65 64 20 62 79 ally returned by
0d20: 20 53 51 4c 69 74 65 2e 3c 2f 6c 69 3e 0d 0a 3c SQLite.</li>..<
0d30: 2f 75 6c 3e 3c 62 72 3e 0d 0a 59 6f 75 20 63 61 /ul><br>..You ca
0d40: 6e 20 6c 65 61 72 6e 20 6d 6f 72 65 20 61 62 6f n learn more abo
0d50: 75 74 20 74 68 65 20 53 51 4c 20 4c 6f 67 20 61 ut the SQL Log a
0d60: 73 20 61 63 74 75 61 6c 6c 79 20 69 6d 70 6c 65 s actually imple
0d70: 6d 65 6e 74 65 64 20 62 79 20 74 68 65 20 3c 62 mented by the <b
0d80: 3e 73 70 61 74 69 61 6c 69 74 65 5f 67 75 69 3c >spatialite_gui<
0d90: 2f 62 3e 20 61 6e 64 20 3c 62 3e 73 70 61 74 69 /b> and <b>spati
0da0: 61 6c 69 74 65 20 43 4c 49 3c 2f 62 3e 20 74 6f alite CLI</b> to
0db0: 6f 6c 73 20 62 79 20 72 65 61 64 69 6e 67 20 74 ols by reading t
0dc0: 68 69 73 20 3c 61 20 68 72 65 66 3d 22 68 74 74 his <a href="htt
0dd0: 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 ps://www.gaia-gi
0de0: 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 s.it/fossil/libs
0df0: 70 61 74 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e patialite/wiki?n
0e00: 61 6d 65 3d 74 6f 6f 6c 73 2d 34 2e 30 22 3e 57 ame=tools-4.0">W
0e10: 69 6b 69 20 70 61 67 65 3c 2f 61 3e 0d 0a 3c 68 iki page</a>..<h
0e20: 34 3e 53 74 72 69 63 74 6c 79 20 72 65 6c 61 74 4>Strictly relat
0e30: 65 64 20 28 61 6e 64 20 72 65 61 6c 6c 79 20 75 ed (and really u
0e40: 73 65 66 75 6c 29 20 53 51 4c 20 51 75 65 72 79 seful) SQL Query
0e50: 3c 2f 68 34 3e 0d 0a 49 6e 20 6f 72 64 65 72 20 </h4>..In order
0e60: 74 6f 20 64 69 72 65 63 74 6c 79 20 67 65 74 20 to directly get
0e70: 74 68 65 20 65 78 65 63 75 74 69 6f 6e 20 74 69 the execution ti
0e80: 6d 69 6e 67 73 20 28 65 78 70 72 65 73 73 65 64 mings (expressed
0e90: 20 69 6e 20 3c 69 3e 6d 69 6c 6c 69 73 65 63 6f in <i>milliseco
0ea0: 6e 64 73 3c 2f 69 3e 29 20 79 6f 75 20 73 69 6d nds</i>) you sim
0eb0: 70 6c 79 20 68 61 76 65 20 74 6f 20 75 73 65 20 ply have to use
0ec0: 61 6e 64 20 53 51 4c 20 71 75 65 72 79 20 6c 69 and SQL query li
0ed0: 6b 65 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 ke the following
0ee0: 20 6f 6e 65 3a 0d 0a 3c 74 61 62 6c 65 20 62 67 one:..<table bg
0ef0: 63 6f 6c 6f 72 3d 22 23 65 30 65 30 65 30 22 20 color="#e0e0e0"
0f00: 63 65 6c 6c 73 70 61 63 69 6e 67 3d 22 38 22 20 cellspacing="8"
0f10: 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 34 22 3e cellpadding="4">
0f20: 3c 74 72 3e 0d 0a 3c 74 64 3e 53 45 4c 45 43 54 <tr>..<td>SELECT
0f30: 20 69 64 2c 20 4a 75 6c 69 61 6e 44 61 79 28 74 id, JulianDay(t
0f40: 69 6d 65 5f 65 6e 64 29 20 2d 20 4a 75 6c 69 61 ime_end) - Julia
0f50: 6e 44 61 79 28 74 69 6d 65 5f 73 74 61 72 74 29 nDay(time_start)
0f60: 20 41 53 20 6d 69 6c 6c 69 73 2c 20 73 71 6c 5f AS millis, sql_
0f70: 73 74 61 74 65 6d 65 6e 74 3c 62 72 3e 0d 0a 46 statement<br>..F
0f80: 52 4f 4d 20 73 71 6c 5f 73 74 61 74 65 6d 65 6e ROM sql_statemen
0f90: 74 73 5f 6c 6f 67 3c 62 72 3e 0d 0a 57 48 45 52 ts_log<br>..WHER
0fa0: 45 20 73 75 63 63 65 73 73 20 3d 20 31 3b 0d 0a E success = 1;..
0fb0: 3c 2f 74 64 3e 3c 2f 74 72 3e 3c 2f 74 61 62 6c </td></tr></tabl
0fc0: 65 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 3c 62 72 3e e><br>..<hr><br>
0fd0: 0d 0a 42 61 63 6b 20 74 6f 20 3c 61 20 68 72 65 ..Back to <a hre
0fe0: 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 f="https://www.g
0ff0: 61 69 61 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69 aia-gis.it/fossi
1000: 6c 2f 6c 69 62 73 70 61 74 69 61 6c 69 74 65 2f l/libspatialite/
1010: 77 69 6b 69 3f 6e 61 6d 65 3d 34 2e 32 2e 30 2d wiki?name=4.2.0-
1020: 64 6f 63 22 3e 6d 61 69 6e 20 70 61 67 65 3c 2f doc">main page</
1030: 61 3e 0a 5a 20 61 35 39 36 37 34 36 61 66 35 35 a>.Z a596746af55
1040: 62 39 34 36 65 35 33 35 65 64 39 32 62 31 38 30 b946e535ed92b180
1050: 39 66 63 35 35 0a 9fc55.