内联视图查询
我想从这个表 mytemp 中删除我最近添加的一些记录,请告诉我这个查询有什么问题, 已使用游标填充所选列中的数据,
DELETE FROM (SELECT ROWNUM RM, S from mytemp) where rm > 20;
错误为:
ORA-01732:数据操作操作在此视图上不合法
I wanted to delete some records which i added recently, from this table mytemp, please tell me what is wrong with this query,
data in selected column had been populated using cursor
DELETE FROM (SELECT ROWNUM RM, S from mytemp) where rm > 20;
error is:
ORA-01732: data manipulation operation not legal on this view
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了准确性进行了编辑...
以下是您收到的错误的描述:
http://ora-01732。 ora-code.com/
因此,看起来可更新视图可以代替表,只要它不连接多个表或使用虚拟列。就您而言,问题在于虚拟 ROWNUM 列。
Edited for accuracy...
Here's the description of the error you are getting:
http://ora-01732.ora-code.com/
So it looks like an updateable view can be substituted for a table, as long as it doesn't join more than one table or use virtual columns. In your case, the problem is the virtual ROWNUM column.
这是
rownum>20
语句。ROWNUM>x,其中大于正整数的 x 值始终为 false。
不返回任何记录。
提取的第一行被分配 ROWNUM 1 并使条件为假。要提取的第二行现在是第一行,并且还分配了 ROWNUM 1 并使条件为 false。随后所有行都无法满足条件,因此不会返回任何行。
检查此 了解更多信息。
您可以执行以下操作:
但它与
It's the
rownum>20
statement.ROWNUM>x, where x values greater than a positive integer are always false.
doesn't return any record.
The first row fetched is assigned a ROWNUM of 1 and makes the condition false. The second row to be fetched is now the first row and is also assigned a ROWNUM of 1 and makes the condition false. All rows subsequently fail to satisfy the condition, so no rows are returned.
Check THIS for further info.
You can do the following:
but it's the same as