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;