IS_NUMERIC ?

IS_NUMERIC ?

am 28.11.2005 17:01:26 von Dwight Altman

Hello List,
Is there an IS_NUMERIC(aCandidateString) function in MySQL that I can run in
a query, similar to the various PHP "is_*" functions? I can't seem to find
it in the docs (other than a C API IS_NUM macro).

I have a field in a database with serial numbers like:
....1234
....1235
....1236-A
....1237B
and I want to get the last 4 characters of the numeric substring like so:
1234
1235
1236
1237

I should be able to do it in 1 SQL query if there is an IS_NUMERIC
equivalent, or else I will probably write a PHP script.

Regards,
Dwight

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: IS_NUMERIC ?

am 28.11.2005 18:56:09 von Bastien Koert

REGEXP?

Bastien


>From: "Dwight Altman"
>To:
>Subject: [PHP-DB] IS_NUMERIC ?
>Date: Mon, 28 Nov 2005 10:01:26 -0600
>
>Hello List,
>Is there an IS_NUMERIC(aCandidateString) function in MySQL that I can run
>in
>a query, similar to the various PHP "is_*" functions? I can't seem to find
>it in the docs (other than a C API IS_NUM macro).
>
>I have a field in a database with serial numbers like:
>...1234
>...1235
>...1236-A
>...1237B
>and I want to get the last 4 characters of the numeric substring like so:
>1234
>1235
>1236
>1237
>
>I should be able to do it in 1 SQL query if there is an IS_NUMERIC
>equivalent, or else I will probably write a PHP script.
>
>Regards,
>Dwight
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: IS_NUMERIC ?

am 29.11.2005 19:31:43 von El Bekko

http://php.belnet.be/manual/en/function.is-numeric.php

Apparently there is :)


Dwight Altman wrote:
> Hello List,
> Is there an IS_NUMERIC(aCandidateString) function in MySQL that I can run in
> a query, similar to the various PHP "is_*" functions? I can't seem to find
> it in the docs (other than a C API IS_NUM macro).
>
> I have a field in a database with serial numbers like:
> ...1234
> ...1235
> ...1236-A
> ...1237B
> and I want to get the last 4 characters of the numeric substring like so:
> 1234
> 1235
> 1236
> 1237
>
> I should be able to do it in 1 SQL query if there is an IS_NUMERIC
> equivalent, or else I will probably write a PHP script.
>
> Regards,
> Dwight

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php