2015-02-25 11:51 GMT-03:00 Matheus Saraiva <[email protected]>:

>  Estou recebendo um erro de sintaxe na linha onde a variável recebe o
> valor de SELECT last_value.
>
> *create function "teste"() returns integer as *
>
> *$BODY$*
> *    declare test integer default 0;*
>
> *    begin*
>         *test := select last_value from "Pessoas_codigo_seq";*       <-
> Erro aqui
>

Coloque a instrução de select entre parênteses:

test := (select last_value from "Pessoas_codigo_seq");

Da próxima vez, tente colocar a mensagem de erro junto à pergunta, para
facilitar o auxílio.

[]'s
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a