At 12:20 +1000 7/23/03, Daniel Kasak wrote:
Paul DuBois wrote:

At 10:46 +1000 7/23/03, Daniel Kasak wrote:

Hi all.

I need to test whether the first bit of a field is numeric.
For example, the field might contain:

154 boxes


Define this more precisely.  Is an acceptable match one or more
digits followed by a space?  If so, field REGEXP '^[0-9]+ ' should
work.

Yeah that will do it nicely.
It would still be good to have an isnumeric() function aliased to something like this, but anyway it solves my problem.
Thanks!

In your original message, you also said that such a function would add to compatibility with other DB servers.

I'm afraid I don't understand this.  What you appear to want is not a
general function that characterizes values as numeric or non-numeric,
but a special-purpose function that looks specifically for values with
a numeric prefix followed by a space.  "isnumeric()" would be the wrong
name for this, and I don't really see how this aids compatibility.  Do
other DB servers really have such a thing?

It seems to me that REGEXP is still a better solution. It can be adapted
to a broad class of patterns, whereas the proposed isnumeric() handles
a limited special case.  No?


-- Daniel Kasak IT Developer * NUS Consulting Group* Level 18, 168 Walker Street North Sydney, NSW, Australia 2060 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989 email: [EMAIL PROTECTED] website: www.nusconsulting.com


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

Are you MySQL certified? http://www.mysql.com/certification/


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to