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
| addr | opcode | p1 | p2 | p3 | p4 | p5 |
|---|---|---|---|---|---|---|
| 0 | Init | 0 | 7 | 0 | 0 | |
| 1 | OpenRead | 0 | 2 | 0 | 2 | 0 |
| 2 | Integer | 7 | 1 | 0 | 0 | |
| 3 | SeekRowid | 0 | 6 | 1 | 0 | |
| 4 | Column | 0 | 1 | 2 | 0 | |
| 5 | ResultRow | 2 | 1 | 0 | 0 | |
| 6 | Halt | 0 | 0 | 0 | 0 | |
| 7 | Transaction | 0 | 0 | 1 | 0 | 1 |
| 8 | Goto | 0 | 1 | 0 | 0 |
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 →