Oracle determines whether the character is a letter or an oracle character

Source: Internet
Author: User

Oracle determines whether the character is a letter or an oracle character
Create or replace function ischar (chr varchar2) return varchar2 is
Ischr varchar2 (5 );
Begin
Select case
When ascii (chr) between 65 and 122 THEN
'True'
Else
'False'
End
Into ischr
From dual;
Return ischr;
End;
How Does oracle determine whether the queried column contains letters?

Can I see the following statement?
Select case when regexp_like (field name, '. ([a-z] + | [A-Z])') then' contains the letter 'else' does not contain the letter 'end
From table name

Regular Expression Function: regexp_like
The key parameter is the second: '. ([a-z] + | [A-Z])' Where. Indicates matching any single character, except for line breaks
[A-z] is a lowercase letter | or [A-Z] capital letter

How Does oracle determine whether a numeric string contains English letters?

Simple: one statement. In SqlPlus, select decode (length (replace (translate ('string value', '123. ', ''),'', ''), 0, 'is number', 'is not a number') from dual; troublesome: in the oracle database, create or replace function f_str_or_num (str varchar2) return varchar2 is
2 v_num number;
3 v_return varchar2 (60 );
4 begin
5 v_num: = to_number (str );
6 v_return: = str | 'is a number string! ';
7 return v_return;
8 exception when others then
9 v_return: = str | 'is not a number string! ';
10 return v_return;
11 end f_str_or_num; then, call select f_str_or_num ('string value) from dual;

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.