160:
161: select count(1) into p_count
162: from hz_dup_results;
163:
164: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
165: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties in HZ_DUP_RESULTS before sanitization '|| p_count );
166: FND_FILE.put_line(FND_FILE.log,'Parties ::: Delete based on subset sql');
167: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of delete '||to_char(sysdate,'hh24:mi:ss'));
168:
161: select count(1) into p_count
162: from hz_dup_results;
163:
164: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
165: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties in HZ_DUP_RESULTS before sanitization '|| p_count );
166: FND_FILE.put_line(FND_FILE.log,'Parties ::: Delete based on subset sql');
167: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of delete '||to_char(sysdate,'hh24:mi:ss'));
168:
169:
162: from hz_dup_results;
163:
164: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
165: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties in HZ_DUP_RESULTS before sanitization '|| p_count );
166: FND_FILE.put_line(FND_FILE.log,'Parties ::: Delete based on subset sql');
167: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of delete '||to_char(sysdate,'hh24:mi:ss'));
168:
169:
170:
163:
164: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
165: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties in HZ_DUP_RESULTS before sanitization '|| p_count );
166: FND_FILE.put_line(FND_FILE.log,'Parties ::: Delete based on subset sql');
167: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of delete '||to_char(sysdate,'hh24:mi:ss'));
168:
169:
170:
171:
188: 'and ' ||
189: p_subset_sql || ')' ;
190: END IF;
191:
192: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
193: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties deleted from HZ_DUP_RESULTS '||SQL%ROWCOUNT);
194: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of delete '||to_char(sysdate,'hh24:mi:ss'));
195:
196: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
189: p_subset_sql || ')' ;
190: END IF;
191:
192: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
193: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties deleted from HZ_DUP_RESULTS '||SQL%ROWCOUNT);
194: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of delete '||to_char(sysdate,'hh24:mi:ss'));
195:
196: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
197: FND_FILE.put_line(FND_FILE.log,'Parties ::: Beginning delete on HZ_DUP_RESULTS, based on threshold, reversed pairs and indirect transitives '||SQL%ROWCOUNT);
190: END IF;
191:
192: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
193: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties deleted from HZ_DUP_RESULTS '||SQL%ROWCOUNT);
194: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of delete '||to_char(sysdate,'hh24:mi:ss'));
195:
196: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
197: FND_FILE.put_line(FND_FILE.log,'Parties ::: Beginning delete on HZ_DUP_RESULTS, based on threshold, reversed pairs and indirect transitives '||SQL%ROWCOUNT);
198:
192: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
193: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties deleted from HZ_DUP_RESULTS '||SQL%ROWCOUNT);
194: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of delete '||to_char(sysdate,'hh24:mi:ss'));
195:
196: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
197: FND_FILE.put_line(FND_FILE.log,'Parties ::: Beginning delete on HZ_DUP_RESULTS, based on threshold, reversed pairs and indirect transitives '||SQL%ROWCOUNT);
198:
199:
200: -- At the end of this, we would have the following:
193: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties deleted from HZ_DUP_RESULTS '||SQL%ROWCOUNT);
194: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of delete '||to_char(sysdate,'hh24:mi:ss'));
195:
196: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
197: FND_FILE.put_line(FND_FILE.log,'Parties ::: Beginning delete on HZ_DUP_RESULTS, based on threshold, reversed pairs and indirect transitives '||SQL%ROWCOUNT);
198:
199:
200: -- At the end of this, we would have the following:
201:
228:
229: )
230: ));
231:
232: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
233: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties deleted from HZ_DUP_RESULTS '||SQL%ROWCOUNT);
234: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of delete '||to_char(sysdate,'hh24:mi:ss'));
235:
236:
229: )
230: ));
231:
232: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
233: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties deleted from HZ_DUP_RESULTS '||SQL%ROWCOUNT);
234: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of delete '||to_char(sysdate,'hh24:mi:ss'));
235:
236:
237:
230: ));
231:
232: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
233: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties deleted from HZ_DUP_RESULTS '||SQL%ROWCOUNT);
234: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of delete '||to_char(sysdate,'hh24:mi:ss'));
235:
236:
237:
238:
374: select count(1) into p_count
375: from hz_int_dup_results
376: where batch_id = p_batch_id;
377:
378: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
379: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties in HZ_INT_DUP_RESULTS before sanitization '|| p_count );
380: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
381:
382:
375: from hz_int_dup_results
376: where batch_id = p_batch_id;
377:
378: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
379: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties in HZ_INT_DUP_RESULTS before sanitization '|| p_count );
380: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
381:
382:
383: -- Bug fix for 3639346 :::: Need to take scores that are >= threshold
376: where batch_id = p_batch_id;
377:
378: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
379: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties in HZ_INT_DUP_RESULTS before sanitization '|| p_count );
380: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
381:
382:
383: -- Bug fix for 3639346 :::: Need to take scores that are >= threshold
384: insert into hz_int_dup_results_gt (batch_id, f_osr, f_os, t_osr, t_os, ord_f_osr, ord_t_osr, score)
406: )
407: )
408: );
409:
410: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
411: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties inserted to HZ_INT_DUP_RESULTS_GT '||SQL%ROWCOUNT);
412: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
413:
414:
407: )
408: );
409:
410: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
411: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties inserted to HZ_INT_DUP_RESULTS_GT '||SQL%ROWCOUNT);
412: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
413:
414:
415: EXCEPTION
408: );
409:
410: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
411: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties inserted to HZ_INT_DUP_RESULTS_GT '||SQL%ROWCOUNT);
412: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
413:
414:
415: EXCEPTION
416: WHEN OTHERS THEN
571: from hz_imp_int_dedup_results
572: where batch_id = p_batch_id
573: and entity <> 'PARTY' ;
574:
575: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
576: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of details in HZ_IMP_INT_DEDUP_RESULTS before sanitization '|| p_count );
577: FND_FILE.put_line(FND_FILE.log,'Details ::: Begin time of delete '||to_char(sysdate,'hh24:mi:ss'));
578:
579:
572: where batch_id = p_batch_id
573: and entity <> 'PARTY' ;
574:
575: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
576: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of details in HZ_IMP_INT_DEDUP_RESULTS before sanitization '|| p_count );
577: FND_FILE.put_line(FND_FILE.log,'Details ::: Begin time of delete '||to_char(sysdate,'hh24:mi:ss'));
578:
579:
580: delete from hz_imp_int_dedup_results a
573: and entity <> 'PARTY' ;
574:
575: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
576: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of details in HZ_IMP_INT_DEDUP_RESULTS before sanitization '|| p_count );
577: FND_FILE.put_line(FND_FILE.log,'Details ::: Begin time of delete '||to_char(sysdate,'hh24:mi:ss'));
578:
579:
580: delete from hz_imp_int_dedup_results a
581: where
595: )
596: )
597: );
598:
599: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
600: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of details deleted in HZ_IMP_INT_DEDUP_RESULTS '||SQL%ROWCOUNT);
601: FND_FILE.put_line(FND_FILE.log,'Details ::: End time of delete '||to_char(sysdate,'hh24:mi:ss'));
602:
603: -- bug 5393826
596: )
597: );
598:
599: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
600: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of details deleted in HZ_IMP_INT_DEDUP_RESULTS '||SQL%ROWCOUNT);
601: FND_FILE.put_line(FND_FILE.log,'Details ::: End time of delete '||to_char(sysdate,'hh24:mi:ss'));
602:
603: -- bug 5393826
604: FND_FILE.put_line(FND_FILE.log,'Details ::: Start time of insert of Winner Detail OSRS '||to_char(sysdate,'hh24:mi:ss'));
597: );
598:
599: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
600: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of details deleted in HZ_IMP_INT_DEDUP_RESULTS '||SQL%ROWCOUNT);
601: FND_FILE.put_line(FND_FILE.log,'Details ::: End time of delete '||to_char(sysdate,'hh24:mi:ss'));
602:
603: -- bug 5393826
604: FND_FILE.put_line(FND_FILE.log,'Details ::: Start time of insert of Winner Detail OSRS '||to_char(sysdate,'hh24:mi:ss'));
605: insert into hz_imp_int_dedup_results
600: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of details deleted in HZ_IMP_INT_DEDUP_RESULTS '||SQL%ROWCOUNT);
601: FND_FILE.put_line(FND_FILE.log,'Details ::: End time of delete '||to_char(sysdate,'hh24:mi:ss'));
602:
603: -- bug 5393826
604: FND_FILE.put_line(FND_FILE.log,'Details ::: Start time of insert of Winner Detail OSRS '||to_char(sysdate,'hh24:mi:ss'));
605: insert into hz_imp_int_dedup_results
606: (batch_id,
607: winner_record_osr,
608: winner_record_os,
623: from hz_imp_int_dedup_results a
624: where a.entity <> 'PARTY'
625: and a.batch_id = p_batch_id ;
626:
627: FND_FILE.put_line(FND_FILE.log,'Details ::: End time of insert of Winner Detail OSRs '||to_char(sysdate,'hh24:mi:ss'));
628: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of Winner Detail OSRs inserted '||SQL%ROWCOUNT);
629:
630: -- bug 5393826
631:
624: where a.entity <> 'PARTY'
625: and a.batch_id = p_batch_id ;
626:
627: FND_FILE.put_line(FND_FILE.log,'Details ::: End time of insert of Winner Detail OSRs '||to_char(sysdate,'hh24:mi:ss'));
628: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of Winner Detail OSRs inserted '||SQL%ROWCOUNT);
629:
630: -- bug 5393826
631:
632:
632:
633: -- Bug Fix 3588873 :: Need to report the import interface table dates for all the duplicates
634:
635:
636: FND_FILE.put_line(FND_FILE.log,'Details ::: End time of update for getting import table dates '||to_char(sysdate,'hh24:mi:ss'));
637:
638: -- We take of the "PARTY SITES" entity here.
639: update hz_imp_int_dedup_results a
640: set (a.dup_creation_date, a.dup_last_update_date)
667: and b.cp_orig_system = a.dup_record_os
668: )
669: where a.entity = 'CONTACT_POINTS' and a.batch_id = p_batch_id ;
670:
671: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of duplicate details updated in HZ_IMP_INT_DEDUP_RESULTS '||SQL%ROWCOUNT);
672: FND_FILE.put_line(FND_FILE.log,'Details ::: End time of update for getting import table dates '||to_char(sysdate,'hh24:mi:ss'));
673:
674: EXCEPTION
675: WHEN OTHERS THEN
668: )
669: where a.entity = 'CONTACT_POINTS' and a.batch_id = p_batch_id ;
670:
671: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of duplicate details updated in HZ_IMP_INT_DEDUP_RESULTS '||SQL%ROWCOUNT);
672: FND_FILE.put_line(FND_FILE.log,'Details ::: End time of update for getting import table dates '||to_char(sysdate,'hh24:mi:ss'));
673:
674: EXCEPTION
675: WHEN OTHERS THEN
676: FND_MESSAGE.SET_NAME('AR', 'HZ_DQM_API_ERROR');
709:
710: select count(1) into p_count
711: from hz_dup_results ;
712:
713: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
714: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties in HZ_DUP_RESULTS before reporting '|| p_count );
715: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
716:
717:
710: select count(1) into p_count
711: from hz_dup_results ;
712:
713: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
714: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties in HZ_DUP_RESULTS before reporting '|| p_count );
715: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
716:
717:
718: insert into hz_dup_sets ( winner_party_id, dup_set_id, dup_batch_id,
711: from hz_dup_results ;
712:
713: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
714: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties in HZ_DUP_RESULTS before reporting '|| p_count );
715: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
716:
717:
718: insert into hz_dup_sets ( winner_party_id, dup_set_id, dup_batch_id,
719: status, merge_type, created_by, creation_date, last_update_login,
734: connect by prior ord_tid = ord_fid
735: )
736: where mod(levelu, 2) = 1 ;
737:
738: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
739: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties inserted to Dup Sets '||SQL%ROWCOUNT);
740: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
741:
742:
735: )
736: where mod(levelu, 2) = 1 ;
737:
738: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
739: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties inserted to Dup Sets '||SQL%ROWCOUNT);
740: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
741:
742:
743: -- REPORT WINNER AND ALL ITS DUPLICATES ( ONE OR MORE) TO HZ_DUP_SET_PARTIES
736: where mod(levelu, 2) = 1 ;
737:
738: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
739: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties inserted to Dup Sets '||SQL%ROWCOUNT);
740: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
741:
742:
743: -- REPORT WINNER AND ALL ITS DUPLICATES ( ONE OR MORE) TO HZ_DUP_SET_PARTIES
744:
741:
742:
743: -- REPORT WINNER AND ALL ITS DUPLICATES ( ONE OR MORE) TO HZ_DUP_SET_PARTIES
744:
745: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
746: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
747:
748:
749: -- this is the part for the winner
742:
743: -- REPORT WINNER AND ALL ITS DUPLICATES ( ONE OR MORE) TO HZ_DUP_SET_PARTIES
744:
745: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
746: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
747:
748:
749: -- this is the part for the winner
750: insert into hz_dup_set_parties (dup_party_id, dup_set_id,merge_seq_id,
767: from hz_dup_sets a, hz_dup_results b
768: where a.dup_batch_id = p_batch_id
769: and a.winner_party_id = b.ord_fid ;
770:
771: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties inserted to Dup Set Parties'||SQL%ROWCOUNT);
772: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
773:
774:
775:
768: where a.dup_batch_id = p_batch_id
769: and a.winner_party_id = b.ord_fid ;
770:
771: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties inserted to Dup Set Parties'||SQL%ROWCOUNT);
772: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
773:
774:
775:
776:
853: --Adding the condition of Status = A, to the 2 cursors below to fix bug 4669400.
854: --This will make sure that the Merged and Inactive Parties (with status as 'M' and 'I')
855: --will not be considered for duplicate idenfication.
856:
857: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------');
858:
859: FND_FILE.put_line(FND_FILE.log,'Start Time before insert to hz_dqm_stage_gt ' || TO_CHAR(SYSDATE, 'MM-DD-YY HH24:MI:SS'));
860: IF p_subset_sql IS NULL
861: THEN
855: --will not be considered for duplicate idenfication.
856:
857: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------');
858:
859: FND_FILE.put_line(FND_FILE.log,'Start Time before insert to hz_dqm_stage_gt ' || TO_CHAR(SYSDATE, 'MM-DD-YY HH24:MI:SS'));
860: IF p_subset_sql IS NULL
861: THEN
862: /* OPEN pt_cur FOR
863: 'SELECT parties.PARTY_ID FROM HZ_PARTIES parties WHERE parties.PARTY_TYPE <> ''PARTY_RELATIONSHIP'' AND NVL (parties.STATUS,''A'') = ''A'' AND mod(parties.PARTY_ID, :num_workers) = :worker_number' */
865: 'insert /*+ APPEND */ into HZ_MATCHED_PARTIES_GT(party_id)
866: SELECT /*+ INDEX(parties HZ_PARTIES_U1) */ parties.PARTY_ID FROM HZ_PARTIES parties WHERE parties.PARTY_TYPE <> ''PARTY_RELATIONSHIP''
867: AND NVL(parties.STATUS,''A'') = ''A'' AND mod(parties.PARTY_ID, :num_workers) = :worker_number '
868: USING p_number_of_workers, p_worker_number;
869: FND_FILE.put_line(FND_FILE.log,'Number of parties inserted into HZ_MATCHED_PARTIES_GT by worker '||p_worker_number||' is '||SQL%ROWCOUNT ); -- BUG 5351721
870: ELSE
871: /* OPEN pt_cur FOR
872: 'SELECT PARTY_ID FROM HZ_PARTIES parties WHERE parties.PARTY_TYPE <> ''PARTY_RELATIONSHIP'' AND NVL (parties.STATUS,''A'') = ''A'' AND mod(parties.PARTY_ID, :num_workers) = :worker_number AND '||
873: p_subset_sql */
875: 'insert /*+ APPEND */ into HZ_MATCHED_PARTIES_GT(party_id)
876: SELECT /*+ INDEX(parties HZ_PARTIES_U1) */ PARTY_ID FROM HZ_PARTIES parties WHERE parties.PARTY_TYPE <> ''PARTY_RELATIONSHIP'' AND NVL(parties.STATUS,''A'') = ''A''
877: AND mod(parties.PARTY_ID, :num_workers) = :worker_number AND '||
878: p_subset_sql USING p_number_of_workers, p_worker_number;
879: FND_FILE.put_line(FND_FILE.log,'Number of parties inserted into HZ_MATCHED_PARTIES_GT by worker '||p_worker_number||' is '||SQL%ROWCOUNT ); -- BUG 5351721
880: END IF;
881: FND_FILE.put_line(FND_FILE.log,'End Time after insert to HZ_MATCHED_PARTIES_GT ' || TO_CHAR(SYSDATE, 'MM-DD-YY HH24:MI:SS'));
882: COMMIT;
883:
877: AND mod(parties.PARTY_ID, :num_workers) = :worker_number AND '||
878: p_subset_sql USING p_number_of_workers, p_worker_number;
879: FND_FILE.put_line(FND_FILE.log,'Number of parties inserted into HZ_MATCHED_PARTIES_GT by worker '||p_worker_number||' is '||SQL%ROWCOUNT ); -- BUG 5351721
880: END IF;
881: FND_FILE.put_line(FND_FILE.log,'End Time after insert to HZ_MATCHED_PARTIES_GT ' || TO_CHAR(SYSDATE, 'MM-DD-YY HH24:MI:SS'));
882: COMMIT;
883:
884:
885: OPEN pt_cur FOR 'select party_id from HZ_MATCHED_PARTIES_GT'; -- BUG 5351721
888: -- we always fetch from the pid list, unless the chunk explodes
889: fetch_from_party_cursor :=true;
890:
891: LOOP
892: FND_FILE.put_line(FND_FILE.log,'Start Time before processing chunk ' || cnt || ' ' || TO_CHAR(SYSDATE, 'MM-DD-YY HH24:MI:SS')); -- BUG 5351721
893: IF NOT fetch_from_party_cursor THEN
894: --dbms_output.put_line('chunk_num '||cnt);
895: IF start_idx
972: EXISTS (Select 1 from HZ_DUP_RESULTS t
973: WHERE t.tid = party_id);
974:
975: x_rows_in_chunk:=x_rows_in_chunk-SQL%ROWCOUNT;
976: FND_FILE.put_line(FND_FILE.log,'Number of rows in chunk table ' || x_rows_in_chunk);
977: END IF;
978:
979: -- set the trap for the explosion depending on the number of rows in the chunk
980: IF x_rows_in_chunk < 50
991: EXECUTE IMMEDIATE anon_str USING IN x_trap_explosion, IN x_rows_in_chunk, OUT x_inserted_duplicates ;
992:
993: commit;
994:
995: FND_FILE.put_line(FND_FILE.log,'End Time after processing chunk ' || cnt || ' ' || TO_CHAR(SYSDATE, 'MM-DD-YY HH24:MI:SS')); -- BUG 5351721
996: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------');
997: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------');
998: cnt := cnt+1;
999:
992:
993: commit;
994:
995: FND_FILE.put_line(FND_FILE.log,'End Time after processing chunk ' || cnt || ' ' || TO_CHAR(SYSDATE, 'MM-DD-YY HH24:MI:SS')); -- BUG 5351721
996: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------');
997: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------');
998: cnt := cnt+1;
999:
1000: -- if the chunk explodes, process in chunks of 25
993: commit;
994:
995: FND_FILE.put_line(FND_FILE.log,'End Time after processing chunk ' || cnt || ' ' || TO_CHAR(SYSDATE, 'MM-DD-YY HH24:MI:SS')); -- BUG 5351721
996: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------');
997: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------');
998: cnt := cnt+1;
999:
1000: -- if the chunk explodes, process in chunks of 25
1001: IF x_inserted_duplicates = -1
1054: ret_value number;
1055: l_pkg_name varchar2(2000);
1056: BEGIN
1057:
1058: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1059: FND_FILE.put_line(FND_FILE.log,'Entering tca_sanitize_report ');
1060:
1061:
1062:
1055: l_pkg_name varchar2(2000);
1056: BEGIN
1057:
1058: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1059: FND_FILE.put_line(FND_FILE.log,'Entering tca_sanitize_report ');
1060:
1061:
1062:
1063: -- get the threshold and the auto merge threshold
1234: select count(1) into p_count
1235: from hz_imp_dup_parties
1236: where batch_id = p_batch_id;
1237:
1238: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1239: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties in HZ_IMP_DUP_PARTIES before reporting '|| p_count );
1240: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
1241:
1242: insert into hz_dup_sets ( winner_party_id, dup_set_id, dup_batch_id,
1235: from hz_imp_dup_parties
1236: where batch_id = p_batch_id;
1237:
1238: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1239: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties in HZ_IMP_DUP_PARTIES before reporting '|| p_count );
1240: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
1241:
1242: insert into hz_dup_sets ( winner_party_id, dup_set_id, dup_batch_id,
1243: status, merge_type, created_by, creation_date, last_update_login,
1236: where batch_id = p_batch_id;
1237:
1238: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1239: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties in HZ_IMP_DUP_PARTIES before reporting '|| p_count );
1240: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
1241:
1242: insert into hz_dup_sets ( winner_party_id, dup_set_id, dup_batch_id,
1243: status, merge_type, created_by, creation_date, last_update_login,
1244: last_update_date, last_updated_by)
1262:
1263: -- This is the number of winner parties ( and equivalently the number of dup sets )
1264: p_count := SQL%ROWCOUNT ;
1265:
1266: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1267: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties inserted to Dup Sets '|| p_count );
1268: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1269:
1270: -- INSERT WINNER AND ALL ITS DUPLICATES TO HZ_DUP_SET_PARTIES
1263: -- This is the number of winner parties ( and equivalently the number of dup sets )
1264: p_count := SQL%ROWCOUNT ;
1265:
1266: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1267: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties inserted to Dup Sets '|| p_count );
1268: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1269:
1270: -- INSERT WINNER AND ALL ITS DUPLICATES TO HZ_DUP_SET_PARTIES
1271: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1264: p_count := SQL%ROWCOUNT ;
1265:
1266: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1267: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties inserted to Dup Sets '|| p_count );
1268: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1269:
1270: -- INSERT WINNER AND ALL ITS DUPLICATES TO HZ_DUP_SET_PARTIES
1271: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1272: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
1267: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties inserted to Dup Sets '|| p_count );
1268: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1269:
1270: -- INSERT WINNER AND ALL ITS DUPLICATES TO HZ_DUP_SET_PARTIES
1271: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1272: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
1273: -- this is the part for the winner
1274: insert into hz_dup_set_parties (dup_party_id, dup_set_id,merge_seq_id,
1275: merge_batch_id,score,merge_flag, created_by,creation_date,last_update_login,
1268: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1269:
1270: -- INSERT WINNER AND ALL ITS DUPLICATES TO HZ_DUP_SET_PARTIES
1271: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1272: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
1273: -- this is the part for the winner
1274: insert into hz_dup_set_parties (dup_party_id, dup_set_id,merge_seq_id,
1275: merge_batch_id,score,merge_flag, created_by,creation_date,last_update_login,
1276: last_update_date,last_updated_by,dup_set_batch_id) --Bug No: 4244529
1300:
1301: -- The total number of parties inserted into hz_dup_set_parties
1302: l_party_count := SQL%ROWCOUNT ;
1303:
1304: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties inserted to Dup Set Parties '|| l_party_count);
1305: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1306:
1307: -- Number of parties in interface for which a merge has been requested
1308: -- = (Total number of parties inserted into dup set parties - Number of winners)
1301: -- The total number of parties inserted into hz_dup_set_parties
1302: l_party_count := SQL%ROWCOUNT ;
1303:
1304: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of parties inserted to Dup Set Parties '|| l_party_count);
1305: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1306:
1307: -- Number of parties in interface for which a merge has been requested
1308: -- = (Total number of parties inserted into dup set parties - Number of winners)
1309: l_party_count := l_party_count - p_count ;
1312: update hz_imp_batch_summary h
1313: set party_merge_requests = l_party_count
1314: where h.batch_id = p_batch_id ;
1315:
1316: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of merge request parties inserted into batch summary table is '
1317: || l_party_count);
1318:
1319:
1320: EXCEPTION
1350: select count(1) into p_count
1351: from hz_imp_dup_details
1352: where batch_id = p_batch_id;
1353:
1354: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1355: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of parties in HZ_IMP_DUP_DETAILS before reporting'|| p_count );
1356: FND_FILE.put_line(FND_FILE.log,'Details ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
1357:
1358: insert into hz_dup_sets ( winner_party_id, dup_set_id, dup_batch_id,
1351: from hz_imp_dup_details
1352: where batch_id = p_batch_id;
1353:
1354: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1355: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of parties in HZ_IMP_DUP_DETAILS before reporting'|| p_count );
1356: FND_FILE.put_line(FND_FILE.log,'Details ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
1357:
1358: insert into hz_dup_sets ( winner_party_id, dup_set_id, dup_batch_id,
1359: status, merge_type, created_by, creation_date, last_update_login,
1352: where batch_id = p_batch_id;
1353:
1354: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1355: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of parties in HZ_IMP_DUP_DETAILS before reporting'|| p_count );
1356: FND_FILE.put_line(FND_FILE.log,'Details ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
1357:
1358: insert into hz_dup_sets ( winner_party_id, dup_set_id, dup_batch_id,
1359: status, merge_type, created_by, creation_date, last_update_login,
1360: last_update_date, last_updated_by)
1393: )
1394: )
1395: ) ;
1396:
1397: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1398: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of parties inserted to Dup Sets '||SQL%ROWCOUNT);
1399: FND_FILE.put_line(FND_FILE.log,'Details ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1400:
1401: -- INSERT INTO HZ_DUP_SET_PARTIES, ALL THE WINNERS FROM HZ_DUP_SETS
1394: )
1395: ) ;
1396:
1397: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1398: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of parties inserted to Dup Sets '||SQL%ROWCOUNT);
1399: FND_FILE.put_line(FND_FILE.log,'Details ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1400:
1401: -- INSERT INTO HZ_DUP_SET_PARTIES, ALL THE WINNERS FROM HZ_DUP_SETS
1402: -- FOR THE GIVEN BATCH
1395: ) ;
1396:
1397: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1398: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of parties inserted to Dup Sets '||SQL%ROWCOUNT);
1399: FND_FILE.put_line(FND_FILE.log,'Details ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1400:
1401: -- INSERT INTO HZ_DUP_SET_PARTIES, ALL THE WINNERS FROM HZ_DUP_SETS
1402: -- FOR THE GIVEN BATCH
1403: insert into hz_dup_set_parties (dup_party_id, dup_set_id,merge_seq_id,
1410: from hz_dup_sets a
1411: where a.dup_batch_id = l_dup_batch_id
1412: and a.merge_type = 'SAME_PARTY_MERGE';
1413:
1414: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1415: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of parties inserted to Dup Set Parties '||SQL%ROWCOUNT);
1416: FND_FILE.put_line(FND_FILE.log,'Details ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1417:
1418: FND_FILE.put_line(FND_FILE.log,'Details ::: total merge request count is '
1411: where a.dup_batch_id = l_dup_batch_id
1412: and a.merge_type = 'SAME_PARTY_MERGE';
1413:
1414: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1415: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of parties inserted to Dup Set Parties '||SQL%ROWCOUNT);
1416: FND_FILE.put_line(FND_FILE.log,'Details ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1417:
1418: FND_FILE.put_line(FND_FILE.log,'Details ::: total merge request count is '
1419: || l_party_count);
1412: and a.merge_type = 'SAME_PARTY_MERGE';
1413:
1414: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1415: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of parties inserted to Dup Set Parties '||SQL%ROWCOUNT);
1416: FND_FILE.put_line(FND_FILE.log,'Details ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1417:
1418: FND_FILE.put_line(FND_FILE.log,'Details ::: total merge request count is '
1419: || l_party_count);
1420:
1414: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1415: FND_FILE.put_line(FND_FILE.log,'Details ::: Number of parties inserted to Dup Set Parties '||SQL%ROWCOUNT);
1416: FND_FILE.put_line(FND_FILE.log,'Details ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1417:
1418: FND_FILE.put_line(FND_FILE.log,'Details ::: total merge request count is '
1419: || l_party_count);
1420:
1421: -- Updating counts to Batch Summary
1422: -- Party Site Count
1459: update hz_imp_batch_summary h
1460: set total_merge_requests = l_party_count
1461: where h.batch_id = p_batch_id ;
1462:
1463: FND_FILE.put_line(FND_FILE.log,'Details ::: Total Number of merge requests inserted into batch summary table is '
1464: || l_party_count);
1465:
1466:
1467: EXCEPTION
1500: x_return_status,x_msg_count,x_msg_data);
1501:
1502: IF x_return_status <> FND_API.G_RET_STS_SUCCESS
1503: THEN
1504: FND_FILE.put_line(FND_FILE.log,'Staging Unsuccessful - pop_int_tca_search_tab did not return success');
1505: return;
1506: END IF;
1507:
1508: -- get the threshold and the auto merge threshold
1772: BEGIN
1773: -- initialize API return status to success.
1774: x_return_status := FND_API.G_RET_STS_SUCCESS;
1775:
1776: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1777: FND_FILE.put_line(FND_FILE.log,'Entering interface_tca_sanitize_report ');
1778:
1779: -- report all the tca parties that find duplicates in the interface
1780: report_int_tca_dup_parties (p_batch_id, p_match_rule_id, p_request_id, x_dup_batch_id, x_party_count);
1773: -- initialize API return status to success.
1774: x_return_status := FND_API.G_RET_STS_SUCCESS;
1775:
1776: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1777: FND_FILE.put_line(FND_FILE.log,'Entering interface_tca_sanitize_report ');
1778:
1779: -- report all the tca parties that find duplicates in the interface
1780: report_int_tca_dup_parties (p_batch_id, p_match_rule_id, p_request_id, x_dup_batch_id, x_party_count);
1781:
1848: )
1849: where mod(levelu, 2) = 1 ;
1850: */
1851:
1852: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1853: FND_FILE.put_line(FND_FILE.log,'Parties ::: Reporting winners to HZ_IMP_INT_DEDUP_RESULTS ');
1854: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
1855:
1856:
1849: where mod(levelu, 2) = 1 ;
1850: */
1851:
1852: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1853: FND_FILE.put_line(FND_FILE.log,'Parties ::: Reporting winners to HZ_IMP_INT_DEDUP_RESULTS ');
1854: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
1855:
1856:
1857:
1850: */
1851:
1852: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1853: FND_FILE.put_line(FND_FILE.log,'Parties ::: Reporting winners to HZ_IMP_INT_DEDUP_RESULTS ');
1854: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
1855:
1856:
1857:
1858: -- we use the temporary table hz_int_dup_results_gt, instead of
1881: connect by prior ord_t_osr = ord_f_osr and prior batch_id = batch_id
1882: )
1883: where mod(levelu, 2) = 1 ;
1884:
1885: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of winner parties inserted to HZ_IMP_INT_DEDUP_RESULTS '||SQL%ROWCOUNT);
1886: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1887:
1888: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1889: FND_FILE.put_line(FND_FILE.log,'Parties ::: Reporting duplicate parties to HZ_IMP_INT_DEDUP_RESULTS ');
1882: )
1883: where mod(levelu, 2) = 1 ;
1884:
1885: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of winner parties inserted to HZ_IMP_INT_DEDUP_RESULTS '||SQL%ROWCOUNT);
1886: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1887:
1888: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1889: FND_FILE.put_line(FND_FILE.log,'Parties ::: Reporting duplicate parties to HZ_IMP_INT_DEDUP_RESULTS ');
1890: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
1884:
1885: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of winner parties inserted to HZ_IMP_INT_DEDUP_RESULTS '||SQL%ROWCOUNT);
1886: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1887:
1888: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1889: FND_FILE.put_line(FND_FILE.log,'Parties ::: Reporting duplicate parties to HZ_IMP_INT_DEDUP_RESULTS ');
1890: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
1891:
1892:
1885: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of winner parties inserted to HZ_IMP_INT_DEDUP_RESULTS '||SQL%ROWCOUNT);
1886: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1887:
1888: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1889: FND_FILE.put_line(FND_FILE.log,'Parties ::: Reporting duplicate parties to HZ_IMP_INT_DEDUP_RESULTS ');
1890: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
1891:
1892:
1893: -- Take inserted winner party osrs from hz_imp_int_dedup_results , join with
1886: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1887:
1888: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
1889: FND_FILE.put_line(FND_FILE.log,'Parties ::: Reporting duplicate parties to HZ_IMP_INT_DEDUP_RESULTS ');
1890: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of insert '||to_char(sysdate,'hh24:mi:ss'));
1891:
1892:
1893: -- Take inserted winner party osrs from hz_imp_int_dedup_results , join with
1894: -- hz_int_dup_results_gt and insert the winner, dup pair to hz_imp_int_dedup_results
1905: from hz_imp_int_dedup_results a, hz_int_dup_results_gt b
1906: where a.batch_id = p_batch_id and b.batch_id = p_batch_id and a.entity = 'PARTY'
1907: and b.ord_f_osr = a.winner_record_osr ;
1908:
1909: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of duplicate parties inserted to HZ_IMP_INT_DEDUP_RESULTS '||SQL%ROWCOUNT);
1910: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1911:
1912:
1913:
1906: where a.batch_id = p_batch_id and b.batch_id = p_batch_id and a.entity = 'PARTY'
1907: and b.ord_f_osr = a.winner_record_osr ;
1908:
1909: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of duplicate parties inserted to HZ_IMP_INT_DEDUP_RESULTS '||SQL%ROWCOUNT);
1910: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1911:
1912:
1913:
1914: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of update for getting import table dates '||to_char(sysdate,'hh24:mi:ss'));
1910: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of insert '||to_char(sysdate,'hh24:mi:ss'));
1911:
1912:
1913:
1914: FND_FILE.put_line(FND_FILE.log,'Parties ::: Begin time of update for getting import table dates '||to_char(sysdate,'hh24:mi:ss'));
1915:
1916: -- Bug Fix 3588873 :: Need to report the import interface table dates for all the duplicates
1917: -- We take of the "PARTY" entity here.
1918: update hz_imp_int_dedup_results a
1924: and b.party_orig_system = a.dup_record_os
1925: )
1926: where a.entity = 'PARTY' and a.batch_id = p_batch_id ;
1927:
1928: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of duplicate parties updated in HZ_IMP_INT_DEDUP_RESULTS '||SQL%ROWCOUNT);
1929: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of update for getting import table dates '||to_char(sysdate,'hh24:mi:ss'));
1930:
1931: --bug 5393826
1932: FND_FILE.put_line(FND_FILE.log,'Parties ::: Deleting Party Duplicate sets for which no records exist in import party interface table '||to_char(sysdate,'hh24:mi:ss'));
1925: )
1926: where a.entity = 'PARTY' and a.batch_id = p_batch_id ;
1927:
1928: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of duplicate parties updated in HZ_IMP_INT_DEDUP_RESULTS '||SQL%ROWCOUNT);
1929: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of update for getting import table dates '||to_char(sysdate,'hh24:mi:ss'));
1930:
1931: --bug 5393826
1932: FND_FILE.put_line(FND_FILE.log,'Parties ::: Deleting Party Duplicate sets for which no records exist in import party interface table '||to_char(sysdate,'hh24:mi:ss'));
1933:
1928: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of duplicate parties updated in HZ_IMP_INT_DEDUP_RESULTS '||SQL%ROWCOUNT);
1929: FND_FILE.put_line(FND_FILE.log,'Parties ::: End time of update for getting import table dates '||to_char(sysdate,'hh24:mi:ss'));
1930:
1931: --bug 5393826
1932: FND_FILE.put_line(FND_FILE.log,'Parties ::: Deleting Party Duplicate sets for which no records exist in import party interface table '||to_char(sysdate,'hh24:mi:ss'));
1933:
1934: delete from hz_imp_int_dedup_results a
1935: where a.entity = 'PARTY'
1936: and a.batch_id = p_batch_id
1941: and a.winner_record_osr = b.party_orig_system_reference
1942: and a.winner_record_os = b.party_orig_system
1943: );
1944:
1945: FND_FILE.put_line(FND_FILE.log,'Parties ::: Delete Complete '||to_char(sysdate,'hh24:mi:ss'));
1946: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of rows deleted is ' || SQL%ROWCOUNT );
1947: --bug 5393826
1948:
1949:
1942: and a.winner_record_os = b.party_orig_system
1943: );
1944:
1945: FND_FILE.put_line(FND_FILE.log,'Parties ::: Delete Complete '||to_char(sysdate,'hh24:mi:ss'));
1946: FND_FILE.put_line(FND_FILE.log,'Parties ::: Number of rows deleted is ' || SQL%ROWCOUNT );
1947: --bug 5393826
1948:
1949:
1950: EXCEPTION
2025: BEGIN
2026: -- initialize API return status to success.
2027: x_return_status := FND_API.G_RET_STS_SUCCESS;
2028:
2029: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
2030: FND_FILE.put_line(FND_FILE.log,'Entering interface_sanitize_report ');
2031:
2032:
2033:
2026: -- initialize API return status to success.
2027: x_return_status := FND_API.G_RET_STS_SUCCESS;
2028:
2029: FND_FILE.put_line(FND_FILE.log,'------------------------------------------------------------');
2030: FND_FILE.put_line(FND_FILE.log,'Entering interface_sanitize_report ');
2031:
2032:
2033:
2034: -- get the threshold for the match rule