56: l_xml_string varchar2(32000);
57: l_business_group_name varchar2(240);
58: l_result CLOB;
59:
60: qryCtx DBMS_XMLGEN.ctxHandle;
61:
62: BEGIN
63: l_report_date := to_date ('30-06'|| p_reporting_year,'dd-mm-yyyy');
64:
343: IF (hr_utility.debug_enabled) THEN
344: FND_FILE.PUT_LINE(FND_FILE.LOG,l_query3);
345: END IF;
346:
347: qryCtx := dbms_xmlgen.newContext (l_query3);
348: l_xml_string := '';
349: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
350: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
351:
353: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
354: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
355:
356: --Load 5 records at a time
357: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
358:
359: LOOP
360: --save the XML into the CLOB field
361: l_result := DBMS_XMLGEN.getXML(qryCtx);
357: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
358:
359: LOOP
360: --save the XML into the CLOB field
361: l_result := DBMS_XMLGEN.getXML(qryCtx);
362:
363: --Extract the 5 records
364: l_xml_string := substr( l_result, instr(l_result,'
365: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
361: l_result := DBMS_XMLGEN.getXML(qryCtx);
362:
363: --Extract the 5 records
364: l_xml_string := substr( l_result, instr(l_result,'
365: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
366:
367: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
368: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
369: END LOOP;
371: --execute l_query5
372: IF (hr_utility.debug_enabled) THEN
373: FND_FILE.PUT_LINE(FND_FILE.LOG,l_query5);
374: END IF;
375: qryCtx := dbms_xmlgen.newContext (l_query5);
376:
377: --Load 5 records at a time
378: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
379:
374: END IF;
375: qryCtx := dbms_xmlgen.newContext (l_query5);
376:
377: --Load 5 records at a time
378: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
379:
380: LOOP
381: --save the XML into the CLOB field
382: l_result := DBMS_XMLGEN.getXML(qryCtx);
378: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
379:
380: LOOP
381: --save the XML into the CLOB field
382: l_result := DBMS_XMLGEN.getXML(qryCtx);
383:
384: --Extract the 5 records
385: l_xml_string := substr( l_result, instr(l_result,'
386:
383:
384: --Extract the 5 records
385: l_xml_string := substr( l_result, instr(l_result,'
386:
387: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
388:
389: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
390: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
391: END LOOP;
393: --execute l_query4
394: IF (hr_utility.debug_enabled) THEN
395: FND_FILE.PUT_LINE(FND_FILE.LOG,l_query4);
396: END IF;
397: qryCtx := dbms_xmlgen.newContext (l_query4);
398:
399: --Load 5 records at a time
400: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
401:
396: END IF;
397: qryCtx := dbms_xmlgen.newContext (l_query4);
398:
399: --Load 5 records at a time
400: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
401:
402: LOOP
403: --save the XML into the CLOB field
404: l_result := DBMS_XMLGEN.getXML(qryCtx);
400: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
401:
402: LOOP
403: --save the XML into the CLOB field
404: l_result := DBMS_XMLGEN.getXML(qryCtx);
405:
406: --Extract the 5 records
407: l_xml_string := substr( l_result, instr(l_result,'
408:
405:
406: --Extract the 5 records
407: l_xml_string := substr( l_result, instr(l_result,'
408:
409: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
410:
411: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
412: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
413: END LOOP;
415: --execute l_query1
416: IF (hr_utility.debug_enabled) THEN
417: FND_FILE.PUT_LINE(FND_FILE.LOG,l_query1);
418: END IF;
419: qryCtx := dbms_xmlgen.newContext (l_query1);
420:
421: --Load 5 records at a time
422: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
423:
418: END IF;
419: qryCtx := dbms_xmlgen.newContext (l_query1);
420:
421: --Load 5 records at a time
422: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
423:
424: LOOP
425: --save the XML into the CLOB field
426: l_result := DBMS_XMLGEN.getXML(qryCtx);
422: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
423:
424: LOOP
425: --save the XML into the CLOB field
426: l_result := DBMS_XMLGEN.getXML(qryCtx);
427:
428: --Extract the 5 records
429: l_xml_string := substr( l_result, instr(l_result,'
430:
427:
428: --Extract the 5 records
429: l_xml_string := substr( l_result, instr(l_result,'
430:
431: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
432:
433: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
434: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
435: END LOOP;
437: --execute l_query2
438: IF (hr_utility.debug_enabled) THEN
439: FND_FILE.PUT_LINE(FND_FILE.LOG,l_query2);
440: END IF;
441: qryCtx := dbms_xmlgen.newContext (l_query2);
442:
443: --Load 5 records at a time
444: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
445:
440: END IF;
441: qryCtx := dbms_xmlgen.newContext (l_query2);
442:
443: --Load 5 records at a time
444: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
445:
446: LOOP
447: --save the XML into the CLOB field
448: l_result := DBMS_XMLGEN.getXML(qryCtx);
444: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
445:
446: LOOP
447: --save the XML into the CLOB field
448: l_result := DBMS_XMLGEN.getXML(qryCtx);
449:
450: --Extract the 5 records
451: l_xml_string := substr( l_result, instr(l_result,'
452:
449:
450: --Extract the 5 records
451: l_xml_string := substr( l_result, instr(l_result,'
452:
453: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
454:
455: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
456: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
457: END LOOP;
459: --execute l_query6
460: IF (hr_utility.debug_enabled) THEN
461: FND_FILE.PUT_LINE(FND_FILE.LOG,l_query6);
462: END IF;
463: qryCtx := dbms_xmlgen.newContext (l_query6);
464:
465: --Load 5 records at a time
466: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
467:
462: END IF;
463: qryCtx := dbms_xmlgen.newContext (l_query6);
464:
465: --Load 5 records at a time
466: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
467:
468: LOOP
469: --save the XML into the CLOB field
470: l_result := DBMS_XMLGEN.getXML(qryCtx);
466: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
467:
468: LOOP
469: --save the XML into the CLOB field
470: l_result := DBMS_XMLGEN.getXML(qryCtx);
471:
472: --Extract the 5 records
473: l_xml_string := substr( l_result, instr(l_result,'
474:
471:
472: --Extract the 5 records
473: l_xml_string := substr( l_result, instr(l_result,'
474:
475: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
476:
477: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
478: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
479: END LOOP;