SQLite VDBE opcode

Null

Write a NULL into registers P2.

An example

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

SELECT NULL
addropcodep1p2p3p4p5
0Init0400
1Null0100
2ResultRow1100
3Halt0000
4Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Goto, Halt, Init, ResultRow.

What the SQLite documentation says

Write a NULL into registers P2. If P3 greater than P2, then also write NULL into register P3 and every register in between P2 and P3. If P3 is less than P2 (typically P3 is zero) then only register P2 is set to NULL.

If the P1 value is non-zero, then also set the MEM_Cleared flag so that NULL values will not compare equal even if SQLITE_NULLEQ is set on Ne or Eq.

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.

← NotNull · NullRow →