aiaiDBA

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

13718043309

010-86462881

PLS-00229: Attribute expression within SQL expression

PLS-00229: Attribute expression within SQL expression
Cause: An attribute expression, such as SQL%NOTFOUND, was used in a SQL statement, but attribute expressions are allowed only in procedural statements.
Action: To workaround this limitation, assign the value of the attribute expression to a variable, then use the variable in the SQL statement. For example, replace the statement INSERT INTO audits VALUES (c1%ROWCOUNT, ...); with the following statements: row_count := c1%ROWCOUNT; INSERT INTO audits VALUES (row_count, ...);

请先 登录 后评论

1 个回答

小智
PLS-00229:SQL表达式中的属性表达式,
.原因:在SQL语句中使用了一个属性表达式,如SQL%NOTFOUND,但属性表达式仅允许在过程语句中使用。,
.操作:要解决此限制,请将属性表达式的值分配给变量,然后在SQL语句中使用该变量。例如,替换语句INSERT INTO audits VALUES(c1%ROWCOUNT,...); 使用以下语句:row_count:= c1%ROWCOUNT; INSERT INTO audits VALUES(row_count,...);,
.
请先 登录 后评论