The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT FND_ATTACHED_DOCUMENTS_S.nextval
FROM dual;
SELECT 1
FROM FND_ATTACHED_DOCUMENTS
WHERE document_id = l_id;
AMW_UTILITY_PVT.debug_message( 'Private API: Calling table handler fnd_documents_pkg.insert_row');
fnd_documents_pkg.insert_row(
X_rowid => l_row_id,
X_document_id => x_document_id,
X_creation_date => sysdate,
X_created_by => FND_GLOBAL.USER_ID,
X_last_update_date => sysdate,
X_last_updated_by => FND_GLOBAL.USER_ID,
X_last_update_login => FND_GLOBAL.CONC_LOGIN_ID,
X_datatype_id => p_Fnd_Attachment_rec.datatype_id,
X_category_id => p_Fnd_Attachment_rec.category_id,
X_security_type => p_Fnd_Attachment_rec.security_type,
X_publish_flag => p_Fnd_Attachment_rec.publish_flag,
X_usage_type => p_Fnd_Attachment_rec.usage_type,
X_language => p_Fnd_Attachment_rec.language,
X_description =>p_Fnd_Attachment_rec.description,
X_file_name => p_Fnd_Attachment_rec.file_name,
X_media_id => l_media_id
);
insert into
fnd_documents_short_text
(media_id,
short_text
)
values
(l_media_id,
p_Fnd_Attachment_rec.short_text
);
Update fnd_documents_tl because FND_API inserts newly generated
media_id into that table.
*/
update fnd_documents_tl
set media_id = p_Fnd_Attachment_rec.media_id
where document_id = x_document_id;
/* For File we have already generated a file id - the fnd_documents_pkg.insert_row
table handler has generated a fnd_lobs_s.nextval but that's not what shoule be the
reference to the FND_LOBS table - because the upload program has already generated a
sequence */
/**
update fnd_documents_tl
set media_id = p_Fnd_Attachment_rec.media_id
where document_id = l_document_id;
fnd_attached_documents_pkg.Insert_Row
( x_rowid => l_row_id,
X_attached_document_id => l_attached_document_ID,
X_document_id => x_document_ID,
X_creation_date => sysdate,
X_created_by => FND_GLOBAL.USER_ID,
X_last_update_date => sysdate,
X_last_updated_by => FND_GLOBAL.USER_ID,
X_last_update_login => FND_GLOBAL.CONC_LOGIN_ID,
X_seq_num => l_seq_num,
X_entity_name => p_Fnd_Attachment_rec.entity_name,
x_column1 => null,
X_pk1_value => p_Fnd_Attachment_rec.pk1_value,
X_pk2_value => null,
X_pk3_value => null,
X_pk4_value => null,
X_pk5_value => null,
X_automatically_added_flag => p_Fnd_Attachment_rec.automatically_added_flag,
X_datatype_id => null,
X_category_id => null,
X_security_type => null,
X_publish_flag => null,
X_usage_type => p_Fnd_Attachment_rec.usage_type,
X_language => null,
X_media_id => l_media_id,
X_doc_attribute_Category => null,
X_doc_attribute1 => null,
X_doc_attribute2 => null,
X_doc_attribute3 => null,
X_doc_attribute4 => null,
X_doc_attribute5 => null,
X_doc_attribute6 => null,
X_doc_attribute7 => null,
X_doc_attribute8 => null,
X_doc_attribute9 => null,
X_doc_attribute10 => null,
X_doc_attribute11 => null,
X_doc_attribute12 => null,
X_doc_attribute13 => null,
X_doc_attribute14 => null,
X_doc_attribute15 => null
);