257: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
258: END IF;
259:
260: l_stmt_num := 90;
261: DBMS_LOB.createtemporary(l_xml_header, TRUE);
262: DBMS_LOB.createtemporary(l_xml_body, TRUE);
263: DBMS_LOB.createtemporary(l_xml_report, TRUE);
264:
265: -- Count the no. of rows in the accrual temp table
258: END IF;
259:
260: l_stmt_num := 90;
261: DBMS_LOB.createtemporary(l_xml_header, TRUE);
262: DBMS_LOB.createtemporary(l_xml_body, TRUE);
263: DBMS_LOB.createtemporary(l_xml_report, TRUE);
264:
265: -- Count the no. of rows in the accrual temp table
266: -- l_row_count will be part of report header information
259:
260: l_stmt_num := 90;
261: DBMS_LOB.createtemporary(l_xml_header, TRUE);
262: DBMS_LOB.createtemporary(l_xml_body, TRUE);
263: DBMS_LOB.createtemporary(l_xml_report, TRUE);
264:
265: -- Count the no. of rows in the accrual temp table
266: -- l_row_count will be part of report header information
267: l_stmt_num := 100;
830: x_return_status := FND_API.G_RET_STS_SUCCESS;
831: l_return_status := FND_API.G_RET_STS_SUCCESS;
832:
833: l_stmt_num := 10;
834: l_length_src1 := DBMS_LOB.GETLENGTH(p_xml_src1);
835: l_length_src2 := DBMS_LOB.GETLENGTH(p_xml_src2);
836:
837: l_stmt_num := 20;
838: DBMS_LOB.createtemporary(x_xml_doc, TRUE);
831: l_return_status := FND_API.G_RET_STS_SUCCESS;
832:
833: l_stmt_num := 10;
834: l_length_src1 := DBMS_LOB.GETLENGTH(p_xml_src1);
835: l_length_src2 := DBMS_LOB.GETLENGTH(p_xml_src2);
836:
837: l_stmt_num := 20;
838: DBMS_LOB.createtemporary(x_xml_doc, TRUE);
839:
834: l_length_src1 := DBMS_LOB.GETLENGTH(p_xml_src1);
835: l_length_src2 := DBMS_LOB.GETLENGTH(p_xml_src2);
836:
837: l_stmt_num := 20;
838: DBMS_LOB.createtemporary(x_xml_doc, TRUE);
839:
840: IF (l_length_src1 > 0) THEN
841:
842: -- Get the first occurence of XML header
840: IF (l_length_src1 > 0) THEN
841:
842: -- Get the first occurence of XML header
843: l_stmt_num := 30;
844: l_offset := DBMS_LOB.instr (lob_loc => p_xml_src1,
845: pattern => '>',
846: offset => 1,
847: nth => 1);
848:
850: l_stmt_num := 40;
851:
852: /*Bug 7282242*/
853: /*Remove the header (21 characters)*/
854: --DBMS_LOB.copy (x_xml_doc, p_xml_src1, l_offset + 1);
855:
856: /*The following 3 lines of code ensures that XML data generated here uses the right encoding*/
857: l_encoding := fnd_profile.value('ICX_CLIENT_IANA_ENCODING');
858: l_xml_header := '';
855:
856: /*The following 3 lines of code ensures that XML data generated here uses the right encoding*/
857: l_encoding := fnd_profile.value('ICX_CLIENT_IANA_ENCODING');
858: l_xml_header := '';
859: DBMS_LOB.writeappend (x_xml_doc, length(l_xml_header), l_xml_header);
860:
861: -- Append the root tag to the XML doc
862: l_stmt_num := 50;
863: DBMS_LOB.writeappend (x_xml_doc, LENGTH(p_root_tag) + 2, '<' || p_root_tag || '>');
859: DBMS_LOB.writeappend (x_xml_doc, length(l_xml_header), l_xml_header);
860:
861: -- Append the root tag to the XML doc
862: l_stmt_num := 50;
863: DBMS_LOB.writeappend (x_xml_doc, LENGTH(p_root_tag) + 2, '<' || p_root_tag || '>');
864:
865: -- Append the 1st XML doc to the destination XML doc
866: l_stmt_num := 60;
867: DBMS_LOB.copy ( x_xml_doc,
863: DBMS_LOB.writeappend (x_xml_doc, LENGTH(p_root_tag) + 2, '<' || p_root_tag || '>');
864:
865: -- Append the 1st XML doc to the destination XML doc
866: l_stmt_num := 60;
867: DBMS_LOB.copy ( x_xml_doc,
868: p_xml_src1,
869: l_length_src1 - l_offset,
870: DBMS_LOB.GETLENGTH(x_xml_doc) + 1,
871: l_offset + 1
866: l_stmt_num := 60;
867: DBMS_LOB.copy ( x_xml_doc,
868: p_xml_src1,
869: l_length_src1 - l_offset,
870: DBMS_LOB.GETLENGTH(x_xml_doc) + 1,
871: l_offset + 1
872: );
873:
874: -- Append the 2nd XML doc to the destination XML doc
873:
874: -- Append the 2nd XML doc to the destination XML doc
875: IF (l_length_src2 > 0) THEN
876: l_stmt_num := 70;
877: DBMS_LOB.copy ( x_xml_doc,
878: p_xml_src2,
879: l_length_src2 - l_offset,
880: DBMS_LOB.GETLENGTH(x_xml_doc) + 1,
881: l_offset + 1
876: l_stmt_num := 70;
877: DBMS_LOB.copy ( x_xml_doc,
878: p_xml_src2,
879: l_length_src2 - l_offset,
880: DBMS_LOB.GETLENGTH(x_xml_doc) + 1,
881: l_offset + 1
882: );
883: END IF;
884:
883: END IF;
884:
885: -- Append the root tag to the end of XML doc
886: l_stmt_num := 80;
887: DBMS_LOB.writeappend (x_xml_doc, LENGTH(p_root_tag) + 3, '');
888:
889: END IF;
890:
891: -- Procedure level log message for exit point
1006: l_return_status := FND_API.G_RET_STS_SUCCESS;
1007:
1008: -- Get length of the CLOB p_xml_data
1009: l_stmt_num := 10;
1010: l_length := nvl(DBMS_LOB.getlength(p_xml_data), 0);
1011:
1012: -- Set the offset point to be the start of the CLOB data
1013: l_offset := 1;
1014:
1021:
1022: EXIT WHEN l_length <= 0;
1023:
1024: -- Read 32 KB of data and print it to the report output
1025: DBMS_LOB.read (p_xml_data, l_amount, l_offset, l_data);
1026:
1027: FND_FILE.PUT(FND_FILE.OUTPUT, l_data);
1028:
1029: l_length := l_length - l_amount;