appreciate your response. I would like to add the above steps in Stored Procedure.. so how can add all these steps inside a Procedure instead writing separate Merge statment and Delete statement for ACT_IND..
how can we write a separate UPDATE statement if records got removed and update the indictor with 'N'? any idea?
how can we add this condition "You would need to run a seperate update statement to update act_ind to N for the rows that were "removed"" in a Merge/outside Merge.. ?
Assuming removed means not present in the external table, then the update statement would be something like:
set act_ind = 'N'
where pk not in (select pk
where act_ind <> 'N';