How to fix the Oracle error PLS-00508: The expression in a RETURN statement cannot be a type?
In this post, you’ll learn more about the Oracle ErrorPLS-00508: The expression in a RETURN statement cannot be a type with the details on why you receive this error and the possible solution to fix it.
Oracle Error Description
PLS-00508: The expression in a RETURN statement cannot be a type
Reason for the Error PLS-00508: The expression in a RETURN statement cannot be a type
A datatype specifier was used instead of an expression in the RETURN statement of a user-defined function, as shown in the example below. Do not confuse the RETURN statement, which sets the function identifier to the result value, with the RETURN clause, which specifies the datatype of the result value. FUNCTION credit-rating (acct_no NUMBER) RETURN BOOLEAN IS BEGIN … RETURN NUMBER; — should be an expression END;
How to fix the Error PLS-00508: The expression in a RETURN statement cannot be a type ?
You can fix this error in Oracle by following the below steps
Replace the datatype specifier in the RETURN statement with an appropriate expression.
Leave Your Comment