SQLite VDBE opcode

ZeroOrNull

If both registers P1 and P3 are NOT NULL, then store a zero in register P2.

An example

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

SELECT NOT (id > 5) FROM tracks
addropcodep1p2p3p4p5
0Init01100
1OpenRead1190k(2,,)0
2Rewind110100
3IdxRowid1300
4Integer1200
5Gt47368
6ZeroOrNull3240
7Not2100
8ResultRow1100
9Next1301
10Halt0000
11Transaction00101
12Integer5400
13Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Goto, Gt, Halt, IdxRowid, Init, Integer, Next, Not, OpenRead, ResultRow, Rewind, Transaction.

What the SQLite documentation says

If both registers P1 and P3 are NOT NULL, then store a zero in register P2. If either registers P1 or P3 are NULL then put a NULL in register P2.

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.

← Yield