VCreate
P2 is a register that holds the name of a virtual table in database P1.
An example
1 of the 178 statements we compiled against the sample database use VCreate. This is the one with the shortest program; the rows that use VCreate are highlighted.
CREATE VIRTUAL TABLE v2 USING fts3(x)
| addr | opcode | p1 | p2 | p3 | p4 | p5 |
|---|---|---|---|---|---|---|
| 0 | Init | 0 | 31 | 0 | 0 | |
| 1 | VBegin | 0 | 0 | 0 | 0 | |
| 2 | ReadCookie | 0 | 3 | 2 | 0 | |
| 3 | If | 3 | 6 | 0 | 0 | |
| 4 | SetCookie | 0 | 2 | 4 | 0 | |
| 5 | SetCookie | 0 | 5 | 1 | 0 | |
| 6 | Integer | 0 | 2 | 0 | 0 | |
| 7 | OpenWrite | 0 | 1 | 0 | 5 | 0 |
| 8 | NewRowid | 0 | 1 | 0 | 0 | |
| 9 | Blob | 6 | 3 | 0 | 0 | |
| 10 | Insert | 0 | 3 | 1 | 8 | |
| 11 | Close | 0 | 0 | 0 | 0 | |
| 12 | Null | 0 | 4 | 5 | 0 | |
| 13 | Noop | 2 | 0 | 4 | 0 | |
| 14 | OpenWrite | 1 | 1 | 0 | 5 | 0 |
| 15 | SeekRowid | 1 | 17 | 1 | 0 | |
| 16 | Rowid | 1 | 5 | 0 | 0 | |
| 17 | IsNull | 5 | 25 | 0 | 0 | |
| 18 | String8 | 0 | 6 | 0 | table | 0 |
| 19 | String8 | 0 | 7 | 0 | v2 | 0 |
| 20 | String8 | 0 | 8 | 0 | v2 | 0 |
| 21 | Integer | 0 | 9 | 0 | 0 | |
| 22 | String8 | 0 | 10 | 0 | CREATE VIRTUAL TABLE v2 USING fts3(x) | 0 |
| 23 | MakeRecord | 6 | 5 | 4 | BBBDB | 0 |
| 24 | Insert | 1 | 4 | 5 | 0 | |
| 25 | SetCookie | 0 | 1 | 2 | 0 | |
| 26 | Expire | 0 | 0 | 0 | 0 | |
| 27 | ParseSchema | 0 | 0 | 0 | name='v2' AND sql='CREATE VIRTUAL TABLE v2 USING fts3(x)' | 0 |
| 28 | String8 | 0 | 12 | 0 | v2 | 0 |
| 29 | VCreate | 0 | 12 | 0 | 0 | |
| 30 | Halt | 0 | 0 | 0 | 0 | |
| 31 | Transaction | 0 | 1 | 1 | 0 | 1 |
| 32 | Goto | 0 | 1 | 0 | 0 |
Open it in the EXPLAIN visualizer →
Also in this program: Blob, Close, Expire, Goto, Halt, If, Init, Insert, Integer, IsNull, MakeRecord, NewRowid, Noop, Null, OpenWrite, ParseSchema, ReadCookie, Rowid, SeekRowid, SetCookie, String8, Transaction, VBegin.
What the SQLite documentation says
P2 is a register that holds the name of a virtual table in database P1. Call the xCreate method for that 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.