212: l_length := l_length - l_amount;
213: l_offset := l_offset + l_amount;
214: END LOOP;
215:
216: DBMS_XMLGEN.closeContext(l_qryCtx);
217:
218: -- Write the event log to fnd log file
219:
220: IF (l_eventLog) THEN
483: -- create new context
484:
485: l_stmt_num := 60;
486:
487: l_qryCtx := DBMS_XMLGEN.newContext (l_ref_cur);
488: DBMS_XMLGEN.setRowSetTag (l_qryCtx,'PARAMETERS');
489: DBMS_XMLGEN.setRowTag (l_qryCtx,NULL);
490:
491: l_stmt_num := 70;
484:
485: l_stmt_num := 60;
486:
487: l_qryCtx := DBMS_XMLGEN.newContext (l_ref_cur);
488: DBMS_XMLGEN.setRowSetTag (l_qryCtx,'PARAMETERS');
489: DBMS_XMLGEN.setRowTag (l_qryCtx,NULL);
490:
491: l_stmt_num := 70;
492:
485: l_stmt_num := 60;
486:
487: l_qryCtx := DBMS_XMLGEN.newContext (l_ref_cur);
488: DBMS_XMLGEN.setRowSetTag (l_qryCtx,'PARAMETERS');
489: DBMS_XMLGEN.setRowTag (l_qryCtx,NULL);
490:
491: l_stmt_num := 70;
492:
493: -- get XML into the temporary clob variable
491: l_stmt_num := 70;
492:
493: -- get XML into the temporary clob variable
494:
495: DBMS_XMLGEN.getXML (l_qryCtx, l_xml_temp, DBMS_XMLGEN.none);
496:
497: -- remove the header (21 characters) and append the rest to xml output
498:
499: IF (DBMS_XMLGEN.getNumRowsProcessed(l_qryCtx) > 0) THEN
495: DBMS_XMLGEN.getXML (l_qryCtx, l_xml_temp, DBMS_XMLGEN.none);
496:
497: -- remove the header (21 characters) and append the rest to xml output
498:
499: IF (DBMS_XMLGEN.getNumRowsProcessed(l_qryCtx) > 0) THEN
500: DBMS_LOB.erase (l_xml_temp, l_offset,1);
501: DBMS_LOB.append (x_xml_doc, l_xml_temp);
502: END IF;
503:
502: END IF;
503:
504: -- close context and free memory
505:
506: DBMS_XMLGEN.closeContext(l_qryCtx);
507: CLOSE l_ref_cur;
508: DBMS_LOB.FREETEMPORARY (l_xml_temp);
509:
510: -- Standard call to get message count and if count is 1, get message info.
933: -- create new context
934:
935: l_stmt_num := 70;
936:
937: l_qryCtx := DBMS_XMLGEN.newContext (l_ref_cur);
938: DBMS_XMLGEN.setRowSetTag (l_qryCtx,'AP_PO_DATA');
939: DBMS_XMLGEN.setRowTag (l_qryCtx,'AP_PO');
940:
941: -- get XML into the temporary clob variable
934:
935: l_stmt_num := 70;
936:
937: l_qryCtx := DBMS_XMLGEN.newContext (l_ref_cur);
938: DBMS_XMLGEN.setRowSetTag (l_qryCtx,'AP_PO_DATA');
939: DBMS_XMLGEN.setRowTag (l_qryCtx,'AP_PO');
940:
941: -- get XML into the temporary clob variable
942:
935: l_stmt_num := 70;
936:
937: l_qryCtx := DBMS_XMLGEN.newContext (l_ref_cur);
938: DBMS_XMLGEN.setRowSetTag (l_qryCtx,'AP_PO_DATA');
939: DBMS_XMLGEN.setRowTag (l_qryCtx,'AP_PO');
940:
941: -- get XML into the temporary clob variable
942:
943: l_stmt_num := 80;
941: -- get XML into the temporary clob variable
942:
943: l_stmt_num := 80;
944:
945: DBMS_XMLGEN.getXML (l_qryCtx, l_xml_temp, DBMS_XMLGEN.none);
946:
947: -- remove the header (21 characters) and append the rest to xml output
948:
949: l_count := DBMS_XMLGEN.getNumRowsProcessed(l_qryCtx);
945: DBMS_XMLGEN.getXML (l_qryCtx, l_xml_temp, DBMS_XMLGEN.none);
946:
947: -- remove the header (21 characters) and append the rest to xml output
948:
949: l_count := DBMS_XMLGEN.getNumRowsProcessed(l_qryCtx);
950:
951: IF (DBMS_XMLGEN.getNumRowsProcessed(l_qryCtx) > 0) THEN
952: DBMS_LOB.erase (l_xml_temp, l_offset,1);
953: DBMS_LOB.append (x_xml_doc, l_xml_temp);
947: -- remove the header (21 characters) and append the rest to xml output
948:
949: l_count := DBMS_XMLGEN.getNumRowsProcessed(l_qryCtx);
950:
951: IF (DBMS_XMLGEN.getNumRowsProcessed(l_qryCtx) > 0) THEN
952: DBMS_LOB.erase (l_xml_temp, l_offset,1);
953: DBMS_LOB.append (x_xml_doc, l_xml_temp);
954: END IF;
955:
954: END IF;
955:
956: -- close context and free memory
957:
958: DBMS_XMLGEN.closeContext(l_qryCtx);
959: CLOSE l_ref_cur;
960: DBMS_LOB.FREETEMPORARY (l_xml_temp);
961:
962: -- to add number of rows processed
972: -- create new context
973:
974: l_stmt_num := 100;
975:
976: l_qryCtx := DBMS_XMLGEN.newContext (l_ref_cur);
977: DBMS_XMLGEN.setRowSetTag (l_qryCtx,'RECORD_NUM');
978: DBMS_XMLGEN.setRowTag (l_qryCtx,NULL);
979:
980: -- get XML to add the number of rows processed
973:
974: l_stmt_num := 100;
975:
976: l_qryCtx := DBMS_XMLGEN.newContext (l_ref_cur);
977: DBMS_XMLGEN.setRowSetTag (l_qryCtx,'RECORD_NUM');
978: DBMS_XMLGEN.setRowTag (l_qryCtx,NULL);
979:
980: -- get XML to add the number of rows processed
981:
974: l_stmt_num := 100;
975:
976: l_qryCtx := DBMS_XMLGEN.newContext (l_ref_cur);
977: DBMS_XMLGEN.setRowSetTag (l_qryCtx,'RECORD_NUM');
978: DBMS_XMLGEN.setRowTag (l_qryCtx,NULL);
979:
980: -- get XML to add the number of rows processed
981:
982: l_stmt_num := 110;
980: -- get XML to add the number of rows processed
981:
982: l_stmt_num := 110;
983:
984: DBMS_XMLGEN.getXML (l_qryCtx, l_xml_temp, DBMS_XMLGEN.none);
985:
986: -- remove the header (21 characters) and append the rest to xml output
987:
988: IF ( DBMS_XMLGEN.getNumRowsProcessed(l_qryCtx) > 0 ) THEN
984: DBMS_XMLGEN.getXML (l_qryCtx, l_xml_temp, DBMS_XMLGEN.none);
985:
986: -- remove the header (21 characters) and append the rest to xml output
987:
988: IF ( DBMS_XMLGEN.getNumRowsProcessed(l_qryCtx) > 0 ) THEN
989: DBMS_LOB.erase (l_xml_temp, l_offset,1);
990: DBMS_LOB.append (x_xml_doc, l_xml_temp);
991: END IF;
992:
991: END IF;
992:
993: -- close context and free memory
994:
995: DBMS_XMLGEN.closeContext(l_qryCtx);
996: CLOSE l_ref_cur;
997: DBMS_LOB.FREETEMPORARY (l_xml_temp);
998:
999: -- Standard call to get message count and if count is 1, get message info.