Unix Technical Forum

QMF for Windows and Updateable Views

This is a discussion on QMF for Windows and Updateable Views within the DB2 forums, part of the Database Server Software category; --> I created an updateable view, which joins two tables, in a DB2 UDB database. The view was made updateable ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 06:08 AM
JC
 
Posts: n/a
Default QMF for Windows and Updateable Views

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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 06:08 AM
Knut Stolze
 
Posts: n/a
Default Re: QMF for Windows and Updateable Views

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 06:08 AM
JC
 
Posts: n/a
Default Re: QMF for Windows and Updateable Views

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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-27-2008, 06:08 AM
Serge Rielau
 
Posts: n/a
Default Re: QMF for Windows and Updateable Views

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-27-2008, 06:08 AM
JC
 
Posts: n/a
Default Re: QMF for Windows and Updateable Views

Any idea why QMF for Windows and DB2 Table Editor both receive the
SQL0150 error on update via the view, but CLP does not?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-27-2008, 06:08 AM
Serge Rielau
 
Posts: n/a
Default Re: QMF for Windows and Updateable Views

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-27-2008, 06:09 AM
Knut Stolze
 
Posts: n/a
Default Re: QMF for Windows and Updateable Views

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-27-2008, 06:09 AM
Knut Stolze
 
Posts: n/a
Default Re: QMF for Windows and Updateable Views

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-27-2008, 06:09 AM
JC
 
Posts: n/a
Default Re: QMF for Windows and Updateable Views

I took a CLI trace, but don't see any thing in the file.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-27-2008, 06:09 AM
Knut Stolze
 
Posts: n/a
Default Re: QMF for Windows and Updateable Views

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:13 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com