Re: function DECODE and triggers

Поиск
Список
Период
Сортировка
От Rafael Montoya
Тема Re: function DECODE and triggers
Дата
Msg-id BAY18-F3E144B2EDF45EA6CDBD92F8770@phx.gbl
обсуждение исходный текст
Ответ на Re: From oracle to postgresql...  (Richard Huxton <dev@archonet.com>)
Ответы Re: function DECODE and triggers  (Oliver Elphick <olly@lfix.co.uk>)
Список pgsql-general
I'm migrating from oracle to postgresl, and i  have these 2 problems:

1.
PostgreSQL doesn't support function DECODE from Oracle, but it can be
replicated with
CASE WHEN expr THEN expr [...] ELSE expr END  , the problem appears when i
want to convert this sentence from oracle to postgresl:
               select decode (pre.C_GEN,'01','M','02','F','') as GENERO
my convertion is
              case when  pre.C_GEN = '01' then GENERO='M' else GENERO='F'
end ,
but i dont' know if the assigment of GENERO is correct.

2.
Writing triggers i don't know if postgresql supports statements like this:
    CREATE OR REPLACE TRIGGER trig
    AFTER UPDATE OF column2              <<----- Here is the doubt
    ON table_product
    FOR EACH ROW
    BEGIN
    ...
    END

In postgresql:
   CREATE OR REPLACE TRIGGER trig
   AFTER UPDATE OF column2               <<----- is this correct?
   ON table_product
   FOR EACH ROW EXECUTE PROCEDURE trig();

Thanks for your answers..
Rafael

_________________________________________________________________
¿Estás pensando en cambiar de coche? Todas los modelos de serie y extras en
MSN Motor. http://motor.msn.es/researchcentre/


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

Предыдущее
От: "Denis"
Дата:
Сообщение: Re: cannot stat `/usr/local/pgsql/data/pg_xlog/00000001000000430000009C': No such file or directory
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: PostgreSQL vs mySQL, any performance difference for