SQLite VDBE opcode

ResetCount

The value of the change counter is copied to the database handle change counter (returned by subsequent calls to sqlite3_changes()).

An example

3 of the 178 statements we compiled against the sample database use ResetCount. This is the one with the shortest program; the rows that use ResetCount are highlighted.

UPDATE tracks SET price = 1.29 WHERE id = 5
addropcodep1p2p3p4p5
0Init02500
1Null0120
2Noop3010
3OpenWrite04060
4Integer51600
5SeekRowid07160
6Rowid0200
7IsNull22400
8Rowid0300
9Null0400
10Null0500
11Null0600
12Null0700
13Null0800
14Copy2900
15Null01000
16Column01110
17Column02120
18Column03130
19Column04140
20Real1717986921510729973350
21MakeRecord1061DDBDDE0
22Insert019tracks5
23Program22417program1
24Halt0000
25Transaction01101
26Goto0100
0Init010-- TRIGGER tracks_touch0
1Trace214748364710-- UPDATE albums SET year = year WHERE id = new.album_id0
2Null0120
3Noop1010
4OpenWrite03040
5Param9700
6SeekRowid0870
7Rowid0200
8IsNull21500
9Null0300
10Column0140
11Column0250
12Column0360
13MakeRecord341DDBD0
14Insert012albums5
15ResetCount0000
16Halt0000

Open it in the EXPLAIN visualizer →

Also in this program: Column, Copy, Goto, Halt, Init, Insert, Integer, IsNull, MakeRecord, Noop, Null, OpenWrite, Param, Program, Real, Rowid, SeekRowid, Trace, Transaction.

What the SQLite documentation says

The value of the change counter is copied to the database handle change counter (returned by subsequent calls to sqlite3_changes()). Then the VMs internal change counter resets to 0. This is used by trigger programs.

From sqlite.org's list of opcodes for SQLite 3.54.1, in the public domain. Opcodes are not a stable interface and change between releases.

← ReopenIdx · ResetSorter →