Re: isnumeric() function?

Поиск
Список
Период
Сортировка
От Jeff Eckermann
Тема Re: isnumeric() function?
Дата
Msg-id 20040430141145.40776.qmail@web20809.mail.yahoo.com
обсуждение исходный текст
Ответ на isnumeric() function?  ("Yudie" <yudie@axiontech.com>)
Список pgsql-sql
--- Yudie <yudie@axiontech.com> wrote:
> What is isnumeric function in postgresql? 
> I'm using psql version 7.2.2
> thanks
> Yudie

I don't think that function is included as such.  But
you could do something like:

CREATE FUNCTION isnumeric(text) RETURNS boolean AS '
SELECT $1 ~ ''^[0-9]+$''
' LANGUAGE 'sql';

Note that you would need to create this function for
every parameter datatype that you would intend to use,
or else be prepared to cast your input datatype as
appropriate.

> 
> 
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the
> unregister command
>     (send "unregister YourEmailAddressHere" to
majordomo@postgresql.org)


    
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 


В списке pgsql-sql по дате отправления:

Предыдущее
От: Pallav Kalva
Дата:
Сообщение: Re: Permissions not working
Следующее
От: Rajesh Kumar Mallah
Дата:
Сообщение: Re: Problem in SQL Trigger