如何将 DB2 硬编码视图转换为 Oracle 视图
我已经在 DB2 LUW 中创建了这个视图:
CREATE VIEW SCHEMA.TYPE(TYPEID, TYPENAME) AS
SELECT TYPEID, TYPENAME
FROM TABLE(VALUES(0,'A'),
(1,'B'),
(2,'C'),
(3,'D'),
(4,'E'),
(5,'F')) T(TYPEID, TYPENAME)
我想将这个相同的视图移动到 Oracle 数据库 (10g)。 我发现Oracle中存在TABLE,但VALUES函数不存在。
您知道如何改变视图吗?
谢谢
I have created this view in DB2 LUW:
CREATE VIEW SCHEMA.TYPE(TYPEID, TYPENAME) AS
SELECT TYPEID, TYPENAME
FROM TABLE(VALUES(0,'A'),
(1,'B'),
(2,'C'),
(3,'D'),
(4,'E'),
(5,'F')) T(TYPEID, TYPENAME)
I'd like to move this same view to an Oracle database (10g).
I found that TABLE exists in Oracle, but the VALUES function does not.
Would you have an idea how to transform the view?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我唯一想到的是:
The only thing I came up with is:
您的另一个选择是仅创建表并将值插入其中。然后,您将获得能够对其施加约束、引用完整性和作品的额外好处。使其成为索引组织表。另外,它可能会给使用它的查询带来性能优势。
Your other option is to just create the table and insert the values into it. Then, you'll get the added benefit of being able to put constraints on it, referential integrity, the works. Make it an index-organised table. Plus, it might give performance benefits to queries that use it.