SQLite VDBE opcode

IfNot

Jump to P2 if the value in register P1 is False.

Jumps: P2 is an instruction address. In the listings here, a jump is drawn as an arc and the address is a link.

An example

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

SELECT name FROM artists LIMIT ?
addropcodep1p2p3p4p5
0Init01100
1Variable1100
2MustBeInt1000
3IfNot11000
4OpenRead160k(2,,)0
5Rewind110200
6Column1020
7ResultRow2100
8DecrJumpZero11000
9Next1601
10Halt0000
11Transaction00101
12Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Column, DecrJumpZero, Goto, Halt, Init, MustBeInt, Next, OpenRead, ResultRow, Rewind, Transaction, Variable.

What the SQLite documentation says

Jump to P2 if the value in register P1 is False. The value is considered false if it has a numeric value of zero. If the value in P1 is NULL then take the jump if and only if P3 is non-zero.

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.

← IfNoHope · IfNotZero →