Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

Updating line contract table with commitment start date as 01-JUL-2018,

contract are coming first time which contract start date less than 01-JUL-2018
-------------------------------------------------------------------------------
update ifrs15.NMTC_CONTR_LINES_STG set COMMIT_START_DATE='01-JUL-
2018' ,LINE_ADD_INFO5='Manual update commit start date to 01-JUL-2018'
where batch_id=111 and COMMIT_START_DATE < '01-JUL-2018'
and contract_num in (
SELECT DISTINCT contract_num
FROM ifrs15.nmtc_contr_header_stg a
WHERE 1 = 1
AND a.batch_id = :p_batch_id
AND load_status = 'N'
AND contract_start_date < '01-Jul-2018'
AND NOT EXISTS (SELECT 1
FROM ifrs15.nmtc_fah_contract_header b
WHERE a.contract_num = b.base_contract_num)
AND EXISTS
(SELECT /*+ index(b NMTC_CONTR_PLANS_STG_N2) */
1
FROM ifrs15.nmtc_contr_line_plans_stg b
WHERE a.contract_num = b.contract_num
AND b.service_start_date < '01-Jul-2018'
AND ABS (NVL (b.standalone_price, 0))
+ ABS (NVL (b.monthly_rec_chgs, 0)) <> 0
AND b.batch_id = a.batch_id)
)

Updating header contract table with contract start date as 01-JUL-2018,


contract are coming first time which contract start date less than 01-JUL-2018
-------------------------------------------------------------------------------
update ifrs15.NMTC_CONTR_HEADER_STG set contract_start_date='01-JUL-
2018',CONTRACT_ADD_INFO5='Manual update contract start date to 01-JUL-2018'
where batch_id=111
and contract_start_date < '01-JUL-2018'
and contract_num in (
SELECT DISTINCT contract_num
FROM ifrs15.nmtc_contr_header_stg a
WHERE 1 = 1
AND a.batch_id = :p_batch_id
AND load_status = 'N'
AND contract_start_date < '01-Jul-2018'
AND NOT EXISTS (SELECT 1
FROM ifrs15.nmtc_fah_contract_header b
WHERE a.contract_num = b.base_contract_num)
AND EXISTS
(SELECT /*+ index(b NMTC_CONTR_PLANS_STG_N2) */
1
FROM ifrs15.nmtc_contr_line_plans_stg b
WHERE a.contract_num = b.contract_num
AND b.service_start_date < '01-Jul-2018'
AND ABS (NVL (b.standalone_price, 0))
+ ABS (NVL (b.monthly_rec_chgs, 0)) <> 0
AND b.batch_id = a.batch_id)

You might also like