SQLite VDBE opcode

Column

Interpret the data that cursor P1 points to as a structure built using the MakeRecord instruction.

An example

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

SELECT name FROM artists WHERE id = 7
addropcodep1p2p3p4p5
0Init0700
1OpenRead02020
2Integer7100
3SeekRowid0610
4Column0120
5ResultRow2100
6Halt0000
7Transaction00101
8Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Goto, Halt, Init, Integer, OpenRead, ResultRow, SeekRowid, Transaction.

What the SQLite documentation says

Interpret the data that cursor P1 points to as a structure built using the MakeRecord instruction. (See the MakeRecord opcode for additional information about the format of the data.) Extract the P2-th column from this record. If there are less than (P2+1) values in the record, extract a NULL.

The value extracted is stored in register P3.

If the record contains fewer than P2 fields, then extract a NULL. Or, if the P4 argument is a P4_MEM use the value of the P4 argument as the result.

If the OPFLAG_LENGTHARG bit is set in P5 then the result is guaranteed to only be used by the length() function or the equivalent. The content of large blobs is not loaded, thus saving CPU cycles. If the OPFLAG_TYPEOFARG bit is set then the result will only be used by the typeof() function or the IS NULL or IS NOT NULL operators or the equivalent. In this case, all content loading can be omitted.

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.

← CollSeq · ColumnsUsed →