Re: function DECODE and triggers - Mailing list pgsql-general

From Alban Hertroys
Subject Re: function DECODE and triggers
Date
Msg-id 435F6FFD.2030502@magproductions.nl
Whole thread Raw
In response to Re: function DECODE and triggers  ("Rafael Montoya" <rafo-mm@hotmail.com>)
List pgsql-general
Rafael Montoya wrote:
> Thanks for your answer, and if i have many options like
>
> decode
> (pre.C_EST,'01','U','02','M','03','W','04','D','05','O','06','S','') as Est
>
> do i have to write many else options in this way?
>
> select case when pre.C_EST = '01' THEN 'U'
>         ELSE when pre-C_EST = '02' THEN 'M'
>           ...
>         END AS EST

You could write a stored procedure that does what you want.

--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
    7500 AK Enschede

//Showing your Vision to the World//

pgsql-general by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: function DECODE and triggers
Next
From: "Venki"
Date:
Subject: How to get the value in the lastvalue field