45: ,p_tenured VARCHAR2 -- #14532440
46: ,p_race_gender VARCHAR2 -- #14532440
47: )
48: IS
49: qryCtx DBMS_XMLGEN.ctxHandle;
50: l_result CLOB;
51:
52: -- Added for bug#11736960
53: l_query1 varchar2(10000);
458: FND_FILE.PUT_LINE(FND_FILE.LOG,l_query1);
459: --FND_FILE.PUT_LINE(FND_FILE.LOG,l_query);
460:
461: -- Added for bug#11736960
462: qryCtx := dbms_xmlgen.newContext (l_query1);
463: --qryCtx := dbms_xmlgen.newContext (l_query);
464:
465: --Load 5 records at a time
466: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
459: --FND_FILE.PUT_LINE(FND_FILE.LOG,l_query);
460:
461: -- Added for bug#11736960
462: qryCtx := dbms_xmlgen.newContext (l_query1);
463: --qryCtx := dbms_xmlgen.newContext (l_query);
464:
465: --Load 5 records at a time
466: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
467: LOOP
462: qryCtx := dbms_xmlgen.newContext (l_query1);
463: --qryCtx := dbms_xmlgen.newContext (l_query);
464:
465: --Load 5 records at a time
466: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
467: LOOP
468: --save the XML into the CLOB field
469: l_result := DBMS_XMLGEN.getXML(qryCtx);
470: l_xml_string := substr( l_result, instr(l_result,'
465: --Load 5 records at a time
466: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
467: LOOP
468: --save the XML into the CLOB field
469: l_result := DBMS_XMLGEN.getXML(qryCtx);
470: l_xml_string := substr( l_result, instr(l_result,'
471: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
472: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
473: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
467: LOOP
468: --save the XML into the CLOB field
469: l_result := DBMS_XMLGEN.getXML(qryCtx);
470: l_xml_string := substr( l_result, instr(l_result,'
471: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
472: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
473: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
474:
475: END LOOP;
476:
477: -- Added for bug#11736960
478: FND_FILE.PUT_LINE(FND_FILE.LOG,l_query2);
479:
480: qryCtx := dbms_xmlgen.newContext (l_query2);
481:
482: --Load 5 records at a time
483: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
484: LOOP
479:
480: qryCtx := dbms_xmlgen.newContext (l_query2);
481:
482: --Load 5 records at a time
483: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
484: LOOP
485: --save the XML into the CLOB field
486: l_result := DBMS_XMLGEN.getXML(qryCtx);
487: l_xml_string := substr( l_result, instr(l_result,'
482: --Load 5 records at a time
483: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
484: LOOP
485: --save the XML into the CLOB field
486: l_result := DBMS_XMLGEN.getXML(qryCtx);
487: l_xml_string := substr( l_result, instr(l_result,'
488: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
489: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
490: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
484: LOOP
485: --save the XML into the CLOB field
486: l_result := DBMS_XMLGEN.getXML(qryCtx);
487: l_xml_string := substr( l_result, instr(l_result,'
488: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
489: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
490: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
491:
492: END LOOP;
494:
495: -- Added for bug #14831074 start
496: FND_FILE.PUT_LINE(FND_FILE.LOG,l_query3);
497:
498: qryCtx := dbms_xmlgen.newContext (l_query3);
499:
500: --Load 5 records at a time
501: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
502: LOOP
497:
498: qryCtx := dbms_xmlgen.newContext (l_query3);
499:
500: --Load 5 records at a time
501: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
502: LOOP
503: --save the XML into the CLOB field
504: l_result := DBMS_XMLGEN.getXML(qryCtx);
505: l_xml_string := substr( l_result, instr(l_result,'
500: --Load 5 records at a time
501: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
502: LOOP
503: --save the XML into the CLOB field
504: l_result := DBMS_XMLGEN.getXML(qryCtx);
505: l_xml_string := substr( l_result, instr(l_result,'
506: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
507: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
508: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
502: LOOP
503: --save the XML into the CLOB field
504: l_result := DBMS_XMLGEN.getXML(qryCtx);
505: l_xml_string := substr( l_result, instr(l_result,'
506: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
507: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
508: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
509:
510: END LOOP;
510: END LOOP;
511:
512: FND_FILE.PUT_LINE(FND_FILE.LOG,l_query4);
513:
514: qryCtx := dbms_xmlgen.newContext (l_query4);
515:
516: --Load 5 records at a time
517: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
518: LOOP
513:
514: qryCtx := dbms_xmlgen.newContext (l_query4);
515:
516: --Load 5 records at a time
517: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
518: LOOP
519: --save the XML into the CLOB field
520: l_result := DBMS_XMLGEN.getXML(qryCtx);
521: l_xml_string := substr( l_result, instr(l_result,'
516: --Load 5 records at a time
517: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
518: LOOP
519: --save the XML into the CLOB field
520: l_result := DBMS_XMLGEN.getXML(qryCtx);
521: l_xml_string := substr( l_result, instr(l_result,'
522: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
523: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
524: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
518: LOOP
519: --save the XML into the CLOB field
520: l_result := DBMS_XMLGEN.getXML(qryCtx);
521: l_xml_string := substr( l_result, instr(l_result,'
522: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
523: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
524: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
525:
526: END LOOP;
526: END LOOP;
527:
528: FND_FILE.PUT_LINE(FND_FILE.LOG,l_query5);
529:
530: qryCtx := dbms_xmlgen.newContext (l_query5);
531:
532: --Load 5 records at a time
533: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
534: LOOP
529:
530: qryCtx := dbms_xmlgen.newContext (l_query5);
531:
532: --Load 5 records at a time
533: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
534: LOOP
535: --save the XML into the CLOB field
536: l_result := DBMS_XMLGEN.getXML(qryCtx);
537: l_xml_string := substr( l_result, instr(l_result,'
532: --Load 5 records at a time
533: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
534: LOOP
535: --save the XML into the CLOB field
536: l_result := DBMS_XMLGEN.getXML(qryCtx);
537: l_xml_string := substr( l_result, instr(l_result,'
538: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
539: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
540: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
534: LOOP
535: --save the XML into the CLOB field
536: l_result := DBMS_XMLGEN.getXML(qryCtx);
537: l_xml_string := substr( l_result, instr(l_result,'
538: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
539: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
540: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
541:
542: END LOOP;
542: END LOOP;
543:
544: FND_FILE.PUT_LINE(FND_FILE.LOG,l_query6);
545:
546: qryCtx := dbms_xmlgen.newContext (l_query6);
547:
548: --Load 5 records at a time
549: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
550: LOOP
545:
546: qryCtx := dbms_xmlgen.newContext (l_query6);
547:
548: --Load 5 records at a time
549: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
550: LOOP
551: --save the XML into the CLOB field
552: l_result := DBMS_XMLGEN.getXML(qryCtx);
553: l_xml_string := substr( l_result, instr(l_result,'
548: --Load 5 records at a time
549: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
550: LOOP
551: --save the XML into the CLOB field
552: l_result := DBMS_XMLGEN.getXML(qryCtx);
553: l_xml_string := substr( l_result, instr(l_result,'
554: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
555: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
556: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
550: LOOP
551: --save the XML into the CLOB field
552: l_result := DBMS_XMLGEN.getXML(qryCtx);
553: l_xml_string := substr( l_result, instr(l_result,'
554: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
555: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
556: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
557:
558: END LOOP;
558: END LOOP;
559:
560: FND_FILE.PUT_LINE(FND_FILE.LOG,l_query7);
561:
562: qryCtx := dbms_xmlgen.newContext (l_query7);
563:
564: --Load 5 records at a time
565: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
566: LOOP
561:
562: qryCtx := dbms_xmlgen.newContext (l_query7);
563:
564: --Load 5 records at a time
565: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
566: LOOP
567: --save the XML into the CLOB field
568: l_result := DBMS_XMLGEN.getXML(qryCtx);
569: l_xml_string := substr( l_result, instr(l_result,'
564: --Load 5 records at a time
565: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
566: LOOP
567: --save the XML into the CLOB field
568: l_result := DBMS_XMLGEN.getXML(qryCtx);
569: l_xml_string := substr( l_result, instr(l_result,'
570: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
571: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
572: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
566: LOOP
567: --save the XML into the CLOB field
568: l_result := DBMS_XMLGEN.getXML(qryCtx);
569: l_xml_string := substr( l_result, instr(l_result,'
570: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
571: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
572: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
573:
574: END LOOP;
575:
576: IF (NVL(p_tenured,'N') = 'Y') THEN
577: FND_FILE.PUT_LINE(FND_FILE.LOG,l_query8);
578:
579: qryCtx := dbms_xmlgen.newContext (l_query8);
580:
581: --Load 5 records at a time
582: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
583: LOOP
578:
579: qryCtx := dbms_xmlgen.newContext (l_query8);
580:
581: --Load 5 records at a time
582: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
583: LOOP
584: --save the XML into the CLOB field
585: l_result := DBMS_XMLGEN.getXML(qryCtx);
586: l_xml_string := substr( l_result, instr(l_result,'
581: --Load 5 records at a time
582: DBMS_XMLGEN.setMaxRows(qryCtx, 5);
583: LOOP
584: --save the XML into the CLOB field
585: l_result := DBMS_XMLGEN.getXML(qryCtx);
586: l_xml_string := substr( l_result, instr(l_result,'
587: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
588: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
589: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
583: LOOP
584: --save the XML into the CLOB field
585: l_result := DBMS_XMLGEN.getXML(qryCtx);
586: l_xml_string := substr( l_result, instr(l_result,'
587: EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
588: FND_FILE.PUT_LINE(FND_FILE.LOG,l_xml_string);
589: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,l_xml_string);
590: END LOOP;
591: END IF;