473,385 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 3093
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Tom wilson | last post by:
This is driving me nuts. I'm trying to update an Excel spreadsheet using ADO.Net and Oledb in VB.Net. The connection is open, the adapter is connected and the dataset is loaded. Here's the code...
1
by: John | last post by:
I am hoping to create an updatable view from two tables joined on two fields. I have two questions; 1. How can I enforce a one to one relation in sql server 2005 based on two fields? Do I need...
3
by: Paul Aspinall | last post by:
Hi I have an MDI app.... All child MDI windows are non-updateable... however, the users may leave the windows open... and there can be several of them. I want to implement a system to dispose...
3
by: CSN | last post by:
Just wondering, is updateable views slated for a future version of Postgresql? In addition to using rules that is. CSN __________________________________ Do you Yahoo!?
4
by: Sebastian Böck | last post by:
Hello all, i have a view defined as a simple select of a table. This table is inherited by a couple of others. All entries belong to the child-tables. I also have an unconditional update rule...
8
by: Jim in Arizona | last post by:
I've been using an example out of a book to be able to edit the rows in a database. I am getting the following error: ========================================================...
9
by: Reidar | last post by:
Is it possible to have the source in one window and the design in another window and perhaps the code in a third window? reidarT
4
by: othellomy | last post by:
How do I make a view non updateable? I want to create a view so that I will not be able to update, insert or delete the view so that base table is not affected (except dropping the view itself)....
1
by: kia.martin | last post by:
I have a sql database connected with access, but when I try to run macros which basically just transfer information from tables for approval an error comes up with "time key is not updateable". I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.