A key application program is returning SQLSTT='42912' for no apparent reason. Our V7R2 development partition was PTF'ed last weekend and I recompiled the program today after a bit of refactoring. The program works correctly in Dev and in my V7R1 (sigh) offline system; when I move the object code into the V7R2 production partition not yet PTF'ed, the program fails with this error.
I'm declaring a cursor "FOR UPDATE" and not specifying the columns to be updated (meaning all are eligible). The error message "Column HVR00001 cannot be updated" says I'm trying to update a column not defined in the DECLARE CURSOR statement. Column HVR00001 doesn't exist in any of my code and I respectfully suggest that this error message is going to send a lot of people on a snipe hunt.
Starting with this...
DECLARE gsr010_frp001_cursor CURSOR WITH HOLD FOR
WHERE fhpro = :fhpro
After opening the cursor, this:
FETCH NEXT FROM gsr010_frp001_cursor INTO :frp001;
After lots of application code and SQL, this is where things fail:
SET ROW = :frp001
WHERE CURRENT OF gsr010_frp001_cursor;
Compiling the program to V7R1M0 eliminates the error, which suggests the PTF's have at least one defect. Another solution is to define the updated columns (there are over 100) but I have a tool that can identify the updated columns (which would be better for performance).
Have I misread the SQL documentation WRT cursor'ed updates or is this a real error?