aiaiDBA

加微信获取免费职业规划+学习资料,了解年薪50万的DBA是如何练成的

13718043309

010-86462881

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

PLS-00508: The expression in a RETURN statement cannot be a type
Cause: 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;
Action: Replace the datatype specifier in the RETURN statement with an appropriate expression.

请先 登录 后评论

1 个回答

小智
PLS-00508:RETURN语句中的表达式不能是一个类型,
.原因:使用数据类型说明符代替用户定义函数的RETURN语句中的表达式,如下面的示例所示。不要将RETURN语句与RETURN子句混淆,RETURN语句将函数标识符与结果值进行比较,RETURN子句指定结果值的数据类型。FUNCTION信用评级(acct_no NUMBER)返回BOOLEAN开始...返回号码; - 应该是一个表达式END;,
.操作:用适当的表达式替换RETURN语句中的数据类型说明符。,
.
请先 登录 后评论