Re: Function Syntax Help

Поиск
Список
Период
Сортировка
От Raymond O'Donnell
Тема Re: Function Syntax Help
Дата
Msg-id 53AC4C9E.4080409@iol.ie
обсуждение исходный текст
Ответ на Re: Function Syntax Help  (Raymond O'Donnell <rod@iol.ie>)
Список pgsql-general
On 26/06/2014 17:26, Raymond O'Donnell wrote:
> On 25/06/2014 23:19, Dennis Ryan wrote:
>> I having trouble with correct syntax to get this trigger function to
>> compile.  I have tried every combination of removing the ‘;’ characters
>> but the function will not compile.  Can someone tell me what I am doing
>> wrong, I am stumped. I will be adding addition when clauses the case
>> statement once I get this simplified version to compile.
>>
>> I am using 9.3.4, both postgres and psql.
>>
>>
>> CREATE OR REPLACE FUNCTION sn_dm_b.pm_insert_trigger()
>> RETURNS TRIGGER AS $$
>> BEGIN
>>     CASE
>>         WHEN NEW.period =  201001
>>                 THEN INSERT INTO sn_dm_b.pm201001 VALUES (NEW.*);
>
> The problem is the semi-colon after (NEW.*). There isn't one inside a
> CASE construct.

Whoops - Pavel is of course correct - this is a pl/pgsql CASE, not an
SQL one. Sorry - my mistake.

Ray.


--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie


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

Предыдущее
От: Shaun Thomas
Дата:
Сообщение: Re: Function Syntax Help
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Function Syntax Help