aiaiDBA

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

13718043309

010-86462881

PLS-00487: Invalid reference to variable 'string'

PLS-00487: Invalid reference to variable 'string'
Cause: A variable was referenced in a way that is inconsistent with its datatype. For example, a scalar variable might have been mistakenly referenced as a record, as follows: DECLARE CURSOR emp_cur IS SELECT empno, ename, sal FROM emp; emp_rec emp_cur%ROWTYPE; my_sal NUMBER(7,2); BEGIN ... total_sal := total_sal + my_sal.sal; -- invalid ...
Action: Check the spelling of the variable name. Make sure the variable was declared properly and that the declaration and reference are consistent regarding datatype.

请先 登录 后评论

1 个回答

小智
PLS-00487:对变量' string ' 的引用无效,
.原因:以与其数据类型不一致的方式引用变量。例如,标量变量可能被错误地引用为记录,如下所示:DECLARE CURSOR emp_cur IS SELECT empno,ename,sal FROM emp; emp_rec emp_cur%ROWTYPE; my_sal NUMBER(7,2); BEGIN ... total_sal:= total_sal + my_sal.sal; - 无效...,
.操作:检查变量名的拼写。确保变量已正确声明,并且声明和引用对于数据类型是一致的。,
.
请先 登录 后评论