SQLite VDBE opcode

VColumn

Store in register P3 the value of the P2-th column of the current row of the virtual-table of cursor P1.

An example

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

SELECT value FROM json_each('[1, 2, 3]')
addropcodep1p2p3p4p5
0Init01000
1VOpen000vtab:51FAF00
2String8030[1, 2, 3]0
3Integer1100
4Integer1200
5VFilter0910
6VColumn0140
7ResultRow4100
8VNext0600
9Halt0000
10Transaction00101
11Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Goto, Halt, Init, Integer, ResultRow, String8, Transaction, VFilter, VNext, VOpen.

What the SQLite documentation says

Store in register P3 the value of the P2-th column of the current row of the virtual-table of cursor P1.

If the VColumn opcode is being used to fetch the value of an unchanging column during an UPDATE operation, then the P5 value is OPFLAG_NOCHNG. This will cause the sqlite3_vtab_nochange() function to return true inside the xColumn method of the virtual table implementation. The P5 column might also contain other bits (OPFLAG_LENGTHARG or OPFLAG_TYPEOFARG) but those bits are unused by VColumn.

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.

← VCheck · VCreate →