I'm trying to test my Java application. To accomplish this I run a script that should insert a test account in the database, if it not exists. If it exists, I want it to update fields (to the first values).
I tried it with:
INSERT INTO address
(perident, street, number, pcode, city, telephone, email, eori, iban )
(!) VALUES
('jdoe', 'Fill in your own address information', NULL, NULL, NULL, NULL, NULL, NULL, NULL)
ON DUPLICATE KEY UPDATE
perident = 'jdoe', street = 'Fill in your own address information', number = NULL, pcode = NULL, city = NULL,
telephone = NULL, email = NULL, eori = NULL, iban = NULL);
I get the error
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 2 (at the '(!) ')