Re: Oracle decode Function in Postgres

Поиск
Список
Период
Сортировка
От Jeff Eckermann
Тема Re: Oracle decode Function in Postgres
Дата
Msg-id 20030903144112.82978.qmail@web20809.mail.yahoo.com
обсуждение исходный текст
Ответ на Oracle decode Function in Postgres  ("Amin Schoeib" <aschoeib@4tek.de>)
Список pgsql-general
--- Amin Schoeib <aschoeib@4tek.de> wrote:
> Hi,
> Like I see there is no equivalent to the Oracle
> decode Function
> In Postgres.Is there maybe somebody who wrote decode
> as a
> Function?

The problem for any such body is that there is no one
function possible in PostgreSQL that will cover all of
the possible use cases of "decode" in Oracle.  As I
understand things, "decode" takes a variable number of
arguments, for a variety of datatypes.  In PostgreSQL
you would need to create a separate "decode" function
for every distinct set of arguments (number and
datatypes) that you are likely to encounter.  That
would be a lot of work for a generalized case.

You may be best served by searching your code for
usage of "decode", and writing only those versions
that you need.  The coding for each one would be
trivial, using "case" constructions.

>
> Schoeib
>
> 4Tek Gesellschaft f�r angewandte
> Informationstechnologien mbH
> Schoeib Amin
> Tel.  +49 (0) 69 697688-132
> Fax. +49 (0) 69 697688-111
> http://www.4tek.de
>
>


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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

Предыдущее
От: "Amin Schoeib"
Дата:
Сообщение: Re: Localization (for dates) Oracle vs. Postgresql
Следующее
От: Alvaro Herrera Munoz
Дата:
Сообщение: Re: Using oids