Olá,

Qual versão você está utilizando?

CREATE OR REPLACE FUNCTION f_teste(varchar)
RETURNS void AS $$
BEGIN
RAISE NOTICE '%',$1;
END;
$$ LANGUAGE PLPGSQL;

SELECT f_teste('jota');

postgres=# SELECT f_teste('jota');
NOTICE:  jota
 f_teste
---------

(1 row)



2009/10/13 Bruno Carneiro <guimaraescarne...@gmail.com>

>
> 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-tp25877799p25877799.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
>


[]s

-- 
JotaComm
http://jotacomm.wordpress.com
_______________________________________________
pgbr-geral mailing list
pgbr-geral@listas.postgresql.org.br
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a