You have an error in your SQL syntax

di p0ll0_ il
4 risposte
UPDATE table_settings
SET product_code = true,
SET description = true,
SET amount = true,
SET price = true,
SET total = true,
SET expiration_date = true,
SET input_date = true,
SET last_edit_date = true,
SET input_user = true,
SET last_edit_user = true,
SET field = true,
SET notes = true,
SET photos = false,
SET brand = false
WHERE user='admin'; 

java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SET description = true,
SET amount = true,
SET price = true,
SET total = true...' at line 3


Description risulta essere un boolean, quindi non capisco che cosa c'è che non va, mi pare anche di aver scritto giusta la variabile. Aiuti?

4 Risposte

  • Studiati la sintassi dello statement UPDATE, l'errore e' BANALE!
  • La sintassi coretta è la seguente:
    UPDATE tabella1
    SET colonna1 = valore1, colonna2 = valore2, ... etc
    WHERE condizione; 
  • Adesso ho provato con mysql workbench e funziona. Grazie comunque.
  • Che vuoi dire? Ti funziona la prima versione o l 'hai corretta?
Devi accedere o registrarti per scrivere nel forum
4 risposte