From: | Carmen Gloria Sepulveda Dedes <csepulveda(at)atichile(dot)com> |
---|---|
To: | Gunnar Wolf <gwolf(at)gwolf(dot)cx> |
Cc: | pgsql-ayuda(at)tlali(dot)iztacala(dot)unam(dot)mx |
Subject: | Re: [Pgsql-ayuda] Funcion isnumeric??? |
Date: | 2003-10-29 18:52:35 |
Message-ID: | 3FA00C73.3304E076@atichile.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Hola ...
Gracias por la solucion que me das. No la habia considerado y sirve.
En todo caso, hablando de soluciones elegantes .... :
create or replace function is_number(varchar) returns boolean as
'select $1 ~ ''^[-+]?[0-9]+$''' strict immutable language sql;
... otro importante aporte de Alvaro ....
para que lo tengan en cuenta si lo necesitan....
Saludos y muchas gracias,
CG
> CREATE OR REPLACE FUNCTION is_numeric(integer) RETURNS bool AS
> 'BEGIN
> RETURN ''t'';
> END;' LANGUAGE 'plpgsql';
>
> CREATE OR REPLACE FUNCTION is_numeric(numeric) RETURNS bool AS
> 'BEGIN
> RETURN ''t'';
> END;' LANGUAGE 'plpgsql';
>
> CREATE OR REPLACE FUNCTION is_numeric(varchar) RETURNS bool AS
> 'BEGIN
> RETURN ''f'';
> END;' LANGUAGE 'plpgsql';
>
> CREATE OR REPLACE FUNCTION is_numeric(text) RETURNS bool AS
> 'BEGIN
> RETURN ''f'';
> END;' LANGUAGE 'plpgsql';
>
> CREATE OR REPLACE FUNCTION is_numeric(bool) RETURNS bool AS
> 'BEGIN
> RETURN ''f'';
> END;' LANGUAGE 'plpgsql';
From | Date | Subject | |
---|---|---|---|
Next Message | Ernesto Quiñones A. | 2003-10-29 18:54:27 | Re: [Pgsql-ayuda] Re: Postgresql sobre windows |
Previous Message | felipe.molina | 2003-10-29 18:46:54 | [Pgsql-ayuda] Diferencias en querys |