Oracle 刷新物化视图 - 编译错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2157113/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Oracle refresh materialized view - Compile error
提问by Tom
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.
ORA-06550:第 3 行,第 9 列:PLS-00103:在预期以下情况之一时遇到符号“DBMS_MVIEW”:
:=。( @% ; 立即符号 ":=" 被替换为 "DBMS_MVIEW" 以继续。
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
(S1917) 期待:( ; @
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.
这是一个 Oracle 10g XE,希望没问题。
Thanks in advance !
提前致谢 !
回答by DCookie
I think if you just eliminate the "exec" altogether it might work better. "exec" is a SQL*Plus command. IOW, try:
我认为如果你完全消除“exec”,它可能会更好。“exec”是一个 SQL*Plus 命令。IOW,尝试:
CREATE OR REPLACE PROCEDURE REFRESH_MV AS
BEGIN
DBMS_MVIEW.REFRESH('my_mat_view_mv','C');
END REFRESH_MV;