Remove the line:
SHOW ERRORS;
When compiling in Toad, you do not need to add "show errors" as toad will show you the errors in the error window.
题
I'm trying to create this function using Toad, but I keep getting an error.
CREATE OR REPLACE FUNCTION minimum (v1 number, v2 number)
RETURN number IS
BEGIN
IF v1 < v2 THEN
RETURN v1;
ELSE
RETURN v2;
END IF ;
SHOW ERRORS;
END;
SELECT minimum(1, 2)
FROM dual;
The error I get is this, but I can't understand what is my mistake.
Warning: Function created with compilation errors
解决方案
Remove the line:
SHOW ERRORS;
When compiling in Toad, you do not need to add "show errors" as toad will show you the errors in the error window.
其他提示
SHOW ERRORS;
is a SQL*PLUS command. You cannot use it in a stored procedure you need to remove it and then your procedure will be successfully compiled.
CREATE OR REPLACE FUNCTION minimum (v1 number, v2 number)
RETURN number IS
BEGIN
IF v1 < v2 THEN
RETURN v1;
ELSE
RETURN v2;
END IF ;
END;