Skip navigation links

MySQL Forums :: Microsoft SQL Server :: IsNumeric() clause in MySQL??


Advanced Search

Re: IsNumeric() clause in MySQL??
Posted by: Cai Black ()
Date: January 07, 2009 11:34AM

Oops! Henri's does work fine. My enhancements then are the following:

* removing the space between the function name and the parentheses
* adding the size to the datatype: TINYINT(1)
* indicating that the function is deterministic: DETERMINISTIC
* replacing the range '{0,1}' with a '?'


CREATE FUNCTION ISNUMERIC(myVal VARCHAR(1024))
RETURNS TINYINT(1) DETERMINISTIC
RETURN myVal REGEXP '^(-|\\+)?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+|[0-9]+)$';


Sorry for any confusion that my previous post may have caused.
---
Cai Black



Edited 1 time(s). Last edit at 01/07/2009 11:42AM by Cai Black.

Options: ReplyQuote


Subject Written By Posted
IsNumeric() clause in MySQL?? Cassiano 09/10/2004 12:08PM
Re: IsNumeric() clause in MySQL?? eswar 09/16/2004 10:31PM
Re: IsNumeric() clause in MySQL?? Homam Alsayed 02/02/2005 01:37PM
Re: IsNumeric() clause in MySQL?? Henry Wong 04/01/2005 11:37AM
Re: IsNumeric() clause in MySQL?? Nathan Cheng 01/29/2006 11:24PM
Re: IsNumeric() clause in MySQL?? Henri-Maxime Ducoulombier 04/14/2005 06:29AM
Re: IsNumeric() clause in MySQL?? kevinclark 08/08/2005 01:01PM
Re: IsNumeric() clause in MySQL?? Cai Black 11/24/2008 04:43PM
Re: IsNumeric() clause in MySQL?? Vilhelm Persson 01/07/2009 05:06AM
Re: IsNumeric() clause in MySQL?? Cai Black 01/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.