|
I would think a simple foreign key would be simple. It's not apparently.
tl;dr: If I add a foreign key to a child table, I can insert into
the parent table, but not update it (I'm not updating the foreign key
column)
The long version
I have two tables ABBAPF and ABBACPF. They don't have journals
created according to the output of the create table statement. In the
later I have a foreign key setup like this:
AD_ID FOR COLUMN ABADROWID BIGINT NOT NULL
CONSTRAINT WEBLIB.FK_ABBACPF_ABBAPF
REFERENCES WEBLIB.ABBAPF(ROWID)
I can insert into the parent table with no problem. However, this
update fails
UPDATE WEBLIB.ABBAPF SET
XML_COL = XMLPARSE(DOCUMENT '<xmlRoot/>')
, ABMSGSTAMP = CURRENT TIMESTAMP
, STATUS = 0
, MESSAGE = 'Success'
WHERE ROWID = 1 WITH NC
[SQL7008] ABBAPF in WEBLIB not valid for operation. [SQL State=55019, DB
Errorcode=-7008]
Note I tried adding the WITH NC after the fact. removing it doesn't
help.
Dropping the child table makes the update work. therefore I'm pretty
sure it's not journaling like this article says
[http://www.ibm.com/support/docview.wss?uid=swg21380662]
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.