MySQL Forums
Forum List  »  Microsoft SQL Server

Re: IsNumeric() clause in MySQL??
Posted by: kevinclark
Date: August 08, 2005 01:01PM

I agree. Here is a function I created for MySQL 5:

CREATE FUNCTION IsNumeric (sIn varchar(1024)) RETURNS tinyint
RETURN sIn REGEXP '^(-|\\+){0,1}([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+|[0-9]+)$';

This allows for an optional plus/minus sign at the beginning, one optional decimal point, and the rest numeric digits.

Options: ReplyQuote

Written By
September 10, 2004 12:08PM
September 16, 2004 10:31PM
Re: IsNumeric() clause in MySQL??
August 08, 2005 01:01PM
November 24, 2008 04:43PM
January 07, 2009 11:34AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.