1

ここで total_changes() について読むことができます: https://www.sqlite.org/lang_corefunc.html

Spatialite (pyspatialite) への Python インターフェイスを使用しているときに問題が発生しましたが、windows spatialite.exe で問題を再現できます。spatialite.exe total_changes が期待どおりに 0 ではなく、select ステートメントごとに増加することに注意してください。更新、挿入、および削除に対してのみ増加する必要があります。また、sqlite が正しいことにも注意してください。何か提案をいただければ幸いです。

    C:\crs\bde2>spatialite test6.db
    SpatiaLite version ..: 4.2.0    Supported Extensions:
            - 'VirtualShape'        [direct Shapefile access]
            - 'VirtualDbf'          [direct DBF access]
            - 'VirtualXL'           [direct XLS access]
            - 'VirtualText'         [direct CSV/TXT access]
            - 'VirtualNetwork'      [Dijkstra shortest path]
            - 'RTree'               [Spatial Index - R*Tree]
            - 'MbrCache'            [Spatial Index - MBR cache]
            - 'VirtualSpatialIndex' [R*Tree metahandler]
            - 'VirtualXPath'        [XML Path Language - XPath]
            - 'VirtualFDO'          [FDO-OGR interoperability]
            - 'VirtualGPKG' [OGC GeoPackage interoperability]
            - 'VirtualBBox'         [BoundingBox tables]
            - 'SpatiaLite'          [Spatial SQL - OGC]
    PROJ.4 version ......: Rel. 4.8.0, 6 March 2012
    GEOS version ........: 3.4.2-CAPI-1.8.2 r3921
    LWGEOM version ......: 2.1.3
    TARGET CPU ..........: mingw32
    SQLite version ......: 3.8.5
    Enter ".help" for instructions
    SQLite version 3.8.5 2014-06-04 14:06:34
    Enter ".help" for instructions
    Enter SQL statements terminated with a ";"
    spatialite>
    spatialite>
    spatialite> SELECT total_changes() AS 'Total changes';
    1
    spatialite> SELECT total_changes() AS 'Total changes';
    3
    spatialite> .quit

    C:\crs\bde2>sqlite3 test6.db
    SQLite version 3.8.7 2014-10-17 11:24:17
    Enter ".help" for usage hints.
    sqlite>
    sqlite> select total_changes() as 'Total changes';
    0
    sqlite> select total_changes() as 'Total changes';
    0
4

1 に答える 1