The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT b.relationship_id
FROM csi_counter_relationships b
WHERE source_counter_id = l_counter_id
AND NOT EXISTS
(
SELECT 1
FROM CSM_CNTR_RELATIONSHIPS_ACC acc
WHERE acc.relationship_id = b.relationship_id
AND acc.user_id = l_user_id
);
CSM_ACC_PKG.Insert_Acc
(P_PUBLICATION_ITEM_NAMES => g_accnt_pubi_name
,P_ACC_TABLE_NAME => g_cst_accnt_acc_table_name
,P_SEQ_NAME => g_cst_accnt_seq_name
,P_PK1_NAME => g_cst_accnt_pk1_name
,P_PK1_NUM_VALUE => l_cntr_rel_rec.relationship_id
,P_USER_ID => p_user_id
);
CSM_UTIL_PKG.LOG('Inserting counter relationship id ' || TO_CHAR(l_cntr_rel_rec.relationship_id) || ' for user '||TO_CHAR(p_user_id) , 'CSM_CNTR_RELATIONSHIPS_EVENT_PKG.COUNTER_RELATION_INS',FND_LOG.LEVEL_PROCEDURE);
SELECT acc.relationship_id
FROM csi_counter_relationships b,
CSM_CNTR_RELATIONSHIPS_ACC acc
WHERE b.source_counter_id = l_counter_id
AND acc.user_id = l_user_id
AND acc.relationship_id = b.relationship_id
AND NOT EXISTS
(
SELECT 1
FROM CSM_COUNTERS_ACC cacc
WHERE cacc.counter_id = l_counter_id
AND cacc.user_id = l_user_id
);
CSM_ACC_PKG.Delete_Acc
(P_PUBLICATION_ITEM_NAMES => g_accnt_pubi_name
,P_ACC_TABLE_NAME => g_cst_accnt_acc_table_name
,P_PK1_NAME => g_cst_accnt_pk1_name
,P_PK1_NUM_VALUE => l_cntr_rel_rec.relationship_id
,P_USER_ID => p_user_id
);