SQLite VDBE opcode

Multiply

Multiply the value in register P1 by the value in register P2 and store the result in register P3.

An example

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

SELECT total FROM sales
addropcodep1p2p3p4p5
0Init01200
1OpenRead017040
2Rewind01100
3IfNullRow0910
4Column0220
5Column0330
6RealAffinity3000
7Multiply3210
8TypeCheck116sales0
9ResultRow1100
10Next0301
11Halt0000
12Transaction00101
13Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Column, Goto, Halt, IfNullRow, Init, Next, OpenRead, RealAffinity, ResultRow, Rewind, Transaction, TypeCheck.

What the SQLite documentation says

Multiply the value in register P1 by the value in register P2 and store the result in register P3. If either input is NULL, the result is NULL.

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.

← Move · MustBeInt →