Oracle - 创建物化视图
我正在阅读一些文章,甚至堆栈上的一些答案,但我仍然有一些问题。我将发布我的 MV 代码以进行可能的分析:
CREATE MATERIALIZED VIEW some_materialized_view
REFRESH COMPLETE
START WITH sysdate
NEXT '2011-12-01' + 31
WIDTH PRIMARY KEY
AS my_query
错误是:
00984. 00000 - "column not allowed here"
我忘记了什么吗?我唯一想要的就是我的MV每个月开始更新。有人可以帮忙吗?
谢谢!
I'm reading some articles, even some answers here on stack, but i still have some issues. I'll post my MV code for possible analysis:
CREATE MATERIALIZED VIEW some_materialized_view
REFRESH COMPLETE
START WITH sysdate
NEXT '2011-12-01' + 31
WIDTH PRIMARY KEY
AS my_query
The error is:
00984. 00000 - "column not allowed here"
Am i forgeting something? The only thing i want is that my MV update every month beggining. Can someone help?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的命令中有两个语法错误。
子句
WIDTH PRIMARY KEY
应该是WITH PRIMARY KEY
(WITH
上有拼写错误)NEXT
子句是使用需要date
关键字的日期文字:NEXT DATE '2011-12-01' + 31
。所以完整的命令应该是:
There are two syntax errors in your command.
The clause
WIDTH PRIMARY KEY
should beWITH PRIMARY KEY
(you have a typo onWITH
)The
NEXT
clause is using a date literal which requires thedate
keyword:NEXT DATE '2011-12-01' + 31
.So the full command should be:
您可能应该首先查阅 Oracle 文档,尤其是语法问题。你想要的一切+更多都在那里。一旦您习惯了语言参考文档,它们就会非常有帮助,您可能会学到一些与您正在研究的内容相关的新知识。
You should probably consult the Oracle documentation first, esp for syntax questions. Everything you're asking + more is there. The language reference docs are very helpful once you're used to them, and you just might learn a few new things regarding what you're researching.