Re: Oracle Decode Function

Поиск
Список
Период
Сортировка
От Marc Lavergne
Тема Re: Oracle Decode Function
Дата
Msg-id 3D4049ED.1070703@richlava.com
обсуждение исходный текст
Ответ на Oracle Decode Function  (ramirez@idconcepts.org (Edwin S. Ramirez))
Ответы Re: Oracle Decode Function  (Chris Humphries <chumphries@devis.com>)
Список pgsql-hackers
That would get ugly in a real hurry! Oracle does get around the issue of 
parameter datatypes by having automatic datatype conversions, more or 
less, everything becomes a varchar2. The only real attractants to 
implementing a DECODE() function is that it's one less thing to convert 
when migrating apps from Oracle and, unfortunately, this is also a piece 
of the SQL*Net compatibility that I'm looking into doing!


Tom Lane wrote:
> Marc Lavergne <mlavergne-pub@richlava.com> writes:
> 
>>If you're asking about whether a custom function can have vararg 
>>parameters, the answer appears to depend on the CREATE FUNCTION
>>syntax. 
> 
> 
> Can't do it, though you could imagine creating a family of functions
> of the same name and different numbers of parameters.  Trying to
> emulate DECODE this way would have a much worse problem: what's the
> datatype of the parameters?  (Or the result?)
> 
> Use CASE; it does more than DECODE *and* is ANSI-standard.
> 
>             regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> 




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

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: creating aggregates that work on composite types (whole tuples)
Следующее
От: Chris Humphries
Дата:
Сообщение: Re: Oracle Decode Function