Em 16/12/14, Matheus Saraiva<matheus.sara...@gmail.com> escreveu:
> Em Ter, 2014-12-16 às 17:56 -0200, Matheus de Oliveira escreveu:
>>
>> 2014-12-16 17:47 GMT-02:00 Matheus Saraiva
>> <matheus.sara...@gmail.com>:
>>         Ao usar a seguinte função
>>
>>         http://paste.ubuntu.com/9543365/
>>
>>         Estou recebendo um erro, informando que a função atingiu o fim
>>         e não encontrou um retorno. Não tenho muita experiência com
>>         PLPGSQL mas acredito que o retorno final está lá (RETURN
>>         sucess;)
>>
>>
>> Aquele RETURN na linha 27 está dentro do bloco de exceções. Mova essa
>> linha para antes da EXCEPTION, linha 15.
>>
>>
>> Atenciosamente,
>> --
>> Matheus de Oliveira
>> Analista de Banco de Dados
>> Dextra Sistemas - MPS.Br nível F!
>> www.dextra.com.br/postgres
>>
>>
>> _______________________________________________
>> pgbr-geral mailing list
>> pgbr-geral@listas.postgresql.org.br
>> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
>
> Ok, deu certo. Esse bloco exception é diferente do que eu imaginava,
> achei quele ele terminasse quando não encontrasse mais clausulas when
> then. Pelo visto ele não tem um delimitador que marque o seu fim.
> --


De:
http://www.postgresql.org/docs/current/interactive/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING

"If no error occurs, this form of block simply executes all the
statements, and then control passes to the next statement after END.
But if an error occurs within the statements, further processing of
the statements is abandoned, and control passes to the EXCEPTION list.
The list is searched for the first condition matching the error that
occurred. If a match is found, the corresponding handler_statements
are executed, and then control passes to the next statement after
END."

Osvaldo
_______________________________________________
pgbr-geral mailing list
pgbr-geral@listas.postgresql.org.br
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Reply via email to