Usei a notação $$String$$ e deu certo.

Bruno Carneiro wrote:
> 
> CREATE FUNCTION criarconta(varchar) RETURNS void AS $$
> DECLARE
>     pbanco ALIAS FOR $1;
> BEGIN
>     SELECT idbanco FROM banco WHERE banco=pbanco;
> END;
> $$ LANGUAGE plpgsql;
> 
> Eu tento chamar minha função assim:
> 
> SELECT criarconta("Banco");
> 
> e recebo o erro:
> 
> Erro de SQL:
> 
> ERROR:  column "BANCO" does not exist
> LINE 1: SELECT criarconta("BANCO") 
>                           ^
> 
> Indicação de entrada :
> SELECT criarconta("BANCO") 
> 
> 
> Porque? Não estou passando a string corretamente? Ja tentei com ' '
> simples...
> 

-- 
View this message in context: 
http://www.nabble.com/Passar-string-para-fun%C3%A7%C3%A3o-tp25877799p25877924.html
Sent from the PostgreSQL - Brasil mailing list archive at Nabble.com.

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

Responder a