E
E
Evgen_3332212019-09-15 22:14:55
PostgreSQL
Evgen_333221, 2019-09-15 22:14:55

Can't create procedure in PostgreSQL. What to do?

create table Product
(
    "ID product" int primary key,
    "Name"       varchar(40),
    "Price"      int,
    "Count"      int
);

CREATE procedure adding(id_product int, name_product varchar(40), price_product int, count_product int)
    LANGUAGE plpgsql
AS
$$
BEGIN
    insert into Product("ID product", "Name", "Price", "Count")
    values (id_product, name_product, price_product, count_product);
END;
$$;
CALL adding(221, 'Milk', 67, 78);

Текст ошибки: [42601] ERROR: syntax error at or near "PROCEDURE"
Не понимаю в чем дело

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2019-09-16
@melkij

Check your postgresql version.
The CREATE PROCEDURE and CALL syntax is only present in postgresql 11 and newer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question