FkCounter
Increment a "constraint counter" by P2 (P2 may be negative or positive).
An example
7 of the 178 statements we compiled against the sample database use FkCounter. This is the one with the shortest program; the rows that use FkCounter are highlighted.
DELETE FROM artists WHERE id = 3
| addr | opcode | p1 | p2 | p3 | p4 | p5 |
|---|---|---|---|---|---|---|
| 0 | Init | 0 | 23 | 0 | 0 | |
| 1 | Null | 0 | 1 | 0 | 0 | |
| 2 | OpenWrite | 0 | 2 | 0 | 3 | 0 |
| 3 | Integer | 3 | 2 | 0 | 0 | |
| 4 | SeekRowid | 0 | 22 | 2 | 0 | |
| 5 | Rowid | 0 | 3 | 0 | 0 | |
| 6 | OpenWrite | 1 | 7 | 0 | k(2,,) | 8 |
| 7 | OpenWrite | 2 | 6 | 0 | k(2,,) | 8 |
| 8 | Copy | 3 | 4 | 0 | 0 | |
| 9 | OpenRead | 3 | 3 | 0 | 2 | 0 |
| 10 | Rewind | 3 | 15 | 0 | 0 | |
| 11 | Column | 3 | 1 | 8 | 0 | |
| 12 | Ne | 4 | 14 | 8 | BINARY-8 | 83 |
| 13 | FkCounter | 0 | 1 | 0 | 0 | |
| 14 | Next | 3 | 11 | 0 | 1 | |
| 15 | Column | 0 | 1 | 8 | 0 | |
| 16 | PureFunc | 0 | 8 | 10 | lower(1) | 32 |
| 17 | Rowid | 0 | 11 | 0 | 0 | |
| 18 | IdxDelete | 1 | 10 | 0 | artists_lower | 2 |
| 19 | Column | 0 | 1 | 10 | 0 | |
| 20 | IdxDelete | 2 | 10 | 0 | artists_name | 2 |
| 21 | Delete | 0 | 1 | 0 | artists | 0 |
| 22 | Halt | 0 | 0 | 0 | 0 | |
| 23 | Transaction | 0 | 1 | 1 | 0 | 1 |
| 24 | Goto | 0 | 1 | 0 | 0 |
Open it in the EXPLAIN visualizer →
Also in this program: Column, Copy, Delete, Goto, Halt, IdxDelete, Init, Integer, Ne, Next, Null, OpenRead, OpenWrite, PureFunc, Rewind, Rowid, SeekRowid, Transaction.
What the SQLite documentation says
Increment a "constraint counter" by P2 (P2 may be negative or positive). If P1 is non-zero, the database constraint counter is incremented (deferred foreign key constraints). Otherwise, if P1 is zero, the statement counter is incremented (immediate foreign key constraints).
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.