SQLite Forum

content of field must not be identical to another column name of same table for UPDATE SET to work
Login
UPDATE images SET w=700, h=498 WHERE dir="0203" and file="h";
UPDATE images SET w=397, h=600 WHERE dir="0241" and file="w";
UPDATE images SET w=400, h=600 WHERE dir="0326" and file="h";
UPDATE images SET w=1024, h=683 WHERE dir="0342" and file="h";

do not work: w, h remain NULL

renaming the columns works:

UPDATE images SET width=700, height=498 WHERE dir="0203" and file="h";
UPDATE images SET width=397, height=600 WHERE dir="0241" and file="w";
UPDATE images SET width=400, height=600 WHERE dir="0326" and file="h";
UPDATE images SET width=1024, height=683 WHERE dir="0342" and file="h";

CREATE TABLE images (
	dir CHAR[10] NOT NULL,
	file CHAR[50] NOT NULL,
	width INTEGER,
	height INTEGER,
	models TEXT,
	themes TEXT
);