use select cast(campo_texto as int4) from tabela.

Em 09/08/07, Osvaldo Rosario Kussama <[EMAIL PROTECTED]>
escreveu:
>
> Eduardo Fernandes escreveu:
> > Olá,
> >
> > Preciso converter uma combinação de caracteres(char[]) para um
> > número(int) usando 'plpgsql'.
> >
> > Alguém tem alguma idéia de como posso fazer isso?
> >
>
>
> Utilize a função array_to_string() e cast, veja:
> http://www.postgresql.org/docs/8.2/interactive/functions-array.html
>
> bdteste=# SELECT array_to_string(ARRAY['0','1','2','3','4','5'],'')::int;
> array_to_string
> -----------------
>            12345
> (1 registro)
>
> Osvaldo
> _______________________________________________
> pgbr-geral mailing list
> [email protected]
> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
>
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a