Artifact
d585e9391d2072ed843a5a38b4b49cea3d8126a8:
Wiki page
[SQL Log] by
sandro
2012-09-04 23:23:14.
0000: 44 20 32 30 31 32 2d 30 39 2d 30 34 54 32 33 3a D 2012-09-04T23:
0010: 32 33 3a 31 34 2e 35 35 39 0a 4c 20 53 51 4c 5c 23:14.559.L SQL\
0020: 73 4c 6f 67 0a 50 20 32 38 63 36 61 61 31 65 31 sLog.P 28c6aa1e1
0030: 65 37 65 65 33 39 38 66 36 61 37 33 37 38 65 37 e7ee398f6a7378e7
0040: 62 38 37 30 36 62 32 65 63 30 62 62 32 62 63 0a b8706b2ec0bb2bc.
0050: 55 20 73 61 6e 64 72 6f 0a 57 20 34 30 37 38 0a U sandro.W 4078.
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 73 77 69 74 63 68 69 6e 67 2d 74 name=switching-t
00f0: 6f 2d 34 2e 30 23 73 71 6c 6c 6f 67 22 3e 6d 61 o-4.0#sqllog">ma
0100: 69 6e 20 70 61 67 65 3c 2f 61 3e 0d 0a 3c 68 33 in page</a>..<h3
0110: 3e 54 68 65 20 22 3c 69 3e 73 71 6c 5f 73 74 61 >The "<i>sql_sta
0120: 74 65 6d 65 6e 74 73 5f 6c 6f 67 3c 2f 69 3e 22 tements_log</i>"
0130: 20 74 61 62 6c 65 3c 2f 68 33 3e 0d 0a 54 68 69 table</h3>..Thi
0140: 73 20 6e 65 77 20 74 61 62 6c 65 20 77 69 6c 6c s new table will
0150: 20 62 65 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c be automaticall
0160: 79 20 63 72 65 61 74 65 64 20 69 6e 20 61 6e 79 y created in any
0170: 20 6e 65 77 20 44 42 20 70 72 69 6d 65 64 20 75 new DB primed u
0180: 73 69 6e 67 20 3c 69 3e 6c 69 62 73 70 61 74 69 sing <i>libspati
0190: 61 6c 69 74 65 3c 2f 69 3e 20 76 65 72 73 69 6f alite</i> versio
01a0: 6e 20 34 2e 30 2e 30 2c 20 61 6e 64 20 74 68 65 n 4.0.0, and the
01b0: 20 69 6e 74 65 6e 64 65 64 20 73 63 6f 70 65 20 intended scope
01c0: 69 73 20 73 75 70 70 6f 72 74 69 6e 67 20 74 68 is supporting th
01d0: 65 20 6e 65 77 20 3c 62 3e 53 51 4c 20 4c 6f 67 e new <b>SQL Log
01e0: 3c 2f 62 3e 20 66 61 63 69 6c 69 74 79 2e 3c 62 </b> facility.<b
01f0: 72 3e 3c 62 72 3e 0d 0a 3c 69 3e 6c 69 62 73 70 r><br>..<i>libsp
0200: 61 74 69 61 6c 69 74 65 3c 2f 69 3e 20 76 65 72 atialite</i> ver
0210: 73 69 6f 6e 20 34 2e 30 2e 30 20 6e 6f 77 20 69 sion 4.0.0 now i
0220: 6e 63 6c 75 64 65 73 20 74 77 6f 20 41 50 49 73 ncludes two APIs
0230: 20 64 69 72 65 63 74 6c 79 20 73 75 70 70 6f 72 directly suppor
0240: 74 69 6e 67 20 74 68 65 20 53 51 4c 20 4c 6f 67 ting the SQL Log
0250: 3a 20 3c 69 3e 3c 62 3e 67 61 69 61 49 6e 73 65 : <i><b>gaiaInse
0260: 72 74 49 6e 74 6f 53 71 6c 4c 6f 67 28 29 3c 2f rtIntoSqlLog()</
0270: 62 3e 3c 2f 69 3e 20 61 6e 64 20 3c 69 3e 3c 62 b></i> and <i><b
0280: 3e 67 61 69 61 55 70 64 61 74 65 53 71 6c 4c 6f >gaiaUpdateSqlLo
0290: 67 28 29 3c 2f 62 3e 3c 2f 69 3e 2e 3c 62 72 3e g()</b></i>.<br>
02a0: 0d 0a 42 6f 74 68 20 3c 62 3e 73 70 61 74 69 61 ..Both <b>spatia
02b0: 6c 69 74 65 5f 67 75 69 3c 2f 62 3e 20 61 6e 64 lite_gui</b> and
02c0: 20 3c 62 3e 73 70 61 74 69 61 6c 69 74 65 20 43 <b>spatialite C
02d0: 4c 49 3c 2f 62 3e 20 74 6f 6f 6c 73 20 6e 6f 77 LI</b> tools now
02e0: 20 66 75 6c 6c 79 20 73 75 70 70 6f 72 74 20 74 fully support t
02f0: 68 65 20 53 51 4c 20 4c 6f 67 20 66 61 63 69 6c he SQL Log facil
0300: 69 74 79 3b 20 61 6e 64 20 72 61 74 68 65 72 20 ity; and rather
0310: 6f 62 76 69 6f 75 73 6c 79 20 61 6e 79 20 74 68 obviously any th
0320: 69 72 64 20 70 61 72 74 79 20 74 6f 6f 6c 20 69 ird party tool i
0330: 73 20 77 65 6c 63 6f 6d 65 20 69 6e 20 65 78 70 s welcome in exp
0340: 6c 6f 69 74 69 6e 67 20 74 68 69 73 20 63 6f 6f loiting this coo
0350: 6c 20 6e 65 77 20 66 65 61 74 75 72 65 2e 3c 62 l new feature.<b
0360: 72 3e 3c 62 72 3e 0d 0a 54 68 65 20 66 6f 6c 6c r><br>..The foll
0370: 6f 77 69 6e 67 20 65 78 61 6d 70 6c 65 20 65 78 owing example ex
0380: 70 6c 61 69 6e 73 20 68 6f 77 20 61 6c 6c 20 74 plains how all t
0390: 68 69 73 20 70 72 61 63 74 69 63 61 6c 6c 79 20 his practically
03a0: 77 6f 72 6b 73 2e 3c 62 72 3e 3c 62 72 3e 0d 0a works.<br><br>..
03b0: 3c 74 61 62 6c 65 20 77 69 64 74 68 3d 22 31 30 <table width="10
03c0: 30 25 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 34 0%" bgcolor="#f4
03d0: 66 34 66 34 22 20 62 6f 72 64 65 72 3d 22 31 22 f4f4" border="1"
03e0: 20 63 65 6c 6c 73 70 61 63 69 6e 67 3d 22 34 22 cellspacing="4"
03f0: 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 34 22 cellpadding="4"
0400: 3e 3c 74 72 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c ><tr>..<td bgcol
0410: 6f 72 3d 22 23 65 38 65 38 65 38 22 20 61 6c 69 or="#e8e8e8" ali
0420: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62 3e 69 gn="center"><b>i
0430: 64 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 d</b></td>..<td
0440: 62 67 63 6f 6c 6f 72 3d 22 23 65 38 65 38 65 38 bgcolor="#e8e8e8
0450: 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 " align="center"
0460: 3e 3c 62 3e 74 69 6d 65 5f 73 74 61 72 74 3c 2f ><b>time_start</
0470: 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 67 63 b></td>..<td bgc
0480: 6f 6c 6f 72 3d 22 23 65 38 65 38 65 38 22 20 61 olor="#e8e8e8" a
0490: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62 lign="center"><b
04a0: 3e 74 69 6d 65 5f 65 6e 64 3c 2f 62 3e 3c 2f 74 >time_end</b></t
04b0: 64 3e 0d 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d d>..<td bgcolor=
04c0: 22 23 65 38 65 38 65 38 22 20 61 6c 69 67 6e 3d "#e8e8e8" align=
04d0: 22 63 65 6e 74 65 72 22 3e 3c 62 3e 75 73 65 72 "center"><b>user
04e0: 5f 61 67 65 6e 74 3c 2f 62 3e 3c 2f 74 64 3e 0d _agent</b></td>.
04f0: 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 65 .<td bgcolor="#e
0500: 38 65 38 65 38 22 20 61 6c 69 67 6e 3d 22 63 65 8e8e8" align="ce
0510: 6e 74 65 72 22 3e 3c 62 3e 73 71 6c 5f 73 74 61 nter"><b>sql_sta
0520: 74 65 6d 65 6e 74 3c 2f 62 3e 3c 2f 74 64 3e 0d tement</b></td>.
0530: 0a 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 65 .<td bgcolor="#e
0540: 38 65 38 65 38 22 20 61 6c 69 67 6e 3d 22 63 65 8e8e8" align="ce
0550: 6e 74 65 72 22 3e 3c 62 3e 73 75 63 63 65 73 73 nter"><b>success
0560: 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 62 </b></td>..<td b
0570: 67 63 6f 6c 6f 72 3d 22 23 65 38 65 38 65 38 22 gcolor="#e8e8e8"
0580: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
0590: 3c 62 3e 65 72 72 6f 72 5f 63 61 75 73 65 3c 2f <b>error_cause</
05a0: 62 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 b></td></tr>..<t
05b0: 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 r><td align="rig
05c0: 68 74 22 3e 31 38 3c 2f 74 64 3e 3c 74 64 3e 32 ht">18</td><td>2
05d0: 30 31 32 2d 30 39 2d 30 34 54 32 32 3a 32 36 3a 012-09-04T22:26:
05e0: 30 33 2e 35 34 35 5a 3c 2f 74 64 3e 09 3c 74 64 03.545Z</td>.<td
05f0: 3e 32 30 31 32 2d 30 39 2d 30 34 54 32 32 3a 32 >2012-09-04T22:2
0600: 36 3a 30 33 2e 36 39 32 5a 3c 2f 74 64 3e 3c 74 6:03.692Z</td><t
0610: 64 3e 73 70 61 74 69 61 6c 69 74 65 20 43 4c 49 d>spatialite CLI
0620: 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 53 45 4c 45 43 </td><td>..SELEC
0630: 54 20 72 2e 6e 6f 6d 65 5f 72 65 67 2c 20 70 2e T r.nome_reg, p.
0640: 6e 6f 6d 65 5f 70 72 6f 2c 20 63 2e 6e 6f 6d 65 nome_pro, c.nome
0650: 5f 63 6f 6d 3c 62 72 3e 0d 0a 46 52 4f 4d 20 63 _com<br>..FROM c
0660: 6f 6d 32 30 31 31 20 41 53 20 63 3c 62 72 3e 0d om2011 AS c<br>.
0670: 0a 4a 4f 49 4e 20 70 72 6f 76 32 30 31 31 20 41 .JOIN prov2011 A
0680: 53 20 70 20 4f 4e 20 28 63 2e 63 6f 64 5f 70 72 S p ON (c.cod_pr
0690: 6f 20 3d 20 70 2e 63 6f 64 5f 70 72 6f 29 3c 62 o = p.cod_pro)<b
06a0: 72 3e 0d 0a 4a 4f 49 4e 20 72 65 67 32 30 31 31 r>..JOIN reg2011
06b0: 20 41 53 20 72 20 4f 4e 20 28 63 2e 63 6f 64 5f AS r ON (c.cod_
06c0: 72 65 67 20 3d 20 72 2e 63 6f 64 5f 72 65 67 29 reg = r.cod_reg)
06d0: 3c 62 72 3e 0d 0a 57 48 45 52 45 20 63 2e 63 6f <br>..WHERE c.co
06e0: 64 5f 72 65 67 20 3d 20 31 30 3c 62 72 3e 0d 0a d_reg = 10<br>..
06f0: 4f 52 44 45 52 20 42 59 20 63 2e 6e 6f 6d 65 5f ORDER BY c.nome_
0700: 70 72 6f 2c 20 63 2e 6e 6f 6d 65 5f 63 6f 6d 3b pro, c.nome_com;
0710: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
0720: 72 69 67 68 74 22 3e 30 3c 2f 74 64 3e 3c 74 64 right">0</td><td
0730: 3e 6e 6f 20 73 75 63 68 20 63 6f 6c 75 6d 6e 3a >no such column:
0740: 20 63 2e 6e 6f 6d 65 5f 70 72 6f 3c 2f 74 64 3e c.nome_pro</td>
0750: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 61 </tr>..<tr><td a
0760: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 39 3c lign="right">19<
0770: 2f 74 64 3e 3c 74 64 3e 32 30 31 32 2d 30 39 2d /td><td>2012-09-
0780: 30 34 54 32 32 3a 32 36 3a 31 33 2e 35 36 32 5a 04T22:26:13.562Z
0790: 3c 2f 74 64 3e 09 3c 74 64 3e 32 30 31 32 2d 30 </td>.<td>2012-0
07a0: 39 2d 30 34 54 32 32 3a 32 36 3a 31 33 2e 37 33 9-04T22:26:13.73
07b0: 37 5a 3c 2f 74 64 3e 3c 74 64 3e 73 70 61 74 69 7Z</td><td>spati
07c0: 61 6c 69 74 65 20 43 4c 49 3c 2f 74 64 3e 3c 74 alite CLI</td><t
07d0: 64 3e 0d 0a 53 45 4c 45 43 54 20 72 2e 6e 6f 6d d>..SELECT r.nom
07e0: 65 5f 72 65 67 2c 20 70 2e 6e 6f 6d 65 5f 70 72 e_reg, p.nome_pr
07f0: 6f 2c 20 63 2e 6e 6f 6d 65 5f 63 6f 6d 3c 62 72 o, c.nome_com<br
0800: 3e 0d 0a 46 52 4f 4d 20 63 6f 6d 32 30 31 31 20 >..FROM com2011
0810: 41 53 20 63 3c 62 72 3e 0d 0a 4a 4f 49 4e 20 70 AS c<br>..JOIN p
0820: 72 6f 76 32 30 31 31 20 41 53 20 70 20 4f 4e 20 rov2011 AS p ON
0830: 28 63 2e 63 6f 64 5f 70 72 6f 20 3d 20 70 2e 63 (c.cod_pro = p.c
0840: 6f 64 5f 70 72 6f 29 3c 62 72 3e 0d 0a 4a 4f 49 od_pro)<br>..JOI
0850: 4e 20 72 65 67 32 30 31 31 20 41 53 20 72 20 4f N reg2011 AS r O
0860: 4e 20 28 63 2e 63 6f 64 5f 72 65 67 20 3d 20 72 N (c.cod_reg = r
0870: 2e 63 6f 64 5f 72 65 67 29 3c 62 72 3e 0d 0a 57 .cod_reg)<br>..W
0880: 48 45 52 45 20 63 2e 63 6f 64 5f 72 65 67 20 3d HERE c.cod_reg =
0890: 20 31 30 3c 62 72 3e 0d 0a 4f 52 44 45 52 20 42 10<br>..ORDER B
08a0: 59 20 70 2e 6e 6f 6d 65 5f 70 72 6f 2c 20 63 2e Y p.nome_pro, c.
08b0: 6e 6f 6d 65 5f 63 6f 6d 3b 3c 2f 74 64 3e 3c 74 nome_com;</td><t
08c0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
08d0: 31 3c 2f 74 64 3e 3c 74 64 3e 73 75 63 63 65 73 1</td><td>succes
08e0: 73 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 s</td></tr>..<tr
08f0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
0900: 74 22 3e 32 30 3c 2f 74 64 3e 3c 74 64 3e 32 30 t">20</td><td>20
0910: 31 32 2d 30 39 2d 30 34 54 32 32 3a 32 37 3a 30 12-09-04T22:27:0
0920: 33 2e 31 39 39 5a 3c 2f 74 64 3e 09 3c 74 64 3e 3.199Z</td>.<td>
0930: 32 30 31 32 2d 30 39 2d 30 34 54 32 32 3a 32 37 2012-09-04T22:27
0940: 3a 30 33 2e 33 37 30 5a 3c 2f 74 64 3e 3c 74 64 :03.370Z</td><td
0950: 3e 73 70 61 74 69 61 6c 69 74 65 5f 67 75 69 3c >spatialite_gui<
0960: 2f 74 64 3e 3c 74 64 3e 0d 0a 53 45 4c 45 43 54 /td><td>..SELECT
0970: 20 72 2e 6e 6f 6d 65 5f 72 65 67 2c 20 70 2e 6e r.nome_reg, p.n
0980: 6f 6d 65 5f 70 72 6f 2c 20 63 2e 6e 6f 6d 65 5f ome_pro, c.nome_
0990: 63 6f 6d 3c 62 72 3e 0d 0a 46 52 4f 4d 20 63 6f com<br>..FROM co
09a0: 6d 32 30 31 31 20 41 53 20 63 3c 62 72 3e 0d 0a m2011 AS c<br>..
09b0: 4a 4f 49 4e 20 70 72 6f 76 32 30 31 31 20 41 53 JOIN prov2011 AS
09c0: 20 70 20 4f 4e 20 28 63 2e 63 6f 64 5f 70 72 6f p ON (c.cod_pro
09d0: 20 3d 20 70 2e 63 6f 64 5f 70 72 6f 29 3c 62 72 = p.cod_pro)<br
09e0: 3e 0d 0a 4a 4f 49 4e 20 72 65 67 32 30 31 31 20 >..JOIN reg2011
09f0: 41 53 20 72 20 4f 4e 20 28 63 2e 63 6f 64 5f 72 AS r ON (c.cod_r
0a00: 65 67 20 3d 20 72 2e 63 6f 64 5f 72 65 67 29 3c eg = r.cod_reg)<
0a10: 62 72 3e 0d 0a 57 48 45 52 45 20 63 2e 63 6f 64 br>..WHERE c.cod
0a20: 5f 72 65 67 20 3d 20 39 3c 62 72 3e 0d 0a 4f 52 _reg = 9<br>..OR
0a30: 44 45 52 20 42 59 20 63 2e 6e 6f 6d 65 5f 63 6f DER BY c.nome_co
0a40: 6d 20 44 45 53 43 3c 2f 74 64 3e 3c 74 64 20 61 m DESC</td><td a
0a50: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f lign="right">1</
0a60: 74 64 3e 3c 74 64 3e 73 75 63 63 65 73 73 3c 2f td><td>success</
0a70: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c td></tr>..</tabl
0a80: 65 3e 3c 62 72 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c e><br>..<ul>..<l
0a90: 69 3e 74 68 65 20 3c 62 3e 69 64 3c 2f 62 3e 20 i>the <b>id</b>
0aa0: 63 6f 6c 75 6d 6e 20 69 73 20 74 68 65 20 3c 75 column is the <u
0ab0: 3e 65 76 65 6e 74 20 49 44 3c 2f 75 3e 20 28 3c >event ID</u> (<
0ac0: 69 3e 50 72 69 6d 61 72 79 20 4b 65 79 3c 2f 69 i>Primary Key</i
0ad0: 3e 2c 20 75 6e 69 71 75 65 6c 79 20 69 64 65 6e >, uniquely iden
0ae0: 74 69 66 79 69 6e 67 20 65 61 63 68 20 73 69 6e tifying each sin
0af0: 67 6c 65 20 53 51 4c 20 53 74 61 74 65 6d 65 6e gle SQL Statemen
0b00: 74 20 69 6e 74 6f 20 74 68 65 20 4c 6f 67 29 2e t into the Log).
0b10: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 20 3c </li>..<li>the <
0b20: 62 3e 74 69 6d 65 5f 73 74 61 72 74 3c 2f 62 3e b>time_start</b>
0b30: 20 61 6e 64 20 3c 62 3e 74 69 6d 65 5f 65 6e 64 and <b>time_end
0b40: 3c 2f 62 3e 20 63 6f 6c 75 6d 6e 73 20 63 6f 6e </b> columns con
0b50: 74 61 69 74 73 20 74 68 65 20 3c 69 3e 74 69 6d taits the <i>tim
0b60: 65 73 74 61 6d 70 73 3c 2f 69 3e 20 6d 65 61 73 estamps</i> meas
0b70: 75 72 65 64 20 69 6d 6d 65 64 69 61 74 65 6c 79 ured immediately
0b80: 20 62 65 66 6f 72 65 20 61 6e 64 20 61 66 74 65 before and afte
0b90: 72 20 65 78 65 63 75 74 69 6e 67 20 74 68 65 20 r executing the
0ba0: 53 51 4c 20 73 74 61 74 65 6d 65 6e 74 20 69 74 SQL statement it
0bb0: 73 65 6c 66 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e self.</li>..<li>
0bc0: 74 68 65 20 3c 62 3e 75 73 65 72 5f 61 67 65 6e the <b>user_agen
0bd0: 74 3c 2f 62 3e 20 63 6f 6c 75 6d 6e 20 69 64 65 t</b> column ide
0be0: 6e 74 69 66 79 20 74 68 65 20 74 6f 6f 6c 20 62 ntify the tool b
0bf0: 65 69 6e 67 20 75 73 65 64 20 74 6f 20 65 78 65 eing used to exe
0c00: 63 75 74 65 64 20 74 68 65 20 53 51 4c 20 73 74 cuted the SQL st
0c10: 61 74 65 6d 65 6e 74 2e 3c 2f 6c 69 3e 0d 0a 3c atement.</li>..<
0c20: 6c 69 3e 74 68 65 20 3c 62 3e 73 71 6c 5f 73 74 li>the <b>sql_st
0c30: 61 74 65 6d 65 6e 74 3c 2f 62 3e 20 63 6f 6c 75 atement</b> colu
0c40: 6d 6e 20 63 6f 6e 74 61 69 6e 73 20 74 68 65 20 mn contains the
0c50: 53 51 4c 20 73 74 61 74 65 6d 65 6e 74 20 62 6f SQL statement bo
0c60: 64 79 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 dy.</li>..<li>th
0c70: 65 20 3c 62 3e 73 75 63 63 65 73 73 3c 2f 62 3e e <b>success</b>
0c80: 20 63 6f 6c 75 6d 6e 20 28 3c 69 3e 62 6f 6f 6c column (<i>bool
0c90: 65 61 6e 3c 2f 69 3e 29 20 74 65 6c 6c 73 20 69 ean</i>) tells i
0ca0: 66 20 74 68 65 20 73 74 61 74 65 6d 65 6e 74 20 f the statement
0cb0: 65 78 65 63 75 74 69 6f 6e 20 77 61 73 20 73 75 execution was su
0cc0: 63 63 65 73 73 66 75 6c 20 6f 72 20 6e 6f 74 2e ccessful or not.
0cd0: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 20 3c </li>..<li>the <
0ce0: 62 3e 65 72 72 6f 72 5f 63 61 75 73 65 3c 2f 62 b>error_cause</b
0cf0: 3e 20 77 69 6c 6c 20 63 6f 6e 74 61 69 6e 20 74 > will contain t
0d00: 68 65 20 3c 75 3e 65 72 72 6f 72 20 6d 65 73 73 he <u>error mess
0d10: 61 67 65 3c 2f 75 3e 20 65 76 65 6e 74 75 61 6c age</u> eventual
0d20: 6c 79 20 72 65 74 75 72 6e 65 64 20 62 79 20 53 ly returned by S
0d30: 51 4c 69 74 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 QLite.</li>..</u
0d40: 6c 3e 3c 62 72 3e 0d 0a 59 6f 75 20 63 61 6e 20 l><br>..You can
0d50: 6c 65 61 72 6e 20 6d 6f 72 65 20 61 62 6f 75 74 learn more about
0d60: 20 74 68 65 20 53 51 4c 20 4c 6f 67 20 61 73 20 the SQL Log as
0d70: 61 63 74 75 61 6c 6c 79 20 69 6d 70 6c 65 6d 65 actually impleme
0d80: 6e 74 65 64 20 62 79 20 74 68 65 20 3c 62 3e 73 nted by the <b>s
0d90: 70 61 74 69 61 6c 69 74 65 5f 67 75 69 3c 2f 62 patialite_gui</b
0da0: 3e 20 61 6e 64 20 3c 62 3e 73 70 61 74 69 61 6c > and <b>spatial
0db0: 69 74 65 20 43 4c 49 3c 2f 62 3e 20 74 6f 6f 6c ite CLI</b> tool
0dc0: 73 20 62 79 20 72 65 61 64 69 6e 67 20 74 68 69 s by reading thi
0dd0: 73 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 s <a href="https
0de0: 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e ://www.gaia-gis.
0df0: 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 it/fossil/libspa
0e00: 74 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d tialite/wiki?nam
0e10: 65 3d 74 6f 6f 6c 73 2d 34 2e 30 22 3e 57 69 6b e=tools-4.0">Wik
0e20: 69 20 70 61 67 65 3c 2f 61 3e 0d 0a 3c 68 34 3e i page</a>..<h4>
0e30: 53 74 72 69 63 74 6c 79 20 72 65 6c 61 74 65 64 Strictly related
0e40: 20 28 61 6e 64 20 72 65 61 6c 6c 79 20 75 73 65 (and really use
0e50: 66 75 6c 29 20 53 51 4c 20 51 75 65 72 79 3c 2f ful) SQL Query</
0e60: 68 34 3e 0d 0a 49 6e 20 6f 72 64 65 72 20 74 6f h4>..In order to
0e70: 20 64 69 72 65 63 74 6c 79 20 67 65 74 20 74 68 directly get th
0e80: 65 20 65 78 65 63 75 74 69 6f 6e 20 74 69 6d 69 e execution timi
0e90: 6e 67 73 20 28 65 78 70 72 65 73 73 65 64 20 69 ngs (expressed i
0ea0: 6e 20 3c 69 3e 6d 69 6c 6c 69 73 65 63 6f 6e 64 n <i>millisecond
0eb0: 73 3c 2f 69 3e 29 20 79 6f 75 20 73 69 6d 70 6c s</i>) you simpl
0ec0: 79 20 68 61 76 65 20 74 6f 20 75 73 65 20 61 6e y have to use an
0ed0: 64 20 53 51 4c 20 71 75 65 72 79 20 6c 69 6b 65 d SQL query like
0ee0: 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6f the following o
0ef0: 6e 65 3a 0d 0a 3c 74 61 62 6c 65 20 62 67 63 6f ne:..<table bgco
0f00: 6c 6f 72 3d 22 23 65 30 65 30 65 30 22 20 63 65 lor="#e0e0e0" ce
0f10: 6c 6c 73 70 61 63 69 6e 67 3d 22 38 22 20 63 65 llspacing="8" ce
0f20: 6c 6c 70 61 64 64 69 6e 67 3d 22 34 22 3e 3c 74 llpadding="4"><t
0f30: 72 3e 0d 0a 3c 74 64 3e 53 45 4c 45 43 54 20 69 r>..<td>SELECT i
0f40: 64 2c 20 4a 75 6c 69 61 6e 44 61 79 28 74 69 6d d, JulianDay(tim
0f50: 65 5f 65 6e 64 29 20 2d 20 4a 75 6c 69 61 6e 44 e_end) - JulianD
0f60: 61 79 28 74 69 6d 65 5f 73 74 61 72 74 29 20 41 ay(time_start) A
0f70: 53 20 6d 69 6c 6c 69 73 2c 20 73 71 6c 5f 73 74 S millis, sql_st
0f80: 61 74 65 6d 65 6e 74 3c 62 72 3e 0d 0a 46 52 4f atement<br>..FRO
0f90: 4d 20 73 71 6c 5f 73 74 61 74 65 6d 65 6e 74 73 M sql_statements
0fa0: 5f 6c 6f 67 3c 62 72 3e 0d 0a 57 48 45 52 45 20 _log<br>..WHERE
0fb0: 73 75 63 63 65 73 73 20 3d 20 31 3b 0d 0a 3c 2f success = 1;..</
0fc0: 74 64 3e 3c 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e td></tr></table>
0fd0: 3c 62 72 3e 0d 0a 3c 68 72 3e 3c 62 72 3e 0d 0a <br>..<hr><br>..
0fe0: 42 61 63 6b 20 74 6f 20 3c 61 20 68 72 65 66 3d Back to <a href=
0ff0: 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 "https://www.gai
1000: 61 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f a-gis.it/fossil/
1010: 6c 69 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69 libspatialite/wi
1020: 6b 69 3f 6e 61 6d 65 3d 73 77 69 74 63 68 69 6e ki?name=switchin
1030: 67 2d 74 6f 2d 34 2e 30 23 73 71 6c 6c 6f 67 22 g-to-4.0#sqllog"
1040: 3e 6d 61 69 6e 20 70 61 67 65 3c 2f 61 3e 0a 5a >main page</a>.Z
1050: 20 34 62 65 61 35 61 63 31 63 32 37 31 33 34 63 4bea5ac1c27134c
1060: 37 35 39 31 33 65 62 30 39 30 61 66 32 34 35 31 75913eb090af2451
1070: 32 0a 2.