SQLite VDBE opcode

NotNull

Jump to P2 if the value in register P1 is not NULL.

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

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

SELECT coalesce(country, '?') FROM artists
addropcodep1p2p3p4p5
0Init0900
1OpenRead02030
2Rewind0800
3Column0210
4NotNull1600
5String8010?0
6ResultRow1100
7Next0301
8Halt0000
9Transaction00101
10Goto0100

Open it in the EXPLAIN visualizer →

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

What the SQLite documentation says

Jump to P2 if the value in register P1 is not NULL.

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.

← NotFound · Null →