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