Re: function DECODE and triggers

From: Alban Hertroys <alban(at)magproductions(dot)nl>
To: Rafael Montoya <rafo-mm(at)hotmail(dot)com>
Cc: olly(at)lfix(dot)co(dot)uk, pgsql-general(at)postgresql(dot)org
Subject: Re: function DECODE and triggers
Date: 2005-10-26 12:01:01
Message-ID: 435F6FFD.2030502@magproductions.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)magproductions(dot)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//

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Venki 2005-10-26 12:23:04 How to get the value in the lastvalue field
Previous Message Oliver Elphick 2005-10-26 10:22:10 Re: function DECODE and triggers