SQLite VDBE opcode

SqlExec

Run the SQL statement or statements specified in the P4 string.

An example

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

PRAGMA optimize
addropcodep1p2p3p4p5
0Init02500
1Expire1100
2OpenRead0160k(2,,)0
3Rewind0500
4SqlExec220000ANALYZE "main"."playlist_tracks"0
5OpenRead023060
6Rewind0800
7SqlExec220000ANALYZE "main"."lyrics_segdir"0
8OpenRead013030
9Rewind01100
10SqlExec220000ANALYZE "main"."playlists"0
11OpenRead090k(1,)0
12Rewind01400
13SqlExec220000ANALYZE "main"."genres"0
14OpenRead017040
15Rewind01700
16SqlExec220000ANALYZE "main"."sales"0
17OpenRead02030
18Rewind02000
19SqlExec220000ANALYZE "main"."artists"0
20OpenRead04060
21Rewind02300
22SqlExec220000ANALYZE "main"."tracks"0
23Expire0000
24Halt0000
25Transaction01101
26Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Expire, Goto, Halt, Init, OpenRead, Rewind, Transaction.

What the SQLite documentation says

Run the SQL statement or statements specified in the P4 string.

The P1 parameter is a bitmask of options:

0x0001 Disable Auth and Trace callbacks while the statements in P4 are running.

0x0002 Set db->nAnalysisLimit to P2 while the statements in P4 are running.

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.

← SorterSort · String →