适用于Windows和可更新视图的QMF [英] QMF for Windows and Updateable Views

查看:99
本文介绍了适用于Windows和可更新视图的QMF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在DB2 UDB

数据库中创建了一个可更新的视图,它连接了两个表。该视图通过创建而不是
来更新。触发。我想通过QMF for Windows

或DB2 Table Editor使用此视图进行更新。但是,当我尝试从这些工具更新

时,我收到一个SQL0150错误。有什么我可以做的吗

允许更新,比如更新目录表中的视图的READONLY值?谢谢。

解决方案

JC写道:

我创建了一个可更新的视图,它加入了DB2 UDB数据库中的两个表。通过创建相反的来使视图可更新。触发。我想通过QMF for Windows
或DB2 Table Editor使用此视图进行更新。但是,当我尝试从这些工具中的任何一个更新时,我收到一个SQL0150错误。


SQL0150是DB2返回的错误代码。这与您使用的客户(即您的情况下的QMF)无关。我怀疑你的

而不是触发器不起作用或你没有触发器。你有没有可能发布表格,视图和触发器的DDL语句

以及引发错误的更新或插入语句

问题?

我能做些什么来允许更新,例如更新目录表中视图的READONLY值?谢谢。




您无法更新db2目录表(视图)。这是好的

原因。

-

Knut Stolze

DB2信息集成开发

IBM德国


上面我忘了提到我通过

视图成功测试了更新来自DB2 CLP和DB2 Command Center。我已经能够从QMF更新

以查看单个表的视图。在QMF中尝试更新时,只有两个表的视图出现错误






JC写道:

上面我忘了提到我通过DB2 CLP和DB2 Command Center的
视图成功测试了更新。我也能够从QMF更新以查看单个表格。在QMF中尝试更新时,对于两个表的视图仅发生错误。



DB2通过其确定视图的可更新性''结构。

例如基于JOIN的视图不可更新。在CREATE VIEW语句中描述了规则)我想b)b)。搜索可更新视图

如果您需要更新这样的复杂视图您可以查看

INSTEAD OF TRIGGER。这样的触发器定义了从视图到基本表格的映射(通常是SELECT的反向操作)。


干杯

Serge

-

Serge Rielau

DB2解决方案开发

IBM多伦多实验室


I created an updateable view, which joins two tables, in a DB2 UDB
database. The view was made updateable by the creation of an "instead
of" trigger. I''d like to use this view for updates via QMF for Windows
or DB2 Table Editor. However, when I try to update from either of
these tools, I receive an SQL0150 error. Is there anything I can do to
allow the updates, such as update the READONLY value for the view in
the catalog table? Thanks.

解决方案

JC wrote:

I created an updateable view, which joins two tables, in a DB2 UDB
database. The view was made updateable by the creation of an "instead
of" trigger. I''d like to use this view for updates via QMF for Windows
or DB2 Table Editor. However, when I try to update from either of
these tools, I receive an SQL0150 error.
The SQL0150 is an error code returned by DB2. This should be unrelated to
the client you are using, i.e. QMF in your case. I would suspect that your
instead of trigger does not work or that you do not have one. Could you
possibly post the DDL statements for the tables, views and the triggers
along with the update or insert statements that raise the error in
question?
Is there anything I can do to
allow the updates, such as update the READONLY value for the view in
the catalog table? Thanks.



You cannot update the db2 catalog tables (views). And that''s for good
reasons.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany


I forgot to mention above that I successfully tested the update via the
view from the DB2 CLP and the DB2 Command Center. I''ve also been able
to update from QMF for a view over a single table. The error only
occurs for the view over the two tables, when the update is attempted
in QMF.


JC wrote:

I forgot to mention above that I successfully tested the update via the
view from the DB2 CLP and the DB2 Command Center. I''ve also been able
to update from QMF for a view over a single table. The error only
occurs for the view over the two tables, when the update is attempted
in QMF.


DB2 determines the updatability of a view soley by its'' structure.
E.g. a view based on a JOIN is not updatable. The rules are describe )I
think) in teh CREATE VIEW statement. Search for "updatable view"
If you need to update such a "complex" views you can take a look at
INSTEAD OF TRIGGERs. Such a trigger defines a mapping from the view to
the base table (typically the reverse operation from the SELECT).

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab


这篇关于适用于Windows和可更新视图的QMF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆