The SQLite statement INSERT OR REPLACE INTO replaces the row if it already exists. But when I run the same statement again and again, it keeps on inserting instead of replacing.
In what case does REPLACE actually occur?
INSERT OR REPLACE INTO names (rollno, name) VALUES (1, "Adam")
The replace occurs if the row you want to insert has the same PRIMARY KEY as another in your table.
You probably forgot to define a primary key.