SQLite VDBE opcode

Param

This opcode is only ever present in sub-programs called via the Program instruction.

An example

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

UPDATE tracks SET price = 1.29 WHERE id = 5
addropcodep1p2p3p4p5
0Init02500
1Null0120
2Noop3010
3OpenWrite04060
4Integer51600
5SeekRowid07160
6Rowid0200
7IsNull22400
8Rowid0300
9Null0400
10Null0500
11Null0600
12Null0700
13Null0800
14Copy2900
15Null01000
16Column01110
17Column02120
18Column03130
19Column04140
20Real1717986921510729973350
21MakeRecord1061DDBDDE0
22Insert019tracks5
23Program22417program1
24Halt0000
25Transaction01101
26Goto0100
0Init010-- TRIGGER tracks_touch0
1Trace214748364710-- UPDATE albums SET year = year WHERE id = new.album_id0
2Null0120
3Noop1010
4OpenWrite03040
5Param9700
6SeekRowid0870
7Rowid0200
8IsNull21500
9Null0300
10Column0140
11Column0250
12Column0360
13MakeRecord341DDBD0
14Insert012albums5
15ResetCount0000
16Halt0000

Open it in the EXPLAIN visualizer →

Also in this program: Column, Copy, Goto, Halt, Init, Insert, Integer, IsNull, MakeRecord, Noop, Null, OpenWrite, Program, Real, ResetCount, Rowid, SeekRowid, Trace, Transaction.

What the SQLite documentation says

This opcode is only ever present in sub-programs called via the Program instruction. Copy a value currently stored in a memory cell of the calling (parent) frame to cell P2 in the current frames address space. This is used by trigger programs to access the new.* and old.* values.

The address of the cell in the parent frame is determined by adding the value of the P1 argument to the value of the P1 argument to the calling Program instruction.

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.

← Pagecount · ParseSchema →