Problem with function parameters

Поиск
Список
Период
Сортировка
От Alejandro Michelin Salomon \( Adinet \)
Тема Problem with function parameters
Дата
Msg-id !~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAhx491Ki2tUS42D/aMPFg1MKAAAAQAAAA3VIGGSGBAEu3jH6jiJfUgwEAAAAA@adinet.com.uy
обсуждение исходный текст
Ответы Re: Problem with function parameters  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
Hi :
 
I have installed Pg 8.08
 
I create this function :
CREATE OR REPLACE FUNCTION CALCULO_VALOR_LIQUIDO_HELPDESK( nTipoDesconto SMALLINT,
                                                           nTipoComissao SMALLINT,
                                                           nDesconto NUMERIC,
                                                           nComissao NUMERIC,
                                                           nTotal NUMERIC )
RETURNS NUMERIC AS $$
 
DECLARE
nValorDesconto NUMERIC(14,2);
nValorComissao NUMERIC(12,2);
 
BEGIN
    nValorDesconto := 0;
    nValorComissao := 0;
 
    IF nTipoDesconto = 0 THEN
        nValorDesconto := nDesconto;
    ELSE
        nValorDesconto := ( nTotal * nDesconto ) / 100;
    END IF;
 
    IF nTipoComissao = 0 THEN
        nValorComissao := nComissao;
    ELSE
        nValorComissao := ( nTotal * nComissao ) / 100;
    END IF;
 
    RETURN nTotal - nValorDesconto - nValorComissao;
END;
$$ LANGUAGE plpgsql
CALLED ON NULL INPUT
SECURITY INVOKER;
 
When i test this function, i call the function with this parameters :
 
SELECT CALCULO_VALOR_LIQUIDO_HELPDESK( 0, 1, 10, 10, 1000 );
 
This is the error that happens:
 
ERROR: function calculo_valor_liquido_helpdesk(integer, integer, integer, integer, integer) does not exist
SQL state: 42883
Hint: No function matches the given name and argument types. You may need to add explicit type casts.
 
I dont now what the two first parameters are see as integer. When 0 and 1 are true smallint values.
 
What is happeining here?
 
Thanks in advance.
 
Alejandro Michelin Salomon.

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: initdb problem on Windows XP Home
Следующее
От: "Thomas H."
Дата:
Сообщение: Re: PostgreSQL doesn't accept connections when Windows