HomeOracleOracle Error PLS-00508: The expression in a RETURN statement cannot be a type

Oracle Error PLS-00508: The expression in a RETURN statement cannot be a type

Oracle Error Message

PLS-00508: The expression in a RETURN statement cannot be a type

Reason for the Error

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;

Solution

Replace the datatype specifier in the RETURN statement with an appropriate expression.

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Oracle Error Message CLSGN-32767: Internal error. Reason for the Error An unexpected error occurred. Solution Examine the message(s) that accompany...
Oracle Error Message CLSGN-00211: OCR batch operation failed. string Reason for the Error Setting a set of Oracle Cluster Registry...
Oracle Error Message CLSGN-00210: failed to get value for OCR key “string”. string Reason for the Error It was not...