Home > Database > Mysql Tutorial > body text

Oracle 手动刷新物化视图的问题

WBOY
Release: 2016-06-07 17:06:27
Original
2059 people have browsed it

最近项目需要在单据成功提交后,手动刷新某一个物化视图。起初方案是,在表的After Update触发器调用dbms_refresh.refresh(

最近项目需要在单据成功提交后,手动刷新某一个物化视图。

起初方案是,在表的After Update触发器调用dbms_refresh.refresh('物化视图名称');测试发现报错。报错原因:通过dbms_refresh.refresh刷新物化视图时,默认有隐式的Commit事务提交。推测其Commit事务和触发器隐式Commit事务提交冲突,故报错。后修改为前台调用刷新时,,测试正常。PB前台测试代码如下:

DECLARE dbms_refresh Procedure FOR dbms_refresh.refresh('物化视图名称');

EXECUTE dbms_refresh;

close dbms_refresh ;

注释:dbms_refresh.refresh是dbms_refresh包的过程。

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!