Problem with UPDATE mysql

1

I have a problem executing an UPDATE command in my Database ...

My table has 2 columns:
-Column 1: link (PK) varchar
-Column 2: statuz varchar

I need to update only the "statuz" field in my table.

  

* change the value from "NEW" to "VISUALIZED"

Here's the SQL I'm using:

UPDATE toyota_base SET statuz = 'VISUALIZADO' WHERE link = '/comprar/toyota/etios/1-3-x-16v-flex-4p-manual/4-portas/2013/14102343';

Theproblem:

Theupdateisnotworking...Iexecutethecommand,butithasnoeffect.

TheoutputoftheDBMSindicatesthattherewasnosyntaxerrorandthecommandwasexecuted,however:0Row(s)Affected

I ask you for help in resolving this.

    
asked by anonymous 27.06.2015 / 09:00

2 answers

2

Unravel the mystery!

  

* If someone has this same problem, here is the solution I found:

Instead of using:

WHERE campo = 'link';

I used:

WHERE campo like '%link%';
Ready! That way the table was updated as I needed it.

    
27.06.2015 / 09:28
1

You can use

TRIM(CAMPO) = TRIM('VALOR')

To remove whitespace, remembering that the "=" operator makes an exact comparison and considers whitespace as a character.

    
27.06.2015 / 13:53