Determines whether a field is a data or string in oracle.

Source: Internet
Author: User
Tags translate function


Oracle uses the translate function in oralce to determine whether a field is data or a string SQL code. The syntax is as follows: TRANSLATE (expr, from_string, to_string) refers to expr content, use the characters in to_string to replace the characters in from_string one by one, for example, select translate ('000000', '\ 000000',' \ ') from dual; the returned result is a blank www.2cto.com select translate ('99999ss99999999999', '\ 1234567890', '\') from dual. The returned result is "ss" to determine whether the value of a field is a number, this function is used to replace all numbers with null values. If the final result is null, it indicates a number; otherwise, it is not a number. Select nvl2 (translate ("999999ss99999999", '\ 000000',' \ '), 'is characters', 'is number') from dual
The returned value is ss, indicating that it is not a number.
 

Related Article

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.