CHAR to INT

From: Martín Marqués <martin(dot)marques(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: CHAR to INT
Date: 2008-07-12 13:15:29
Message-ID: e73de96e0807120615n13a673e5tf2c933ab5178c0b8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I'm trying to make a PL function to pass from an alphanumeric string
to a numeric one changing the chars in the string to it's ORD (the
inverse of the chr function) and I'm stumbling with two problems:

1) How to know if the CHAR is numeric or not.
2) If it's not numeric I want to get it's ord, but I can't find
something like that in PG.

Any ideas?

--
Martín Marqués
select 'martin.marques' || '@' || 'gmail.com'
DBA, Programador, Administrador

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Scott Marlowe 2008-07-12 13:19:08 Re: Rollback in Postgres
Previous Message Ragnar 2008-07-12 10:06:50 Re: Problem in dynamic query execution in plpgsql