The following lines contain the word 'select', 'insert', 'update' or 'delete':
select 'Y'
into l_tp_exists
from ece_tp_details
where document_id='ADVO'
and tp_header_id= p_tp_header_id;
select ece_advo_headers_s.nextval
into p_advice_header_id
from dual;
insert into ECE_ADVO_HEADERS (
communication_method,
ADVICE_HEADER_ID,
DOCUMENT_TYPE,
DOCUMENT_CODE,
TP_HEADER_ID,
TP_LOCATION_CODE_EXT,
TP_CODE,
TP_NAME,
TP_ADDRESS1,
TP_ADDRESS2,
TP_ADDRESS3,
TP_ADDRESS4,
TP_CITY,
TP_POSTAL_CODE,
TP_COUNTRY,
TP_STATE,
TP_PROVINCE,
TP_COUNTY,
RELATED_DOCUMENT_ID,
EXTERNAL_REFERENCE1,
EXTERNAL_REFERENCE2,
EXTERNAL_REFERENCE3,
EXTERNAL_REFERENCE4,
EXTERNAL_REFERENCE5,
EXTERNAL_REFERENCE6,
INTERNAL_REFERENCE1,
INTERNAL_REFERENCE2,
INTERNAL_REFERENCE3,
INTERNAL_REFERENCE4,
INTERNAL_REFERENCE5,
INTERNAL_REFERENCE6,
TRANSACTION_CONTROL1,
TRANSACTION_CONTROL2,
TRANSACTION_CONTROL3)
values (
p_communication_method,
p_advice_header_id,
p_document_type,
p_document_code,
p_tp_header_id,
p_tp_location_code,
p_entity_code,
p_entity_name,
p_entity_address1,
p_entity_address2,
p_entity_address3,
p_entity_address4,
p_entity_city,
p_entity_postal_code,
p_entity_country,
p_entity_state,
p_entity_province,
p_entity_county,
p_related_document_id,
p_external_reference_1,
p_external_reference_2,
p_external_reference_3,
p_external_reference_4,
p_external_reference_5,
p_external_reference_6,
p_internal_reference_1,
p_internal_reference_2,
p_internal_reference_3,
p_internal_reference_4,
p_internal_reference_5,
p_internal_reference_6,
p_transaction_control1,
p_transaction_control2,
p_transaction_control3);
select 'Y'
into l_document_exists
from ece_advo_headers
where advice_header_id=p_advice_header_id;
insert into ECE_ADVO_DETAILS(
ADVICE_DETAIL_ID ,
ADVICE_HEADER_ID ,
ADVO_DATE_TIME ,
ADVO_STATUS_CODE ,
EXTERNAL_REFERENCE1,
EXTERNAL_REFERENCE2,
EXTERNAL_REFERENCE3,
EXTERNAL_REFERENCE4,
EXTERNAL_REFERENCE5,
EXTERNAL_REFERENCE6,
INTERNAL_REFERENCE1,
INTERNAL_REFERENCE2,
INTERNAL_REFERENCE3,
INTERNAL_REFERENCE4,
INTERNAL_REFERENCE5,
INTERNAL_REFERENCE6,
ADVO_MESSAGE_CODE ,
ADVO_MESSAGE_DESC ,
ADVO_DATA_BAD ,
ADVO_DATA_GOOD)
values(
ece_advo_details_s.nextval,
p_advice_header_id ,
p_advice_date_time ,
p_advice_status_code ,
p_external_reference_1,
p_external_reference_2,
p_external_reference_3,
p_external_reference_4,
p_external_reference_5,
p_external_reference_6,
p_internal_reference_1,
p_internal_reference_2,
p_internal_reference_3,
p_internal_reference_4,
p_internal_reference_5,
p_internal_reference_6,
p_advo_message_code ,
p_advo_message_desc ,
p_advo_data_bad ,
p_advo_data_good);