D
D
Dmitry2017-05-14 11:13:50
MySQL
Dmitry, 2017-05-14 11:13:50

What does error 1064 mean in MySQL?

I'm trying to create a trigger. I think the essence of the trigger is clear

DELIMITER |
CREATE TRIGGER `setBusyForRoom` AFTER INSERT ON `accommodation` FOR EACH ROW 
BEGIN
  UPDATE TABLE `rooms` 
  SET `rooms`.`room_status` = 'Занят' 
  WHERE `rooms`.`id_room` = `accommodation`.`id_room`
END
DELIMITER ;

As a result, this is the error:
a0e5b4b05e844855b59d696371b96035.png
I googled, 1064 basically means a syntax error, but usually it is explicitly written, and #1064 -I have no idea what it means. If this is a syntax error, what am I doing wrong?
PS: I tried to write with DELIMITERand without, put in different places ;and all that
UPD: room_status this is ENUM()with four text values

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2017-05-14
@letehaha

Look in the console.
And from the obvious:
The parser will not understand what accommodation is. If you wanted to write about the updated string that provoked the call of this trigger, then there are NEW and OLD pseudo-strings for this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question