[Home] [Help]
68: ) = 'Y'
69: AND NOT EXISTS
70: (
71: SELECT 'X'
72: FROM AHL_WARRANTY_CONTRACTS_B
73: WHERE WARRANTY_TEMPLATE_ID = ASSOC.WARRANTY_TEMPLATE_ID
74: AND ITEM_INSTANCE_ID = INSTANCE.INSTANCE_ID
75: )
76: -- avikukum :: changes for bug# 11664006 :: START
425: -- store the contract's end date for populating in the counter's table, before expiration calculation API is called
426: l_active_end_date := warranty_template_rec.CONTRACT_END_DATE;
427:
428: -- fetch the next value from the sequence
429: l_warranty_contract_id := AHL_WARRANTY_CONTRACTS_B_S.NEXTVAL;
430:
431: -- insert a record in the AHL_WARRANTY_CONTRACTS_B table
432: INSERT INTO AHL_WARRANTY_CONTRACTS_B
433: (
427:
428: -- fetch the next value from the sequence
429: l_warranty_contract_id := AHL_WARRANTY_CONTRACTS_B_S.NEXTVAL;
430:
431: -- insert a record in the AHL_WARRANTY_CONTRACTS_B table
432: INSERT INTO AHL_WARRANTY_CONTRACTS_B
433: (
434: WARRANTY_CONTRACT_ID,
435: OBJECT_VERSION_NUMBER,
428: -- fetch the next value from the sequence
429: l_warranty_contract_id := AHL_WARRANTY_CONTRACTS_B_S.NEXTVAL;
430:
431: -- insert a record in the AHL_WARRANTY_CONTRACTS_B table
432: INSERT INTO AHL_WARRANTY_CONTRACTS_B
433: (
434: WARRANTY_CONTRACT_ID,
435: OBJECT_VERSION_NUMBER,
436: CONTRACT_NUMBER,
822:
823: -- cursor to check if there is an 'ACTIVE' contract for the instance
824: CURSOR chk_active_cont_csr (c_instance_id NUMBER) IS
825: SELECT 'X'
826: FROM AHL_WARRANTY_CONTRACTS_B
827: WHERE item_instance_id = c_instance_id
828: AND contract_status_code = 'ACTIVE';
829:
830: --
866: -- for table AHL_WARRANTY_CONTRACTS_TL
867: delete from AHL_WARRANTY_CONTRACTS_TL T
868: where not exists
869: (select NULL
870: from AHL_WARRANTY_CONTRACTS_B B
871: where B.WARRANTY_CONTRACT_ID = T.WARRANTY_CONTRACT_ID
872: );
873:
874: update AHL_WARRANTY_CONTRACTS_TL T set (