NullRow
Move the cursor P1 to a null row if P2 is 0.
An example
13 of the 178 statements we compiled against the sample database use NullRow. This is the one with the shortest program; the rows that use NullRow are highlighted.
SELECT name FROM artists WHERE id IN (1, 2, 3)
| addr | opcode | p1 | p2 | p3 | p4 | p5 |
|---|---|---|---|---|---|---|
| 0 | Init | 0 | 24 | 0 | 0 | |
| 1 | OpenRead | 0 | 2 | 0 | 2 | 0 |
| 2 | BeginSubrtn | 0 | 2 | 0 | 0 | |
| 3 | Once | 0 | 15 | 0 | 0 | |
| 4 | OpenEphemeral | 1 | 1 | 0 | k(1,) | 0 |
| 5 | Integer | 1 | 3 | 0 | 0 | |
| 6 | MakeRecord | 3 | 1 | 4 | D | 0 |
| 7 | IdxInsert | 1 | 4 | 3 | 1 | 0 |
| 8 | Integer | 2 | 3 | 0 | 0 | |
| 9 | MakeRecord | 3 | 1 | 4 | D | 0 |
| 10 | IdxInsert | 1 | 4 | 3 | 1 | 0 |
| 11 | Integer | 3 | 3 | 0 | 0 | |
| 12 | MakeRecord | 3 | 1 | 4 | D | 0 |
| 13 | IdxInsert | 1 | 4 | 3 | 1 | 0 |
| 14 | NullRow | 1 | 0 | 0 | 0 | |
| 15 | Return | 2 | 3 | 1 | 0 | |
| 16 | Rewind | 1 | 23 | 0 | 0 | |
| 17 | Column | 1 | 0 | 1 | 0 | |
| 18 | IsNull | 1 | 22 | 0 | 0 | |
| 19 | SeekRowid | 0 | 22 | 1 | 0 | |
| 20 | Column | 0 | 1 | 5 | 0 | |
| 21 | ResultRow | 5 | 1 | 0 | 0 | |
| 22 | Next | 1 | 17 | 0 | 0 | |
| 23 | Halt | 0 | 0 | 0 | 0 | |
| 24 | Transaction | 0 | 0 | 1 | 0 | 1 |
| 25 | Goto | 0 | 1 | 0 | 0 |
Open it in the EXPLAIN visualizer →
Also in this program: BeginSubrtn, Column, Goto, Halt, IdxInsert, Init, Integer, IsNull, MakeRecord, Next, Once, OpenEphemeral, OpenRead, ResultRow, Return, Rewind, SeekRowid, Transaction.
What the SQLite documentation says
Move the cursor P1 to a null row if P2 is 0. Any Column operations that occur while the cursor is on the null row will always write a NULL.
If cursor P1 is not previously opened, open it now to a special pseudo-cursor that always returns NULL for every column.
If P2 is not 0, then the nullRow flag on the pseudo-cursor is turned off.
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.