找不到任何错误,但它会编译错误。有人看到我视而不见吗?
CREATE OR REPLACE FUNCTION myusername.fun_hr_format_phone (tmp in VARCHAR2) RETURN VARCHAR2
IS tmpVar VARCHAR2(12);
BEGIN
SELECT DECODE(
LENGTH(tmp),
10, SUBSTR(tmp,1,3) || '-' || SUBSTR(tmp,4,3) || '-' || SUBSTR(tmp,7,4),
7, SUBSTR(tmp,1,3) || '-' || SUBSTR(tmp,4,4), tmp
) INTO tmpVar FROM dual;
RETURN tmpVar;
EXCEPTION
WHEN NO_DATA_FOUND THEN NULL;
WHEN OTHERS THEN RAISE;
END;
/
答案 0 :(得分:0)
如果您正在使用SQL * Plus:请注意空行,您的代码在语法上完全正确。