112: select count(party_id) into l_entity_cnt from hz_parties where party_type = 'ORGANIZATION';
113: l_xml_header := l_xml_header ||l_new_line||'
114: select count(party_id) into l_staged_cnt from hz_staged_parties where TX36 = 'ORGANIZATION ';
115: l_xml_header := l_xml_header ||l_new_line||'
116: select count(distinct(party_id)) into l_sync_cnt from hz_dqm_sync_interface where entity='PARTY'
117: and party_id in (select party_id from hz_parties where party_type = 'ORGANIZATION' );
118: l_xml_header := l_xml_header ||l_new_line||'
119:
120: select count(party_id) into l_entity_cnt from hz_parties where party_type = 'PERSON';
120: select count(party_id) into l_entity_cnt from hz_parties where party_type = 'PERSON';
121: l_xml_header := l_xml_header ||l_new_line||'
122: select count(party_id) into l_staged_cnt from hz_staged_parties where TX36 = 'PERSON ' ;
123: l_xml_header := l_xml_header ||l_new_line||'
124: select count(distinct(party_id)) into l_sync_cnt from hz_dqm_sync_interface where entity='PARTY'
125: and party_id in (select party_id from hz_parties where party_type = 'PERSON');
126: l_xml_header := l_xml_header ||l_new_line||'
127: l_xml_header := l_xml_header ||l_new_line||'
128: l_xml_header := l_xml_header ||l_new_line||'
130: select count(party_id) into l_entity_cnt from hz_parties where party_type in ('ORGANIZATION','PERSON');
131: l_xml_header := l_xml_header ||l_new_line||'
132: select count(party_id) into l_staged_cnt from hz_staged_parties where TX36 in ('ORGANIZATION ','PERSON ');
133: l_xml_header := l_xml_header ||l_new_line||'
134: select count(distinct(party_id)) into l_sync_cnt from hz_dqm_sync_interface where entity='PARTY'
135: and party_id in (select party_id from hz_parties where party_type in ('ORGANIZATION','PERSON'));
136: l_xml_header := l_xml_header ||l_new_line||'
137:
138: select count(party_site_id) into l_entity_cnt from hz_party_sites where party_id in
140: l_xml_header := l_xml_header ||l_new_line||'
141: select count(party_site_id) into l_staged_cnt from hz_staged_party_sites where org_contact_id IS NULL and party_id in
142: (select party_id from hz_staged_parties where TX36 in ('ORGANIZATION ','PERSON ')) ;
143: l_xml_header := l_xml_header ||l_new_line||'
144: select count(distinct(party_id)) into l_sync_cnt from hz_dqm_sync_interface where entity='PARTY_SITES'
145: and party_id in (select party_id from hz_parties where party_type in ('ORGANIZATION','PERSON'));
146: l_xml_header := l_xml_header ||l_new_line||'
147: l_xml_header := l_xml_header ||l_new_line||'
148: l_xml_header := l_xml_header ||l_new_line||'
159: and object_table_name='HZ_PARTIES' and subject_type in ('ORGANIZATION','PERSON')
160: and object_type in ('ORGANIZATION','PERSON')));
161:
162: l_xml_header := l_xml_header ||l_new_line||'
163: select count(distinct(party_id)) into l_sync_cnt from hz_dqm_sync_interface where entity='CONTACTS'
164: and party_id in (select party_id from hz_parties where party_type in ('ORGANIZATION','PERSON'));
165: l_xml_header := l_xml_header ||l_new_line||'
166: l_xml_header := l_xml_header ||l_new_line||'
167: l_xml_header := l_xml_header ||l_new_line||'
171:
172: select count(contact_point_id) into l_staged_cnt from hz_staged_contact_points where contact_point_id in
173: (select contact_point_id from hz_contact_points where owner_table_name in ('HZ_PARTIES','HZ_PARTY_SITES'));
174: l_xml_header := l_xml_header ||l_new_line||'
175: select count(distinct(party_id)) into l_sync_cnt from hz_dqm_sync_interface where entity='CONTACT_POINTS'
176: and party_id in (select party_id from hz_parties where party_type in ('ORGANIZATION','PERSON'));
177: l_xml_header := l_xml_header ||l_new_line||'
178: l_xml_header := l_xml_header ||l_new_line||'
179: l_xml_header := l_xml_header || l_new_line||'
400: l_result_length,l_resultOffset);
401: END IF;
402:
403:
404: qryCtx := dbms_xmlgen.newContext('select ''PARTY'' entity,''Processing'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
405: ' where entity=''PARTY'' and staged_flag=''P'' group by entity,staged_flag '||
406: ' UNION '||
407: ' select ''PARTY'' entity,''Pending'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
408: ' where entity=''PARTY'' and staged_flag=''N'' group by entity,staged_flag '||
403:
404: qryCtx := dbms_xmlgen.newContext('select ''PARTY'' entity,''Processing'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
405: ' where entity=''PARTY'' and staged_flag=''P'' group by entity,staged_flag '||
406: ' UNION '||
407: ' select ''PARTY'' entity,''Pending'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
408: ' where entity=''PARTY'' and staged_flag=''N'' group by entity,staged_flag '||
409: ' UNION '||
410: ' select ''PARTY'' entity,''Staged but not Indexed'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
411: ' where entity=''PARTY'' and staged_flag=''Y'' group by entity,staged_flag '||
406: ' UNION '||
407: ' select ''PARTY'' entity,''Pending'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
408: ' where entity=''PARTY'' and staged_flag=''N'' group by entity,staged_flag '||
409: ' UNION '||
410: ' select ''PARTY'' entity,''Staged but not Indexed'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
411: ' where entity=''PARTY'' and staged_flag=''Y'' group by entity,staged_flag '||
412: ' UNION '||
413: ' select ''PARTY'' entity,''Error'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
414: ' where entity=''PARTY'' and staged_flag=''E'' group by entity,staged_flag '||
409: ' UNION '||
410: ' select ''PARTY'' entity,''Staged but not Indexed'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
411: ' where entity=''PARTY'' and staged_flag=''Y'' group by entity,staged_flag '||
412: ' UNION '||
413: ' select ''PARTY'' entity,''Error'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
414: ' where entity=''PARTY'' and staged_flag=''E'' group by entity,staged_flag '||
415: ' UNION '||
416: ' select ''PARTY_SITES'' entity,''Processing'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
417: ' where entity=''PARTY_SITES'' and staged_flag=''P'' group by entity,staged_flag '||
412: ' UNION '||
413: ' select ''PARTY'' entity,''Error'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
414: ' where entity=''PARTY'' and staged_flag=''E'' group by entity,staged_flag '||
415: ' UNION '||
416: ' select ''PARTY_SITES'' entity,''Processing'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
417: ' where entity=''PARTY_SITES'' and staged_flag=''P'' group by entity,staged_flag '||
418: ' UNION '||
419: ' select ''PARTY_SITES'' entity,''Pending'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
420: ' where entity=''PARTY_SITES'' and staged_flag=''N'' group by entity,staged_flag '||
415: ' UNION '||
416: ' select ''PARTY_SITES'' entity,''Processing'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
417: ' where entity=''PARTY_SITES'' and staged_flag=''P'' group by entity,staged_flag '||
418: ' UNION '||
419: ' select ''PARTY_SITES'' entity,''Pending'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
420: ' where entity=''PARTY_SITES'' and staged_flag=''N'' group by entity,staged_flag '||
421: ' UNION '||
422: ' select ''PARTY_SITES'' entity,''Staged but not Indexed'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
423: ' where entity=''PARTY_SITES'' and staged_flag=''Y'' group by entity,staged_flag '||
418: ' UNION '||
419: ' select ''PARTY_SITES'' entity,''Pending'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
420: ' where entity=''PARTY_SITES'' and staged_flag=''N'' group by entity,staged_flag '||
421: ' UNION '||
422: ' select ''PARTY_SITES'' entity,''Staged but not Indexed'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
423: ' where entity=''PARTY_SITES'' and staged_flag=''Y'' group by entity,staged_flag '||
424: ' UNION '||
425: ' select ''PARTY_SITES'' entity,''Error'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
426: ' where entity=''PARTY_SITES'' and staged_flag=''E'' group by entity,staged_flag '||
421: ' UNION '||
422: ' select ''PARTY_SITES'' entity,''Staged but not Indexed'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
423: ' where entity=''PARTY_SITES'' and staged_flag=''Y'' group by entity,staged_flag '||
424: ' UNION '||
425: ' select ''PARTY_SITES'' entity,''Error'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
426: ' where entity=''PARTY_SITES'' and staged_flag=''E'' group by entity,staged_flag '||
427: ' UNION '||
428: ' select ''CONTACTS'' entity,''Processing'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
429: ' where entity=''CONTACTS'' and staged_flag=''P'' group by entity,staged_flag '||
424: ' UNION '||
425: ' select ''PARTY_SITES'' entity,''Error'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
426: ' where entity=''PARTY_SITES'' and staged_flag=''E'' group by entity,staged_flag '||
427: ' UNION '||
428: ' select ''CONTACTS'' entity,''Processing'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
429: ' where entity=''CONTACTS'' and staged_flag=''P'' group by entity,staged_flag '||
430: ' UNION '||
431: ' select ''CONTACTS'' entity,''Pending'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
432: ' where entity=''CONTACTS'' and staged_flag=''N'' group by entity,staged_flag '||
427: ' UNION '||
428: ' select ''CONTACTS'' entity,''Processing'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
429: ' where entity=''CONTACTS'' and staged_flag=''P'' group by entity,staged_flag '||
430: ' UNION '||
431: ' select ''CONTACTS'' entity,''Pending'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
432: ' where entity=''CONTACTS'' and staged_flag=''N'' group by entity,staged_flag '||
433: ' UNION '||
434: ' select ''CONTACTS'' entity,''Staged but not Indexed'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
435: ' where entity=''CONTACTS'' and staged_flag=''Y'' group by entity,staged_flag '||
430: ' UNION '||
431: ' select ''CONTACTS'' entity,''Pending'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
432: ' where entity=''CONTACTS'' and staged_flag=''N'' group by entity,staged_flag '||
433: ' UNION '||
434: ' select ''CONTACTS'' entity,''Staged but not Indexed'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
435: ' where entity=''CONTACTS'' and staged_flag=''Y'' group by entity,staged_flag '||
436: ' UNION '||
437: ' select ''CONTACTS'' entity,''Error'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
438: ' where entity=''CONTACTS'' and staged_flag=''E'' group by entity,staged_flag '||
433: ' UNION '||
434: ' select ''CONTACTS'' entity,''Staged but not Indexed'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
435: ' where entity=''CONTACTS'' and staged_flag=''Y'' group by entity,staged_flag '||
436: ' UNION '||
437: ' select ''CONTACTS'' entity,''Error'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
438: ' where entity=''CONTACTS'' and staged_flag=''E'' group by entity,staged_flag '||
439: ' UNION '||
440: ' select ''CONTACT_POINTS'' entity,''Processing'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
441: ' where entity=''CONTACT_POINTS'' and staged_flag=''P'' group by entity,staged_flag '||
436: ' UNION '||
437: ' select ''CONTACTS'' entity,''Error'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
438: ' where entity=''CONTACTS'' and staged_flag=''E'' group by entity,staged_flag '||
439: ' UNION '||
440: ' select ''CONTACT_POINTS'' entity,''Processing'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
441: ' where entity=''CONTACT_POINTS'' and staged_flag=''P'' group by entity,staged_flag '||
442: ' UNION '||
443: ' select ''CONTACT_POINTS'' entity,''Pending'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
444: ' where entity=''CONTACT_POINTS'' and staged_flag=''N'' group by entity,staged_flag '||
439: ' UNION '||
440: ' select ''CONTACT_POINTS'' entity,''Processing'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
441: ' where entity=''CONTACT_POINTS'' and staged_flag=''P'' group by entity,staged_flag '||
442: ' UNION '||
443: ' select ''CONTACT_POINTS'' entity,''Pending'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
444: ' where entity=''CONTACT_POINTS'' and staged_flag=''N'' group by entity,staged_flag '||
445: ' UNION '||
446: ' select ''CONTACT_POINTS'' entity,''Staged but not Indexed'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
447: ' where entity=''CONTACT_POINTS'' and staged_flag=''Y'' group by entity,staged_flag '||
442: ' UNION '||
443: ' select ''CONTACT_POINTS'' entity,''Pending'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
444: ' where entity=''CONTACT_POINTS'' and staged_flag=''N'' group by entity,staged_flag '||
445: ' UNION '||
446: ' select ''CONTACT_POINTS'' entity,''Staged but not Indexed'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
447: ' where entity=''CONTACT_POINTS'' and staged_flag=''Y'' group by entity,staged_flag '||
448: ' UNION '||
449: ' select ''CONTACT_POINTS'' entity,''Error'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
450: ' where entity=''CONTACT_POINTS'' and staged_flag=''E'' group by entity,staged_flag ');
445: ' UNION '||
446: ' select ''CONTACT_POINTS'' entity,''Staged but not Indexed'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
447: ' where entity=''CONTACT_POINTS'' and staged_flag=''Y'' group by entity,staged_flag '||
448: ' UNION '||
449: ' select ''CONTACT_POINTS'' entity,''Error'' stage_status, nvl(sum(count(1)),0) SYNC_COUNT from hz_dqm_sync_interface '||
450: ' where entity=''CONTACT_POINTS'' and staged_flag=''E'' group by entity,staged_flag ');
451: DBMS_XMLGEN.setRowTag(qryCtx, 'Interface table Data');
452: l_result := DBMS_XMLGEN.getXML(qryCtx);
453: l_rows_processed := DBMS_XMLGEN.getNumRowsProcessed(qryCtx);
458: l_result_length,l_resultOffset);
459: END IF;
460:
461: qryCtx := dbms_xmlgen.newContext('select party_id,record_id,entity,decode(operation,''U'',''Update'',''C'',''Create'',operation) operation,''Error'' staged_flag ,org_contact_id,party_site_id,error_data
462: from hz_dqm_sync_interface where staged_flag=''E''
463: group by entity,entity,operation,party_id,record_id,staged_flag,org_contact_id,party_site_id,error_data ');
464: DBMS_XMLGEN.setRowTag(qryCtx, 'Sync Interface table Errors per Entity');
465: l_result := DBMS_XMLGEN.getXML(qryCtx);
466: l_rows_processed := DBMS_XMLGEN.getNumRowsProcessed(qryCtx);