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. 11 3116
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
Any idea why QMF for Windows and DB2 Table Editor both receive the
SQL0150 error on update via the view, but CLP does not?
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
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
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
I took a CLI trace, but don't see any thing in the file.
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 in
question:
myDataRow = myDataSet.Tables(0).Rows(RowNum)
myDataRow(ColumnCount) = Ailment
Adapter.UpdateCommand = New OleDbCommand("UPDATE SET F" & ColumnCount & " = '" & Ailment & "' where F1 =
" & RowNum & "", Conn)...
|
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 to create one explicitly under relations? Do I cerate an
index on both fields? Is there a step by step process I can look at to
create one-one relations?
2. Is a view updateable if there is a where clause on one of the fields in
the...
|
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 of MDI child windows after a period
of inactivity, in order to release resources and fire a garbage collect...
Does anyone have any views, or ideas on how to do this??
|
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!?
|
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 on the view.
If i do an update to the view, the update is rewritten
to update the father-table.
| |
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:
========================================================
========================================================
Server Error in '/' Application.
--------------------------------------------------------------------------------
Operation must use an updateable query.
Description: An unhandled exception occurred during...
|
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
|
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). Thanks.
|
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 have
found a quick fix in which I can delete the time key from the table
and everything will run fine, but when end users try to change
records
it will not allow them. It comes up with an error that they cannot
save changes and must copy to the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |