Error executing SQL query

I have an SQL query that I cannot execute, this error appears:

  To disable safe mode, switch the option in the settings β†’ SQL Editor β†’ Query Editor and reconnect. You are using safe update mode, and you tried updating the table without WHERE, which uses the KEY column

My request:

update customfieldvalue
set stringvalue="****"
where customfieldvalue.customfield IN 
(select customfield.id 
from customfield 
where customfield.cfname="Resoltion" 
and customfieldvalue.issue=12345);

how can i fix this problem because in my production environment i cannot do this manipulation? PS: I am using mysql

+3
source share
4 answers

To disable it only for the current session:

SET SQL_SAFE_UPDATES=0;
+2
source

To fix this problem:

: "" β†’ " SQL" β†’ " " .

:

, WHERE, KEY

( ? )

0

If you cannot disable secure update in production, you will have to rework the request to use at least one key column in customfieldvalue. Without it, you will perform a table scan; using key column # 1, you can get the logical equivalent ( WHERE customfieldvalue.keycol1 IS NOT NULL), but this will comply with the safe update restrictions.

0
source
SET SQL_SAFE_UPDATES=0;
update customfieldvalue
set stringvalue="****"
where customfieldvalue.customfield IN 
(select customfield.id 
from customfield 
where customfield.cfname="Resoltion" 
and customfieldvalue.issue=12345);
0
source

All Articles