470,810 Members | 861 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,810 developers. It's quick & easy.

QMF for Windows and Updateable Views

JC
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.

Feb 20 '06 #1
11 2976
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
Feb 20 '06 #2
JC
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.

Feb 20 '06 #3
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
Feb 20 '06 #4
JC
Any idea why QMF for Windows and DB2 Table Editor both receive the
SQL0150 error on update via the view, but CLP does not?

Feb 20 '06 #5
JC wrote:
Any idea why QMF for Windows and DB2 Table Editor both receive the
SQL0150 error on update via the view, but CLP does not?

Do these tools have an option to dump the SQLCA?
Would be interesting to see where the message originated (server or client).

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Feb 20 '06 #6
Serge Rielau wrote:
JC wrote:
Any idea why QMF for Windows and DB2 Table Editor both receive the
SQL0150 error on update via the view, but CLP does not?

Do these tools have an option to dump the SQLCA?
Would be interesting to see where the message originated (server or
client).


Maybe QMF uses CLI (I strongly suspect it but don't know for sure). This
could also be used to verify that the exact same query as on the command
line triggers the error message.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Feb 21 '06 #7
Knut Stolze wrote:
Maybe QMF uses CLI (I strongly suspect it but don't know for sure). This
could also be used to verify that the exact same query as on the command
line triggers the error message.


....by collecting a CLI trace.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Feb 21 '06 #8
JC
I took a CLI trace, but don't see any thing in the file.

Feb 21 '06 #9
JC wrote:
I took a CLI trace, but don't see any thing in the file.


You should see the SQL0150 somewhere (assuming that QMF uses only CLI and
nothing else besides it). If not, then the error seems to originate from
another places.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Feb 21 '06 #10
JC
It must not use CLI. I've turned on both CLI and JDBC trace
information, but there is absolutely nothing in the trace files from
QMF. I confirmed the trace was set-up properly by using a different
application (which results in lots of trace data).

Feb 21 '06 #11
JC
I found there is an option to connect via CLI -- which fixed the
problem. Thanks for your help.

Feb 23 '06 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by John | last post: by
3 posts views Thread by CSN | last post: by
4 posts views Thread by Sebastian Böck | last post: by
8 posts views Thread by Jim in Arizona | last post: by
9 posts views Thread by Reidar | last post: by
4 posts views Thread by othellomy | last post: by
1 post views Thread by kia.martin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.