aiaiDBA

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

13718043309

010-86462881

PLS-00405: subquery not allowed in this context

PLS-00405: subquery not allowed in this context
Cause: A subquery was used in an inappropriate context, such as: if (SELECT deptno FROM emp WHERE ... ) = 20 then ... Subqueries are allowed only in SQL statements.
Action: The same result can be obtained by using a temporary variable, as in: SELECT deptno INTO temp_var FROM emp WHERE ...; IF temp_var = 20 THEN ...

请先 登录 后评论

1 个回答

小智
PLS-00405:在此上下文中不允许使用子查询,
.原因:在不合适的上下文中使用了一个子查询,例如:if(SELECT deptno FROM emp WHERE ...)= 20 then ...仅在SQL语句中允许子查询。,
.操作:通过使用临时变量可以获得相同的结果,如:SELECT deptno INTO temp_var FROM emp WHERE ...; IF temp_var = 20 THEN ...,
.
请先 登录 后评论