E9.2 File not open when doing an Update in UBE using index that is not the primary

JohnABleich

Member
I am trying to update F00165 Sequence number which is part of the primary key. in order to do this I created a new index and am using that to change the Sequence number. When debugging, I am getting a TABLE_NOT_OPEN error in SV_FILE_IO_STATUS. I Tried doing an OPEN in Initialize and a CLOSE in the End but that has not fixed the issue. Can anyone help me figure out what I need to do?

Thanks, John
 
If I understand you correctly, you can't update a primary key, If the key is different then it's a NEW record so it's actually an insert.

So if I am following you, you'll have to copy the 1st record to variables for each column, delete the 1st record then INSERT your new record with it's new sequence
But not keep both records???
 
John has the most straight forward solution. But you may want to wrap this operation inside a transaction to be committed only if the initial delete and subsequent insert transactions are successful. Or you could do it the hard way like JDE does with Payroll Calcs, where the master business functions write the F06116 rows into cache, delete them from the table, do the calcs, then reinsert them so no other process can perform a dirty read while calcs are underway.
 
Back
Top