Help on some SQL command...

Поиск
Список
Период
Сортировка
От Ang Sei Heng
Тема Help on some SQL command...
Дата
Msg-id Pine.LNX.4.20.0008161610510.2128-100000@leopard.cybersource.com.sg
обсуждение исходный текст
Ответы Re: Help on some SQL command...  (Jesus Aneiros <aneiros@jagua.cfg.sld.cu>)
Список pgsql-sql
Hello to all the SQL gurus...

I have this little table:

test1 (       id char(8) primary key,       name char(20),       create_date timestamp
);

Now, the create_date need to be updated
to date and time whenever id is being
inserted or updated.

Is there a way in SQL that I can do this
automatically?

I try the following command using 'trigger'

----
CREATE_TRIGGER test1_autodate        AFTER INSERT OR UPDATE ON       test1 FOR EACH ROW EXECUTE update("test1")

CREATE FUNCTION update(char *) RETURNS int4   AS 'UPDATE $1 set date="now"'   LANGUAGE 'sql';
----

But realized 'char *' is not allow... Is there a
way to solve this?

Or Am I the right track in solving this problem?

Hope someone can help me... thanks.

Sei Heng




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

Предыдущее
От: "Francisco Hernandez"
Дата:
Сообщение: Re: car mileage summation / sledgehammer method
Следующее
От: Oliver Seidel
Дата:
Сообщение: car mileage summation / sledgehammer method