calling user defined function with parameters..

Поиск
Список
Период
Сортировка
От Postgresql
Тема calling user defined function with parameters..
Дата
Msg-id 9gfklv$120h$1@news.tht.net
обсуждение исходный текст
Ответы Re: calling user defined function with parameters..  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-sql
Hi,

I've created a function like this :

CREATE FUNCTION tester(INT4)
RETURNS BOOL AS
'
DECLAREr RECORD;p ALIAS FOR $1;

BEGINSELECT INTO r id_dptFROM dptsWHERE id_dpt=p;
IF NOT FOUND THEN RETURN FALSE;  ELSE
   RETURN TRUE;END IF;
END;
'
LANGUAGE 'plpgsql';

All is ok at creation.
But now , how can i use my function ? i would like a thing like :

SELECT tester(14) AS ok;

But is make a Postgresql parser error

How to do then ??

Thanks for any help or links (other than the postgresql.org website...) !

;)

Regards,

Fred






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

Предыдущее
От: Guru Prasad
Дата:
Сообщение: Postgres
Следующее
От: John Scott
Дата:
Сообщение: not null - trivial, unexpected behavior