Create Or Replace Function f_Getch(Str Varchar2) Return Varchar2 Is
i Int;
Sub_Str Varchar2(500);
Str2 Varchar2(500);
Str1 Varchar2(500);
Len Int;
Begin
Str2 := Str;
Select Length(Str2) Into i From Dual;
While i > 0 Loop
Select Substr(Str2, 1, 1) Into Sub_Str From Dual;
Select Lengthb(Sub_Str) Into Len From Dual;
If Len = 3 Then
Str1 := Str1 || Sub_Str;
End If;
Select Substr(Str2, 2, Length(Str2)) Into Str2 From Dual;
Select Length(Str2) Into i From Dual;
End Loop;
Return Str1;
End;
Oracle 获取字符串中所有中文汉字(含标点符号)
最新推荐文章于 2022-07-25 13:29:59 发布