CREATE OR REPLACE FUNCTION VALIDATE_LETTER(P_STR IN VARCHAR)
RETURN VARCHAR2 IS
FUNCTIONRESULT VARCHAR2(1);
BEGIN
SELECT CASE
WHEN REGEXP_LIKE(SUBSTR(P_STR, -1, 1), '([a-z]+|[A-Z])') THEN
0
ELSE
1
END
INTO FUNCTIONRESULT
FROM DUAL;
RETURN FUNCTIONRESULT;
END VALIDATE_LETTER;
记录一下自己写的函数,该函数用来判断表中字段是否已字母结尾,如果以字母结尾返回0,否则返回1。