A
A
akmubi2019-10-07 22:30:00
SQL
akmubi, 2019-10-07 22:30:00

SQL query gives error #1064?

Good day. Please tell me what is wrong here. I'm trying to create a display model. I'm just getting started with SQL.

DROP
PROCEDURE IF EXISTS `Задание в заказе`;
CREATE PROCEDURE `Задание в заказе`(IN `@Ид\Заказ` INT)
BEGIN
    SELECT
        `З`.`Регномер` AS `Регномер (задания)`,
        `С`.`Код` AS `Код (вида задания)`,
        `С`.`Название` AS `Название (вида задания)`,
        `З`.`Содержание` AS `Содержание (задания)`,
        `З`.`Цена` AS `Цена (задания)`
    FROM
        `Задание` `З`
    INNER JOIN `Справочник` `С` ON
        `З`.`Ид\Вид задания` = `С`.`Ид`
    WHERE
        `З`.`Ид\Заказ` = `@Ид\Заказ`;
END

Mistake:
#1064 - У вас ошибка в запросе. Изучите документацию по используемой версии MySQL на предмет корректного синтаксиса около '' на строке 14

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2019-10-08
@akmubi

You have not redefined the end-of-request character, because of this, the CREATE PROCEDURE request ends at the first semicolon.

DELIMITER $$
CREATE PROCEDURE ...
BEGIN
...
END$$
DELIMITER ;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question