Oracle刷新物化视图-编译错误
我试图在物化视图上执行刷新,但无法编译脚本。
CREATE OR REPLACE PROCEDURE REFRESH_MV AS
BEGIN
exec DBMS_MVIEW.REFRESH('my_mat_view_mv','C');
END REFRESH_MV;
我收到消息:
ORA-06550: 第 3 行,第 9 列: PLS-00103:遇到符号 “DBMS_MVIEW”当期望其中之一时 以下:
:= 。 ( @ % ; 立即数 符号 “:=”被替换为“DBMS_MVIEW” 继续。
我做错了什么吗?需要导入什么东西吗?
更新
CREATE OR REPLACE PROCEDURE REFRESH_MV AS
BEGIN
EXECUTE DBMS_MVIEW.REFRESH('my_mat_view_mv','C');
END REFRESH_MV;
(S1917) 期待:( ; @
立即
CREATE OR REPLACE PROCEDURE REFRESH_MV AS
BEGIN
EXECUTE IMMEDIATE DBMS_MVIEW.REFRESH('my_mat_view_mv','C');
END REFRESH_MV;
Warning: compiled but with compilation errors
这是一个 Oracle 10g XE,希望没问题。
提前致谢 !
Im trying to execute a refresh on a materialized view, but I cant get the script to compile.
CREATE OR REPLACE PROCEDURE REFRESH_MV AS
BEGIN
exec DBMS_MVIEW.REFRESH('my_mat_view_mv','C');
END REFRESH_MV;
I get the message:
ORA-06550: line 3, column 9:
PLS-00103: Encountered the symbol
"DBMS_MVIEW" when expecting one of the
following::= . ( @ % ; immediate The symbol
":=" was substituted for "DBMS_MVIEW"
to continue.
Am i doing something wrong ? Need to import anything?
Update
CREATE OR REPLACE PROCEDURE REFRESH_MV AS
BEGIN
EXECUTE DBMS_MVIEW.REFRESH('my_mat_view_mv','C');
END REFRESH_MV;
(S1917) Expecting: ( ; @
IMMEDIATE
CREATE OR REPLACE PROCEDURE REFRESH_MV AS
BEGIN
EXECUTE IMMEDIATE DBMS_MVIEW.REFRESH('my_mat_view_mv','C');
END REFRESH_MV;
Warning: compiled but with compilation errors
This is an Oracle 10g XE, hope thats no problem.
Thanks in advance !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为如果你完全消除“exec”,它可能会工作得更好。 “exec”是一个 SQL*Plus 命令。哇哦,试试:
I think if you just eliminate the "exec" altogether it might work better. "exec" is a SQL*Plus command. IOW, try: