SQLite VDBE opcode

AddImm

Add the constant P2 to the value in register P1.

An example

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

PRAGMA incremental_vacuum
addropcodep1p2p3p4p5
0Init0800
1Expire1100
2Integer2147483647100
3IncrVacuum0700
4ResultRow1000
5AddImm1-100
6IfPos1300
7Halt0000
8Transaction01101
9Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Expire, Goto, Halt, IfPos, IncrVacuum, Init, Integer, ResultRow, Transaction.

What the SQLite documentation says

Add the constant P2 to the value in register P1. The result is always an integer.

To force any register to be an integer, just add 0.

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.

← Add · Affinity →