PLPGSQL - FUNCTION CREATION

Поиск
Список
Период
Сортировка
От Andy Hallam
Тема PLPGSQL - FUNCTION CREATION
Дата
Msg-id 9p1fcr$i0n$1@news.tht.net
обсуждение исходный текст
Список pgsql-general
Hi all.

I'm trying to write a function to update a TIMESTAMP column.

MY TABLE SCHEMA:

CREATE TABLE UserLog
(
    UserName NCHAR(20) NOT NULL,
    ModifiedTimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)

What I want to do is that when a record is updated the ModifiedTimeStamp
column is updated to the current time.

Looking through the docs - great - create a function to do this - great -
Ohh no!

MY FUNCTION:

CREATE FUNCTION NewTimeStamp () RETURNS OPAQUE AS '
BEGIN
    NEW.ModifiedTimeStamp := ''now'';
    RETURN NEW;
END;
' LANGUAGE 'plpgsql';

When I execute the CREATE FUNCTION statement I get the following error:

Error: Error while executing the query;
ERROR: Unrecognized language specified in a CREATE FUNCTION: 'plpgsql'.
Recognized languages are sql, C, internal, and created procedural languages.
(State:S1000, Native Code: 7)


Help!





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

Предыдущее
От: frederic massot
Дата:
Сообщение: Re: Problem with the accents
Следующее
От: Nalin Dahyabhai
Дата:
Сообщение: Re: Encoding passwords