RowData
Write into register P2 the complete row content for the row at which cursor P1 is currently pointing.
An example
2 of the 178 statements we compiled against the sample database use RowData. This is the one with the shortest program; the rows that use RowData are highlighted.
WITH RECURSIVE n(i) AS (SELECT 1 UNION ALL SELECT i + 1 FROM n WHERE i < 10) SELECT i FROM n
| addr | opcode | p1 | p2 | p3 | p4 | p5 |
|---|---|---|---|---|---|---|
| 0 | Init | 0 | 29 | 0 | 0 | |
| 1 | InitCoroutine | 1 | 23 | 2 | 0 | |
| 2 | OpenPseudo | 1 | 2 | 1 | 0 | |
| 3 | OpenEphemeral | 2 | 1 | 0 | 0 | |
| 4 | Integer | 1 | 3 | 0 | 0 | |
| 5 | MakeRecord | 3 | 1 | 4 | 0 | |
| 6 | NewRowid | 2 | 5 | 0 | 0 | |
| 7 | Insert | 2 | 4 | 5 | 8 | |
| 8 | Rewind | 2 | 22 | 0 | 0 | |
| 9 | NullRow | 1 | 0 | 0 | 0 | |
| 10 | RowData | 2 | 2 | 0 | 0 | |
| 11 | Delete | 2 | 0 | 0 | 0 | |
| 12 | Column | 1 | 0 | 6 | 0 | |
| 13 | Yield | 1 | 0 | 0 | 0 | |
| 14 | Column | 1 | 0 | 4 | 0 | |
| 15 | Ge | 7 | 21 | 4 | BINARY-8 | 80 |
| 16 | Column | 1 | 0 | 4 | 0 | |
| 17 | Add | 8 | 4 | 3 | 0 | |
| 18 | MakeRecord | 3 | 1 | 4 | 0 | |
| 19 | NewRowid | 2 | 5 | 0 | 0 | |
| 20 | Insert | 2 | 4 | 5 | 8 | |
| 21 | Goto | 0 | 8 | 0 | 0 | |
| 22 | EndCoroutine | 1 | 0 | 0 | 0 | |
| 23 | InitCoroutine | 1 | 0 | 2 | 0 | |
| 24 | Yield | 1 | 28 | 0 | 0 | |
| 25 | Copy | 6 | 9 | 0 | 2 | |
| 26 | ResultRow | 9 | 1 | 0 | 0 | |
| 27 | Goto | 0 | 24 | 0 | 0 | |
| 28 | Halt | 0 | 0 | 0 | 0 | |
| 29 | Integer | 10 | 7 | 0 | 0 | |
| 30 | Integer | 1 | 8 | 0 | 0 | |
| 31 | Goto | 0 | 1 | 0 | 0 |
Open it in the EXPLAIN visualizer →
Also in this program: Add, Column, Copy, Delete, EndCoroutine, Ge, Goto, Halt, Init, InitCoroutine, Insert, Integer, MakeRecord, NewRowid, NullRow, OpenEphemeral, OpenPseudo, ResultRow, Rewind, Yield.
What the SQLite documentation says
Write into register P2 the complete row content for the row at which cursor P1 is currently pointing. There is no interpretation of the data. It is just copied onto the P2 register exactly as it is found in the database file.
If cursor P1 is an index, then the content is the key of the row. If cursor P2 is a table, then the content extracted is the data.
If the P1 cursor must be pointing to a valid row (not a NULL row) of a real table, not a pseudo-table.
If P3!=0 then this opcode is allowed to make an ephemeral pointer into the database page. That means that the content of the output register will be invalidated as soon as the cursor moves - including moves caused by other cursors that "save" the current cursors position in order that they can write to the same table. If P3==0 then a copy of the data is made into memory. P3!=0 is faster, but P3==0 is safer.
If P3!=0 then the content of the P2 register is unsuitable for use in OP_Result and any OP_Result will invalidate the P2 register content. The P2 register content is invalidated by opcodes like Function or by any use of another cursor pointing to the same table.
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.