SQLite VDBE opcode

HaltIfNull

Check the value in register P3.

An example

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

INSERT OR REPLACE INTO genres VALUES ('Jazz', 'Swing')
addropcodep1p2p3p4p5
0Init01200
1OpenWrite190k(1,)0
2String8020Jazz0
3String8030Swing0
4Null0100
5HaltIfNull129922genres.name1
6Affinity220BB0
7SCopy2500
8SCopy3600
9MakeRecord5240
10IdxInsert145117
11Halt0000
12Transaction01101
13Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Affinity, Goto, Halt, IdxInsert, Init, MakeRecord, Null, OpenWrite, SCopy, String8, Transaction.

What the SQLite documentation says

Check the value in register P3. If it is NULL then Halt using parameter P1, P2, and P4 as if this were a Halt instruction. If the value in register P3 is not NULL, then this routine is a no-op. The P5 parameter should be 1.

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.

← Halt · IdxDelete →