Topic
1 reply Latest Post - ‏2014-01-06T12:54:52Z by Robert Phillips
Rashmioptim
Rashmioptim
3 Posts
ACCEPTED ANSWER

Pinned topic Archive Actions- Update a row

‏2014-01-06T09:55:03Z |

Hi ,

 

I have a requirement to update a flag column in another table 'Indicating archival' in a db when a row of the current table is once archived.

Can Archive actions be used for this case and how to access the other table while once a row in the current table is archived.

How to go about tackling this?

Thanks,

Rashmi

 

Updated on 2014-01-06T09:55:21Z at 2014-01-06T09:55:21Z by Rashmioptim
  • Robert Phillips
    Robert Phillips
    5 Posts
    ACCEPTED ANSWER

    Re: Archive Actions- Update a row

    ‏2014-01-06T12:54:52Z  in response to Rashmioptim

    Archive actions are exactly the device to employ. 

    When creating your Access Definition, right click in the Table Specifications field and select Table Specification->Actions from the pull-down menu. The Actions tab should be visible.  The Run Action For: field gives you the choice of Data Growth, Test Data Management, or All Solutions (archive, extract, or both).  The Action Phase pull-down allows you to determine the operation phase in which the action runs. You can specify separate SQL statements for each phase.  For a simple demonstration, I constructed a table:

    create table archive_test (key char(40), flag int);

    And used this SQL for the "Before Extract of Row" action on the OPTIM_CUSTOMERS table:

    insert into archive_values (:CUST_ID, 1);

     

    There are refinements involving error handling, exceptions, etc. that can be made to make this production-worthy, and these are covered in the Optim documentation (which goes into more detail than I do here).