ORA-00932 尝试克服变异表错误
我已应用以下有关如何克服变异表错误的说明:
http: //asktom.oracle.com/pls/asktom/ASKTOM.download_file?p_file=6551198119097816936
但在我的最后一个触发器中,我收到了以下错误:
SQL> create or replace trigger Factura_Detalle_ai
after insert or update of PRODUCTO on Factura_Detalle
begin
for i in 1 .. state_pkg.newRows.count loop
UPDATE Factura_Detalle
SET Precio = (SELECT pre.PRECIO
FROM PRECIO pre
WHERE pre.PRODUCTO = state_pkg.newRows(i));
end loop;
end;
/
2 3 4 5 6 7 8 9 10 11 12 13
Warning: Trigger created with compilation errors.
SQL> show errors trigger factura_detalle_ai
Errors for TRIGGER FACTURA_DETALLE_AI:
LINE/COL ERROR
-------- -----------------------------------------------------------------
4/4 PL/SQL: SQL Statement ignored
7/23 PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got
ROWID
有什么想法吗?
问候
I have applied the fallowing instructions about how to overcome the mutate table error:
http://asktom.oracle.com/pls/asktom/ASKTOM.download_file?p_file=6551198119097816936
But in my last trigger I got the fallowing error:
SQL> create or replace trigger Factura_Detalle_ai
after insert or update of PRODUCTO on Factura_Detalle
begin
for i in 1 .. state_pkg.newRows.count loop
UPDATE Factura_Detalle
SET Precio = (SELECT pre.PRECIO
FROM PRECIO pre
WHERE pre.PRODUCTO = state_pkg.newRows(i));
end loop;
end;
/
2 3 4 5 6 7 8 9 10 11 12 13
Warning: Trigger created with compilation errors.
SQL> show errors trigger factura_detalle_ai
Errors for TRIGGER FACTURA_DETALLE_AI:
LINE/COL ERROR
-------- -----------------------------------------------------------------
4/4 PL/SQL: SQL Statement ignored
7/23 PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got
ROWID
Any ideas?
Greetings
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将 where 子句替换为:
ROWID 是每行地址的伪列,并且它是一种数据类型。
编辑:
或者可能是这样的:
Replace your where clause with this:
ROWID is a pseudo-column for the address of each row, and it's a data type.
EDIT:
Or maybe something like this: