SQLite VDBE opcode

String8

P4 points to a nul terminated UTF-8 string.

An example

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

SELECT 'hello'
addropcodep1p2p3p4p5
0Init0400
1String8010hello0
2ResultRow1100
3Halt0000
4Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Goto, Halt, Init, ResultRow.

What the SQLite documentation says

P4 points to a nul terminated UTF-8 string. This opcode is transformed into a String opcode before it is executed for the first time. During this transformation, the length of string P4 is computed and stored as the P1 parameter.

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.

← String · Subtract →