The following lines contain the word 'select', 'insert', 'update' or 'delete':
select jtf_note_id
from jtf_notes_b
where source_object_code = p_object_type
and source_object_id in ( select object_id
from jtf_object_purge_param_tmp
where processing_set_id = p_processing_set_id
and ( purge_status is null or purge_status <> 'E'));
select jtf_note_id
from jtf_note_contexts
where note_context_type = p_object_type
and note_context_type_id in ( select object_id
from jtf_object_purge_param_tmp
where processing_set_id = p_processing_set_id
and ( purge_status is null or purge_status <> 'E'));
Delete JTF_NOTES_B
Where jtf_note_id = l_tab_note_id(j);
Delete JTF_NOTES_TL
Where jtf_note_id = l_tab_note_id(j);
Delete JTF_NOTE_CONTEXTS
Where jtf_note_id = l_tab_note_id(j);
-- Calling delete attachment API
-- Modified by Manas For bug no 4612646
-- Instead of directly deleting data from tables, Calling the procedure
-- fnd_attached_documents2_pkg.delete_attachments
For j In 1.. l_tab_note_id.LAST loop
fnd_attached_documents2_pkg.delete_attachments(X_entity_name=>l_entity_name,
X_pk1_value =>to_char(l_tab_note_id(j)),
X_pk2_value => NULL,
X_pk3_value => NULL,
X_pk4_value => NULL,
X_pk5_value => NULL,
X_delete_document_flag =>'Y',
X_automatically_added_flag => NULL) ;
Delete JTF_NOTE_CONTEXTS
Where jtf_note_id = l_tab_note_contx_id(j);