Compile error in function

Поиск
Список
Период
Сортировка
От big_mafa
Тема Compile error in function
Дата
Msg-id 001b01c3642d$229d83c0$1701a8c0@attila
обсуждение исходный текст
Ответы Re: Compile error in function  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-novice
Hi!

There is a very annoying problem.
I created a very simple function, which can be created well, but if I call
it, the following problem occurs:
ERROR:  parse error at or near "IF"
WARNING:  plpgsql: ERROR during compile of cre_kitchen_log near line 1

The Function is:

CREATE OR REPLACE FUNCTION "public"."cre_kitchen_log" (date) RETURNS integer
AS'
IF not exists(select count(*) from kitchenlog where dat = $1) THEN
insert into kitchenlog(dat,prodid) select $1 , id from products where
incl=''T'';
END IF;
select 1 as result;
'LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY DEFINER;


I created this function using EMS PostgreSQLManager. I Copied it to pgsql
(to be sure, there is no CR/LF in code) - but the result is the same.

Could someone help me? Thanks! Attila



В списке pgsql-novice по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: using procedural languages...
Следующее
От: "big_mafa"
Дата:
Сообщение: Re: Compile error in function