Resetting alteredrecord status in update procedures

SAWYER, Anthony tony.sawyer@mfi.co.uk
Tue, 05 Feb 2002 10:47:46 +0000


Good Morning,

We are working on PH8.20D on VMS with an Oracle 8i database.

We have got a screen which retrieves a set of data from the database in a
cluster.  

When any of the data is changed, we would rather use a stored procedure to
update the database than use the update procedure to do this for us.  The
reason for this is that there are several other procedures which need to be
applied to other tables during the update and are not included in the
triggers for the table being updated because of the 'mutating table' issue
you get when referencing the table being updated in a trigger.

We also use other GUI front ends which call the stored procedure in the
database, so we would like to maintain only one procedure rather than code
in many screens.

We have tried to approach this issue by hard-coding the update procedure to
call the stored procedure in the database for every occurence which has an
alteredrecord status set to "Y".  Unfortunately one drawback by doing this
is that the alteredrecord status is not reset to "N" by the stored procedure
and so the screen displays the error "*d* Not all changed records have been
updated." even though the data appears to have been updated correctly.

The update procedure is shown below:

...
set database REORDER_DB
...
procedure UPDATE
begin
    for each REORDER_POINTS
    begin
        if alteredrecord of REORDER_POINTS
        then
        sql call REORDER_POINTS_PKG.ROPADD (SKU of REORDER_POINTS,  &
                                            BRANCH_NO of REORDER_POINTS, &
                                            CURRENT_ROP, OVERIDE_ROP, &
                                            OVERIDE_ENABLED_FLAG,  &
                                            OVERIDE_START_DATE, &
                                            OVERIDE_END_DATE)

    end
end

Has anyone ever managed to reset the alteredrecord status on records in a
clustered screen?

Regards

Tony Sawyer


**********************************************************************************************************************
The information in this e-mail is confidential and is intended solely for the use of the individual
or entity to which it is addressed.  Any views or opinions presented are those of the author 
and do not necessarily represent those of MFI Furniture Group PLC or its associated companies. 
**********************************************************************************************************************