Anybody remember issues with MERGE on 7.1 for multi-member PF using a ALIAS
to point to a particular member?

From a question on Stack Overflow...
(
https://stackoverflow.com/questions/59081263/facing-row-not-found-for-merge-error-in-db2/59148477#59148477
)
CREATE ALIAS DOUG.MYDATA901 FOR DOUG.MYDATA(F901);

MERGE INTO DOUG.MYDATA901 TGT USING DOUG.TEST01 SRC
ON TGT.PREC = SRC.PREC
WHEN MATCHED THEN
UPDATE SET TGT.PQDS = TGT.PQDS - SRC.TTL_DIST;

Results in an
SQL State: 02000
Vendor Code: 100 Message: [SQL0100] Row not found for MERGE.

Copying member F901 into it's own file and the merge works fine.

According to the 7.1 SQL docs for ALIAS... (
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_71/db2/rbafzch2alias.htm
)
"An alias that refers to an individual partition of a table or member of a
database file can only be used in a select statement, CREATE INDEX, DELETE,
INSERT, MERGE, SELECT INTO, SET variable, UPDATE, or VALUES INTO statement."

But there's change markers around that, so perhaps the OP is missing some
PTFs...

Charles

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 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.