2066: END IF;
2067: END IF;
2068:
2069: -- Open a temporary lob for merging the contents.
2070: dbms_lob.createTemporary( l_fct_data_lob, true );
2071: dbms_lob.open( l_fct_data_lob, dbms_lob.lob_readwrite );
2072:
2073: -- XML generated with dbms_xmlgen doesnt have encoding information. so we need to manually insert into the resultant CLOB.
2074: dbms_lob.write(l_fct_data_lob,length(''),1,'');
2067: END IF;
2068:
2069: -- Open a temporary lob for merging the contents.
2070: dbms_lob.createTemporary( l_fct_data_lob, true );
2071: dbms_lob.open( l_fct_data_lob, dbms_lob.lob_readwrite );
2072:
2073: -- XML generated with dbms_xmlgen doesnt have encoding information. so we need to manually insert into the resultant CLOB.
2074: dbms_lob.write(l_fct_data_lob,length(''),1,'');
2075: /*
2070: dbms_lob.createTemporary( l_fct_data_lob, true );
2071: dbms_lob.open( l_fct_data_lob, dbms_lob.lob_readwrite );
2072:
2073: -- XML generated with dbms_xmlgen doesnt have encoding information. so we need to manually insert into the resultant CLOB.
2074: dbms_lob.write(l_fct_data_lob,length(''),1,'');
2075: /*
2076: mpothuku Added fnd_global.local_chr(10) (or new line) for the Bug 5724555 on 21-Dec-06. FND_FILE.put has a restriction of 32K characters.
2077: If there is no new-line in these 32K characters, it fails. So ensuring that there are new-line characters after every line
2078: of the XML
2076: mpothuku Added fnd_global.local_chr(10) (or new line) for the Bug 5724555 on 21-Dec-06. FND_FILE.put has a restriction of 32K characters.
2077: If there is no new-line in these 32K characters, it fails. So ensuring that there are new-line characters after every line
2078: of the XML
2079: */
2080: dbms_lob.write(l_fct_data_lob,length(fnd_global.local_chr(10)),length(l_fct_data_lob)+1,fnd_global.local_chr(10));
2081: --Put the root node to maintain the XML completeness.
2082: dbms_lob.write(l_fct_data_lob, length('
2083: dbms_lob.write(l_fct_data_lob,length(fnd_global.local_chr(10)),length(l_fct_data_lob)+1,fnd_global.local_chr(10));
2084: --Put the Start Date and the End Date
2078: of the XML
2079: */
2080: dbms_lob.write(l_fct_data_lob,length(fnd_global.local_chr(10)),length(l_fct_data_lob)+1,fnd_global.local_chr(10));
2081: --Put the root node to maintain the XML completeness.
2082: dbms_lob.write(l_fct_data_lob, length('
2084: --Put the Start Date and the End Date
2085: --mpothuku Added to_char on 23 Aug, 06 for XSL canonical date format to be used by the XMLP report for the Bug 5460793
2086: l_dummy_string := '
2079: */
2080: dbms_lob.write(l_fct_data_lob,length(fnd_global.local_chr(10)),length(l_fct_data_lob)+1,fnd_global.local_chr(10));
2081: --Put the root node to maintain the XML completeness.
2082: dbms_lob.write(l_fct_data_lob, length('
2083: dbms_lob.write(l_fct_data_lob,length(fnd_global.local_chr(10)),length(l_fct_data_lob)+1,fnd_global.local_chr(10));
2084: --Put the Start Date and the End Date
2085: --mpothuku Added to_char on 23 Aug, 06 for XSL canonical date format to be used by the XMLP report for the Bug 5460793
2086: l_dummy_string := '
2087: l_dummy_string := l_dummy_string || '
2084: --Put the Start Date and the End Date
2085: --mpothuku Added to_char on 23 Aug, 06 for XSL canonical date format to be used by the XMLP report for the Bug 5460793
2086: l_dummy_string := '
2087: l_dummy_string := l_dummy_string || '
2088: dbms_lob.write(l_fct_data_lob, length(l_dummy_string),length(l_fct_data_lob)+1, l_dummy_string);
2089:
2090: IF l_forecast_interface_tbl.COUNT > 0 THEN
2091: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
2092: fnd_log.string(fnd_log.level_statement,l_full_name,'Creating Clob for Output File');
2138: l_dummy_string := l_dummy_string || '
2139: END IF;
2140:
2141: l_dummy_string := l_dummy_string || ''||fnd_global.local_chr(10);
2142: dbms_lob.write(l_fct_data_lob, length(l_dummy_string),length(l_fct_data_lob)+1, l_dummy_string);
2143: END IF;
2144: END LOOP;
2145:
2146: ELSE
2152: END IF;
2153: END IF;
2154:
2155: l_dummy_string := '
2156: dbms_lob.write(l_fct_data_lob, length(l_dummy_string),length(l_fct_data_lob)+1, l_dummy_string);
2157:
2158: dbms_lob.write(l_fct_data_lob, length(''),length(l_fct_data_lob)+1, '');
2159:
2160: x_xml_data := l_fct_data_lob;
2154:
2155: l_dummy_string := '
2156: dbms_lob.write(l_fct_data_lob, length(l_dummy_string),length(l_fct_data_lob)+1, l_dummy_string);
2157:
2158: dbms_lob.write(l_fct_data_lob, length(''),length(l_fct_data_lob)+1, '');
2159:
2160: x_xml_data := l_fct_data_lob;
2161:
2162: --Close and release the temporary lobs
2159:
2160: x_xml_data := l_fct_data_lob;
2161:
2162: --Close and release the temporary lobs
2163: dbms_lob.close( l_fct_data_lob );
2164: dbms_lob.freeTemporary( l_fct_data_lob );
2165:
2166: -- Standard check for p_commit
2167: IF FND_API.To_Boolean (p_commit) THEN
2160: x_xml_data := l_fct_data_lob;
2161:
2162: --Close and release the temporary lobs
2163: dbms_lob.close( l_fct_data_lob );
2164: dbms_lob.freeTemporary( l_fct_data_lob );
2165:
2166: -- Standard check for p_commit
2167: IF FND_API.To_Boolean (p_commit) THEN
2168: COMMIT;
2274: x_xml_data => l_clob);
2275:
2276: l_offset := 1;
2277: l_chunk_size := 3000;
2278: l_clob_size := dbms_lob.getlength(l_clob);
2279: fnd_file.put(fnd_file.log, 'l_clob_size - '||l_clob_size);
2280: WHILE (l_clob_size > 0) LOOP
2281: l_chunk := dbms_lob.substr (l_clob, l_chunk_size, l_offset);
2282: fnd_file.put(fnd_file.log, l_chunk);
2277: l_chunk_size := 3000;
2278: l_clob_size := dbms_lob.getlength(l_clob);
2279: fnd_file.put(fnd_file.log, 'l_clob_size - '||l_clob_size);
2280: WHILE (l_clob_size > 0) LOOP
2281: l_chunk := dbms_lob.substr (l_clob, l_chunk_size, l_offset);
2282: fnd_file.put(fnd_file.log, l_chunk);
2283: l_clob_size := l_clob_size - l_chunk_size;
2284: l_offset := l_offset + l_chunk_size;
2285: END LOOP;
2298: retcode := 0; -- success, since nothing is wrong
2299: fnd_file.put(fnd_file.log, ' retcode - '||retcode);
2300: l_offset := 1;
2301: l_chunk_size := 3000;
2302: l_clob_size := dbms_lob.getlength(l_clob);
2303: WHILE (l_clob_size > 0) LOOP
2304: l_chunk := dbms_lob.substr (l_clob, l_chunk_size, l_offset);
2305: fnd_file.put(fnd_file.output, l_chunk);
2306: l_clob_size := l_clob_size - l_chunk_size;
2300: l_offset := 1;
2301: l_chunk_size := 3000;
2302: l_clob_size := dbms_lob.getlength(l_clob);
2303: WHILE (l_clob_size > 0) LOOP
2304: l_chunk := dbms_lob.substr (l_clob, l_chunk_size, l_offset);
2305: fnd_file.put(fnd_file.output, l_chunk);
2306: l_clob_size := l_clob_size - l_chunk_size;
2307: l_offset := l_offset + l_chunk_size;
2308: END LOOP;