SQLite VDBE opcode

Ne

This works just like the Eq opcode except that the jump is taken if the operands in registers P1 and P3 are not equal.

Jumps: P2 is an instruction address. In the listings here, a jump is drawn as an arc and the address is a link.

An example

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

DROP VIEW album_lengths
addropcodep1p2p3p4p5
0Init01400
1Null0100
2OpenWrite01050
3Rewind01100
4Column0220
5Ne3102BINARY-882
6Column0020
7Eq4102BINARY-882
8Rowid0500
9Delete0002
10Next0401
11DropTable000album_lengths0
12SetCookie0120
13Halt0000
14Transaction01101
15String8030album_lengths0
16String8040trigger0
17Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Column, Delete, DropTable, Eq, Goto, Halt, Init, Next, Null, OpenWrite, Rewind, Rowid, SetCookie, String8, Transaction.

What the SQLite documentation says

This works just like the Eq opcode except that the jump is taken if the operands in registers P1 and P3 are not equal. See the Eq opcode for additional information.

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.

← MustBeInt · NewRowid →