static void LedgerAccountMerge(Args _args)
{
MainAccount mainAccountDelete;
MainAccount mainAccount;
DimensionAttributeValue dimensionAttributeValue;
DimensionAttributeLevelValue dimensionAttributeLevelValue;
DimensionAttributeValueGroup dimensionAttributeValueGroup;
DimensionAttributeValueCombination dimensionAttributeValueCombination;
DimensionAttributeValueGroupCombination dimensionAttributeValueGroupCombination;
#define.MainAccount('100109')
#define.MainAccountDelete('110112')
ttsBegin;
select firstOnly forUpdate mainAccountDelete
where mainAccountDelete.MainAccountId == #MainAccountDelete;
select firstOnly forUpdate mainAccount
where mainAccount.MainAccountId == #MainAccount;
select firstonly forupdate dimensionAttributeValueGroup
join dimensionAttributeLevelValue
where dimensionAttributeValueGroup.RecId == dimensionAttributeLevelValue.DimensionAttributeValueGroup
&& dimensionAttributeLevelValue.DisplayValue == #MainAccountDelete;
dimensionAttributeValueGroup.delete();
select firstonly forupdate dimensionAttributeValue
join dimensionAttributeLevelValue
where dimensionAttributeValue.RecId == dimensionAttributeLevelValue.dimensionAttributeValue
&& dimensionAttributeLevelValue.DisplayValue == #MainAccountDelete;
dimensionAttributeValue.delete();
select firstonly forupdate dimensionAttributeLevelValue
where dimensionAttributeLevelValue.DisplayValue ==#MainAccountDelete;
dimensionAttributeLevelValue.delete();
select firstonly forupdate dimensionAttributeValueGroupCombination
join dimensionAttributeValueCombination
where dimensionAttributeValueCombination.RecId == dimensionAttributeValueGroupCombination.DimensionAttributeValueCombination
&& dimensionAttributeValueCombination.DisplayValue == #MainAccountDelete;
dimensionAttributeValueGroupCombination.delete();
select firstonly forupdate dimensionAttributeValueCombination
where dimensionAttributeValueCombination.DisplayValue == #MainAccountDelete;
dimensionAttributeValueCombination.delete();
mainAccountDelete.merge(mainAccount);
mainAccount.doUpdate();
mainAccountDelete.doDelete();
ttscommit;
info("MainAccount merging successfull");
}
{
MainAccount mainAccountDelete;
MainAccount mainAccount;
DimensionAttributeValue dimensionAttributeValue;
DimensionAttributeLevelValue dimensionAttributeLevelValue;
DimensionAttributeValueGroup dimensionAttributeValueGroup;
DimensionAttributeValueCombination dimensionAttributeValueCombination;
DimensionAttributeValueGroupCombination dimensionAttributeValueGroupCombination;
#define.MainAccount('100109')
#define.MainAccountDelete('110112')
ttsBegin;
select firstOnly forUpdate mainAccountDelete
where mainAccountDelete.MainAccountId == #MainAccountDelete;
select firstOnly forUpdate mainAccount
where mainAccount.MainAccountId == #MainAccount;
select firstonly forupdate dimensionAttributeValueGroup
join dimensionAttributeLevelValue
where dimensionAttributeValueGroup.RecId == dimensionAttributeLevelValue.DimensionAttributeValueGroup
&& dimensionAttributeLevelValue.DisplayValue == #MainAccountDelete;
dimensionAttributeValueGroup.delete();
select firstonly forupdate dimensionAttributeValue
join dimensionAttributeLevelValue
where dimensionAttributeValue.RecId == dimensionAttributeLevelValue.dimensionAttributeValue
&& dimensionAttributeLevelValue.DisplayValue == #MainAccountDelete;
dimensionAttributeValue.delete();
select firstonly forupdate dimensionAttributeLevelValue
where dimensionAttributeLevelValue.DisplayValue ==#MainAccountDelete;
dimensionAttributeLevelValue.delete();
select firstonly forupdate dimensionAttributeValueGroupCombination
join dimensionAttributeValueCombination
where dimensionAttributeValueCombination.RecId == dimensionAttributeValueGroupCombination.DimensionAttributeValueCombination
&& dimensionAttributeValueCombination.DisplayValue == #MainAccountDelete;
dimensionAttributeValueGroupCombination.delete();
select firstonly forupdate dimensionAttributeValueCombination
where dimensionAttributeValueCombination.DisplayValue == #MainAccountDelete;
dimensionAttributeValueCombination.delete();
mainAccountDelete.merge(mainAccount);
mainAccount.doUpdate();
mainAccountDelete.doDelete();
ttscommit;
info("MainAccount merging successfull");
}
No comments:
Post a Comment