I want to execute something like this:
UPDATE grades SET status="pass" WHERE recno=123;
However, I want the user account doing the update to have write-only access to the database which means it does not have SELECT access. This causes the WHERE clause to fail.
If necessary, I can actually re-write the entire record, but recno is the primary key, which would cause the write to fail. Is there a way to do
INSERT INTO grades (recno,name,status,...) VALUES (123, 'chemistry', 'pass',...)
ON DUPLICATE KEY UPDATE <everything>;
or is this the wrong approach? Besides, it's not the general solution to the "update a specific field in a specific record" problem.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…