oracle-Check the number for any of the characters.

Source: Internet
Author: User

Method One
Returns a null representation string that returns a value greater than or equal to 1 with a non-numeric character
Select LENGTHB (LTrim (' 1248346 ', ' 0123456789 ')) from dual;
Or
Select LENGTHB (RTrim (' 1248346a ', ' 0123456789 ')) from dual;

Method Two
Returns a null representation string that returns a value greater than or equal to 1 with a non-numeric character
Select Translate (' 123 ', ' 0123456789 ', ') from dual

Method Three
If return is null, all numbers are, and conversely, non-numeric characters are included
Select LENGTHB (replace (replace (replace) (replace (replace ("Replace" with replace (' 0123456789a ', ' 0 '), ' 1 '), ' 2 '), ' 3 '), ' 4 '), ' 5 '), ' 6 '), ' 7 '), ' 8 '), ' 9 ') Ifnum from dual

Method Four
In the case of Oracle 10g, you can use regular expressions to implement
If the return is 0, the representation is a number, or vice versa, indicating a non-numeric presence
SELECT count (' A123 ') from dual WHERE regexp_like (' A123 ', ' [^[:d igit:]] ')

========================
Method Three is not recommended

Select ID from ac07_02 where LENGTHB (RTrim (ID, ' 0123456789 ')) >1;

oracle-Check the number for any of the characters.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.