120: l_dummy :=0;
121: l_rows_inserted := 0;
122: l_schema := 'ENI';
123:
124: If BIS_COLLECTION_UTILITIES.SETUP(p_object_name => 'ENI_OLTP_ITEM_STAR')=false then
125: RAISE_APPLICATION_ERROR(-20000,errbuf);
126: End if;
127:
128: -- Calculating batchsize
125: RAISE_APPLICATION_ERROR(-20000,errbuf);
126: End if;
127:
128: -- Calculating batchsize
129: -- BIS_COLLECTION_UTILITIES.log('Push Size: '||to_char(FND_PROFILE.value('EDW_PUSH_SIZE')));
130: -- BIS_COLLECTION_UTILITIES.log('Complexity: '||to_char(BIS_COMMON_PARAMETERS.MEDIUM));
131:
132: -- Setting hash_area_size and sort_area_size for this session
133: BIS_COLLECTION_UTILITIES.log('Altering hash area and sort area size ');
126: End if;
127:
128: -- Calculating batchsize
129: -- BIS_COLLECTION_UTILITIES.log('Push Size: '||to_char(FND_PROFILE.value('EDW_PUSH_SIZE')));
130: -- BIS_COLLECTION_UTILITIES.log('Complexity: '||to_char(BIS_COMMON_PARAMETERS.MEDIUM));
131:
132: -- Setting hash_area_size and sort_area_size for this session
133: BIS_COLLECTION_UTILITIES.log('Altering hash area and sort area size ');
134:
129: -- BIS_COLLECTION_UTILITIES.log('Push Size: '||to_char(FND_PROFILE.value('EDW_PUSH_SIZE')));
130: -- BIS_COLLECTION_UTILITIES.log('Complexity: '||to_char(BIS_COMMON_PARAMETERS.MEDIUM));
131:
132: -- Setting hash_area_size and sort_area_size for this session
133: BIS_COLLECTION_UTILITIES.log('Altering hash area and sort area size ');
134:
135: EXECUTE IMMEDIATE 'alter session set hash_area_size = 200000000';
136: EXECUTE IMMEDIATE 'alter session set sort_area_size = 50000000';
137:
134:
135: EXECUTE IMMEDIATE 'alter session set hash_area_size = 200000000';
136: EXECUTE IMMEDIATE 'alter session set sort_area_size = 50000000';
137:
138: BIS_COLLECTION_UTILITIES.log('Fetching default INV category set...');
139: OPEN c;
140: FETCH c into l_inv_category_set;
141: IF c%NOTFOUND THEN l_inv_category_set := null; END IF;
142: CLOSE c;
140: FETCH c into l_inv_category_set;
141: IF c%NOTFOUND THEN l_inv_category_set := null; END IF;
142: CLOSE c;
143:
144: BIS_COLLECTION_UTILITIES.log('Fetching VBH category set...');
145: l_vbh_category_set := ENI_DENORM_HRCHY.get_category_set_id;
146:
147: BIS_COLLECTION_UTILITIES.log('Fetching PO category set...');
148: OPEN get_po_catset;
143:
144: BIS_COLLECTION_UTILITIES.log('Fetching VBH category set...');
145: l_vbh_category_set := ENI_DENORM_HRCHY.get_category_set_id;
146:
147: BIS_COLLECTION_UTILITIES.log('Fetching PO category set...');
148: OPEN get_po_catset;
149: FETCH get_po_catset INTO l_po_category_set;
150: CLOSE get_po_catset;
151:
148: OPEN get_po_catset;
149: FETCH get_po_catset INTO l_po_category_set;
150: CLOSE get_po_catset;
151:
152: BIS_COLLECTION_UTILITIES.log('Default category sets are:' );
153: BIS_COLLECTION_UTILITIES.log(' Product functional area ==> ' || to_char(l_vbh_category_set));
154: BIS_COLLECTION_UTILITIES.log(' Inventory functional area ==> ' || to_char(l_inv_category_set));
155: BIS_COLLECTION_UTILITIES.log(' Purchasing functional area ==> ' || to_char(l_po_category_set));
156:
149: FETCH get_po_catset INTO l_po_category_set;
150: CLOSE get_po_catset;
151:
152: BIS_COLLECTION_UTILITIES.log('Default category sets are:' );
153: BIS_COLLECTION_UTILITIES.log(' Product functional area ==> ' || to_char(l_vbh_category_set));
154: BIS_COLLECTION_UTILITIES.log(' Inventory functional area ==> ' || to_char(l_inv_category_set));
155: BIS_COLLECTION_UTILITIES.log(' Purchasing functional area ==> ' || to_char(l_po_category_set));
156:
157: EXECUTE IMMEDIATE 'TRUNCATE TABLE ' || l_schema || '.ENI_ITEM_STAR_VALID_ERR';
150: CLOSE get_po_catset;
151:
152: BIS_COLLECTION_UTILITIES.log('Default category sets are:' );
153: BIS_COLLECTION_UTILITIES.log(' Product functional area ==> ' || to_char(l_vbh_category_set));
154: BIS_COLLECTION_UTILITIES.log(' Inventory functional area ==> ' || to_char(l_inv_category_set));
155: BIS_COLLECTION_UTILITIES.log(' Purchasing functional area ==> ' || to_char(l_po_category_set));
156:
157: EXECUTE IMMEDIATE 'TRUNCATE TABLE ' || l_schema || '.ENI_ITEM_STAR_VALID_ERR';
158:
151:
152: BIS_COLLECTION_UTILITIES.log('Default category sets are:' );
153: BIS_COLLECTION_UTILITIES.log(' Product functional area ==> ' || to_char(l_vbh_category_set));
154: BIS_COLLECTION_UTILITIES.log(' Inventory functional area ==> ' || to_char(l_inv_category_set));
155: BIS_COLLECTION_UTILITIES.log(' Purchasing functional area ==> ' || to_char(l_po_category_set));
156:
157: EXECUTE IMMEDIATE 'TRUNCATE TABLE ' || l_schema || '.ENI_ITEM_STAR_VALID_ERR';
158:
159: BIS_COLLECTION_UTILITIES.log('');
155: BIS_COLLECTION_UTILITIES.log(' Purchasing functional area ==> ' || to_char(l_po_category_set));
156:
157: EXECUTE IMMEDIATE 'TRUNCATE TABLE ' || l_schema || '.ENI_ITEM_STAR_VALID_ERR';
158:
159: BIS_COLLECTION_UTILITIES.log('');
160: BIS_COLLECTION_UTILITIES.log('Validation Checks');
161: BIS_COLLECTION_UTILITIES.log('----------------------');
162: BIS_COLLECTION_UTILITIES.log('');
163: BIS_COLLECTION_UTILITIES.log('');
156:
157: EXECUTE IMMEDIATE 'TRUNCATE TABLE ' || l_schema || '.ENI_ITEM_STAR_VALID_ERR';
158:
159: BIS_COLLECTION_UTILITIES.log('');
160: BIS_COLLECTION_UTILITIES.log('Validation Checks');
161: BIS_COLLECTION_UTILITIES.log('----------------------');
162: BIS_COLLECTION_UTILITIES.log('');
163: BIS_COLLECTION_UTILITIES.log('');
164:
157: EXECUTE IMMEDIATE 'TRUNCATE TABLE ' || l_schema || '.ENI_ITEM_STAR_VALID_ERR';
158:
159: BIS_COLLECTION_UTILITIES.log('');
160: BIS_COLLECTION_UTILITIES.log('Validation Checks');
161: BIS_COLLECTION_UTILITIES.log('----------------------');
162: BIS_COLLECTION_UTILITIES.log('');
163: BIS_COLLECTION_UTILITIES.log('');
164:
165:
158:
159: BIS_COLLECTION_UTILITIES.log('');
160: BIS_COLLECTION_UTILITIES.log('Validation Checks');
161: BIS_COLLECTION_UTILITIES.log('----------------------');
162: BIS_COLLECTION_UTILITIES.log('');
163: BIS_COLLECTION_UTILITIES.log('');
164:
165:
166: l_temp := 'N';
159: BIS_COLLECTION_UTILITIES.log('');
160: BIS_COLLECTION_UTILITIES.log('Validation Checks');
161: BIS_COLLECTION_UTILITIES.log('----------------------');
162: BIS_COLLECTION_UTILITIES.log('');
163: BIS_COLLECTION_UTILITIES.log('');
164:
165:
166: l_temp := 'N';
167:
164:
165:
166: l_temp := 'N';
167:
168: BIS_COLLECTION_UTILITIES.log('----------------------------------------------');
169: BIS_COLLECTION_UTILITIES.log('Checking for multiple item-category assignment');
170: BIS_COLLECTION_UTILITIES.log('----------------------------------------------');
171:
172: FOR c2 in c_mult_item_assgn(l_inv_category_set, l_vbh_category_set, l_po_category_set)
165:
166: l_temp := 'N';
167:
168: BIS_COLLECTION_UTILITIES.log('----------------------------------------------');
169: BIS_COLLECTION_UTILITIES.log('Checking for multiple item-category assignment');
170: BIS_COLLECTION_UTILITIES.log('----------------------------------------------');
171:
172: FOR c2 in c_mult_item_assgn(l_inv_category_set, l_vbh_category_set, l_po_category_set)
173: LOOP
166: l_temp := 'N';
167:
168: BIS_COLLECTION_UTILITIES.log('----------------------------------------------');
169: BIS_COLLECTION_UTILITIES.log('Checking for multiple item-category assignment');
170: BIS_COLLECTION_UTILITIES.log('----------------------------------------------');
171:
172: FOR c2 in c_mult_item_assgn(l_inv_category_set, l_vbh_category_set, l_po_category_set)
173: LOOP
174: l_temp := 'Y';
172: FOR c2 in c_mult_item_assgn(l_inv_category_set, l_vbh_category_set, l_po_category_set)
173: LOOP
174: l_temp := 'Y';
175:
176: BIS_COLLECTION_UTILITIES.log(c2.concatenated_segments);
177: retcode := 1;
178:
179: INSERT INTO ENI_ITEM_STAR_VALID_ERR(
180: inventory_item_id,
192: );
193: END LOOP;
194:
195: if l_temp = 'N' then
196: BIS_COLLECTION_UTILITIES.log(' -- No issues found -- ');
197: else
198: BIS_COLLECTION_UTILITIES.log('Suggestion: Items can only be assigned to one category');
199: BIS_COLLECTION_UTILITIES.log('in the default catalog of Inventory, PO and/ or Product reporting');
200: BIS_COLLECTION_UTILITIES.log('functional area. Please ensure that this criteria is met');
194:
195: if l_temp = 'N' then
196: BIS_COLLECTION_UTILITIES.log(' -- No issues found -- ');
197: else
198: BIS_COLLECTION_UTILITIES.log('Suggestion: Items can only be assigned to one category');
199: BIS_COLLECTION_UTILITIES.log('in the default catalog of Inventory, PO and/ or Product reporting');
200: BIS_COLLECTION_UTILITIES.log('functional area. Please ensure that this criteria is met');
201: BIS_COLLECTION_UTILITIES.log('for the items failing this test.');
202: end if;
195: if l_temp = 'N' then
196: BIS_COLLECTION_UTILITIES.log(' -- No issues found -- ');
197: else
198: BIS_COLLECTION_UTILITIES.log('Suggestion: Items can only be assigned to one category');
199: BIS_COLLECTION_UTILITIES.log('in the default catalog of Inventory, PO and/ or Product reporting');
200: BIS_COLLECTION_UTILITIES.log('functional area. Please ensure that this criteria is met');
201: BIS_COLLECTION_UTILITIES.log('for the items failing this test.');
202: end if;
203:
196: BIS_COLLECTION_UTILITIES.log(' -- No issues found -- ');
197: else
198: BIS_COLLECTION_UTILITIES.log('Suggestion: Items can only be assigned to one category');
199: BIS_COLLECTION_UTILITIES.log('in the default catalog of Inventory, PO and/ or Product reporting');
200: BIS_COLLECTION_UTILITIES.log('functional area. Please ensure that this criteria is met');
201: BIS_COLLECTION_UTILITIES.log('for the items failing this test.');
202: end if;
203:
204:
197: else
198: BIS_COLLECTION_UTILITIES.log('Suggestion: Items can only be assigned to one category');
199: BIS_COLLECTION_UTILITIES.log('in the default catalog of Inventory, PO and/ or Product reporting');
200: BIS_COLLECTION_UTILITIES.log('functional area. Please ensure that this criteria is met');
201: BIS_COLLECTION_UTILITIES.log('for the items failing this test.');
202: end if;
203:
204:
205: l_temp := 'N';
203:
204:
205: l_temp := 'N';
206:
207: BIS_COLLECTION_UTILITIES.log('');
208: BIS_COLLECTION_UTILITIES.log('--------------------------------------------');
209: BIS_COLLECTION_UTILITIES.log('Checking if item flexfield has been compiled');
210: BIS_COLLECTION_UTILITIES.log('--------------------------------------------');
211:
204:
205: l_temp := 'N';
206:
207: BIS_COLLECTION_UTILITIES.log('');
208: BIS_COLLECTION_UTILITIES.log('--------------------------------------------');
209: BIS_COLLECTION_UTILITIES.log('Checking if item flexfield has been compiled');
210: BIS_COLLECTION_UTILITIES.log('--------------------------------------------');
211:
212: FOR c3 in c_non_flex_item LOOP
205: l_temp := 'N';
206:
207: BIS_COLLECTION_UTILITIES.log('');
208: BIS_COLLECTION_UTILITIES.log('--------------------------------------------');
209: BIS_COLLECTION_UTILITIES.log('Checking if item flexfield has been compiled');
210: BIS_COLLECTION_UTILITIES.log('--------------------------------------------');
211:
212: FOR c3 in c_non_flex_item LOOP
213: l_temp := 'Y';
206:
207: BIS_COLLECTION_UTILITIES.log('');
208: BIS_COLLECTION_UTILITIES.log('--------------------------------------------');
209: BIS_COLLECTION_UTILITIES.log('Checking if item flexfield has been compiled');
210: BIS_COLLECTION_UTILITIES.log('--------------------------------------------');
211:
212: FOR c3 in c_non_flex_item LOOP
213: l_temp := 'Y';
214: BIS_COLLECTION_UTILITIES.log('Item Flexfield has not been compiled. ');
210: BIS_COLLECTION_UTILITIES.log('--------------------------------------------');
211:
212: FOR c3 in c_non_flex_item LOOP
213: l_temp := 'Y';
214: BIS_COLLECTION_UTILITIES.log('Item Flexfield has not been compiled. ');
215: END LOOP;
216:
217: if l_temp = 'N' then
218: BIS_COLLECTION_UTILITIES.log(' -- No issues found -- ');
214: BIS_COLLECTION_UTILITIES.log('Item Flexfield has not been compiled. ');
215: END LOOP;
216:
217: if l_temp = 'N' then
218: BIS_COLLECTION_UTILITIES.log(' -- No issues found -- ');
219: else
220: BIS_COLLECTION_UTILITIES.log('Please compile item flexfield and then run the item dimension load');
221: RAISE_APPLICATION_ERROR(-20001, 'ERROR: Item flexfield has not been compiled');
222: end if;
216:
217: if l_temp = 'N' then
218: BIS_COLLECTION_UTILITIES.log(' -- No issues found -- ');
219: else
220: BIS_COLLECTION_UTILITIES.log('Please compile item flexfield and then run the item dimension load');
221: RAISE_APPLICATION_ERROR(-20001, 'ERROR: Item flexfield has not been compiled');
222: end if;
223:
224:
222: end if;
223:
224:
225: l_temp := 'N';
226: BIS_COLLECTION_UTILITIES.log('');
227: BIS_COLLECTION_UTILITIES.log('----------------------------------------------');
228: BIS_COLLECTION_UTILITIES.log('Checking for multiple items with the same name');
229: BIS_COLLECTION_UTILITIES.log('----------------------------------------------');
230:
223:
224:
225: l_temp := 'N';
226: BIS_COLLECTION_UTILITIES.log('');
227: BIS_COLLECTION_UTILITIES.log('----------------------------------------------');
228: BIS_COLLECTION_UTILITIES.log('Checking for multiple items with the same name');
229: BIS_COLLECTION_UTILITIES.log('----------------------------------------------');
230:
231: FOR c4 in c_mult_item LOOP
224:
225: l_temp := 'N';
226: BIS_COLLECTION_UTILITIES.log('');
227: BIS_COLLECTION_UTILITIES.log('----------------------------------------------');
228: BIS_COLLECTION_UTILITIES.log('Checking for multiple items with the same name');
229: BIS_COLLECTION_UTILITIES.log('----------------------------------------------');
230:
231: FOR c4 in c_mult_item LOOP
232: l_temp := 'Y';
225: l_temp := 'N';
226: BIS_COLLECTION_UTILITIES.log('');
227: BIS_COLLECTION_UTILITIES.log('----------------------------------------------');
228: BIS_COLLECTION_UTILITIES.log('Checking for multiple items with the same name');
229: BIS_COLLECTION_UTILITIES.log('----------------------------------------------');
230:
231: FOR c4 in c_mult_item LOOP
232: l_temp := 'Y';
233:
230:
231: FOR c4 in c_mult_item LOOP
232: l_temp := 'Y';
233:
234: BIS_COLLECTION_UTILITIES.log(c4.concatenated_segments);
235: retcode := 1;
236:
237: FOR c5 in c_item_id(c4.concatenated_segments) LOOP
238:
250: END LOOP;
251: END LOOP;
252:
253: if l_temp = 'N' then
254: BIS_COLLECTION_UTILITIES.log(' -- No issues found -- ');
255: else
256: BIS_COLLECTION_UTILITIES.log('Suggestion: Item names need to be unique. Ensure the ');
257: BIS_COLLECTION_UTILITIES.log('item names that failed the test are unique in the system. ');
258: end if;
252:
253: if l_temp = 'N' then
254: BIS_COLLECTION_UTILITIES.log(' -- No issues found -- ');
255: else
256: BIS_COLLECTION_UTILITIES.log('Suggestion: Item names need to be unique. Ensure the ');
257: BIS_COLLECTION_UTILITIES.log('item names that failed the test are unique in the system. ');
258: end if;
259:
260:
253: if l_temp = 'N' then
254: BIS_COLLECTION_UTILITIES.log(' -- No issues found -- ');
255: else
256: BIS_COLLECTION_UTILITIES.log('Suggestion: Item names need to be unique. Ensure the ');
257: BIS_COLLECTION_UTILITIES.log('item names that failed the test are unique in the system. ');
258: end if;
259:
260:
261: -- Deciding if the load has to be fully refreshed or partially refreshed
294: END;
295:
296: IF l_full_refresh = 'Y' THEN
297:
298: BIS_COLLECTION_UTILITIES.log('');
299: BIS_COLLECTION_UTILITIES.log('Running in full mode');
300: BIS_COLLECTION_UTILITIES.log('--------------------');
301: BIS_COLLECTION_UTILITIES.log('');
302: BIS_COLLECTION_UTILITIES.log('Clearing STAR table');
295:
296: IF l_full_refresh = 'Y' THEN
297:
298: BIS_COLLECTION_UTILITIES.log('');
299: BIS_COLLECTION_UTILITIES.log('Running in full mode');
300: BIS_COLLECTION_UTILITIES.log('--------------------');
301: BIS_COLLECTION_UTILITIES.log('');
302: BIS_COLLECTION_UTILITIES.log('Clearing STAR table');
303: BIS_COLLECTION_UTILITIES.log('--------------------');
296: IF l_full_refresh = 'Y' THEN
297:
298: BIS_COLLECTION_UTILITIES.log('');
299: BIS_COLLECTION_UTILITIES.log('Running in full mode');
300: BIS_COLLECTION_UTILITIES.log('--------------------');
301: BIS_COLLECTION_UTILITIES.log('');
302: BIS_COLLECTION_UTILITIES.log('Clearing STAR table');
303: BIS_COLLECTION_UTILITIES.log('--------------------');
304:
297:
298: BIS_COLLECTION_UTILITIES.log('');
299: BIS_COLLECTION_UTILITIES.log('Running in full mode');
300: BIS_COLLECTION_UTILITIES.log('--------------------');
301: BIS_COLLECTION_UTILITIES.log('');
302: BIS_COLLECTION_UTILITIES.log('Clearing STAR table');
303: BIS_COLLECTION_UTILITIES.log('--------------------');
304:
305: EXECUTE IMMEDIATE 'truncate table ' || l_schema || '.eni_oltp_item_star purge materialized view log';
298: BIS_COLLECTION_UTILITIES.log('');
299: BIS_COLLECTION_UTILITIES.log('Running in full mode');
300: BIS_COLLECTION_UTILITIES.log('--------------------');
301: BIS_COLLECTION_UTILITIES.log('');
302: BIS_COLLECTION_UTILITIES.log('Clearing STAR table');
303: BIS_COLLECTION_UTILITIES.log('--------------------');
304:
305: EXECUTE IMMEDIATE 'truncate table ' || l_schema || '.eni_oltp_item_star purge materialized view log';
306:
299: BIS_COLLECTION_UTILITIES.log('Running in full mode');
300: BIS_COLLECTION_UTILITIES.log('--------------------');
301: BIS_COLLECTION_UTILITIES.log('');
302: BIS_COLLECTION_UTILITIES.log('Clearing STAR table');
303: BIS_COLLECTION_UTILITIES.log('--------------------');
304:
305: EXECUTE IMMEDIATE 'truncate table ' || l_schema || '.eni_oltp_item_star purge materialized view log';
306:
307: BIS_COLLECTION_UTILITIES.log('Inserting UNASSIGNED row into STAR table');
303: BIS_COLLECTION_UTILITIES.log('--------------------');
304:
305: EXECUTE IMMEDIATE 'truncate table ' || l_schema || '.eni_oltp_item_star purge materialized view log';
306:
307: BIS_COLLECTION_UTILITIES.log('Inserting UNASSIGNED row into STAR table');
308:
309: INSERT INTO ENI_OLTP_ITEM_STAR (
310: id
311: , value
357: NULL,
358: NULL
359: );
360:
361: BIS_COLLECTION_UTILITIES.log('Inserted UNASSIGNED item row');
362:
363: COMMIT;
364:
365: BEGIN
364:
365: BEGIN
366: -- Main insert of items
367:
368: BIS_COLLECTION_UTILITIES.log('Inserting all ITEM MASTER items into STAR table');
369:
370: INSERT /*+ append parallel */ INTO ENI_OLTP_ITEM_STAR (
371: id
372: , value
446: AND organization_id = mti.organization_id);
447:
448: l_rows_inserted := sql%rowcount;
449:
450: BIS_COLLECTION_UTILITIES.log('Rows inserted into table:'||l_rows_inserted);
451:
452: COMMIT; --Added for Bug 4525918
453:
454: EXCEPTION
454: EXCEPTION
455: WHEN NO_DATA_FOUND THEN
456: null;
457: WHEN OTHERS THEN
458: BIS_COLLECTION_UTILITIES.log(sqlerrm);
459: -- Delete UNASSIGNED row as the main insert of items was not successful.
460: DELETE FROM ENI_OLTP_ITEM_STAR WHERE inventory_item_id = -1 AND organization_id = -99;
461: BIS_COLLECTION_UTILITIES.log('Removed UNASSIGNED row as main insert of items was not successful');
462: COMMIT;
457: WHEN OTHERS THEN
458: BIS_COLLECTION_UTILITIES.log(sqlerrm);
459: -- Delete UNASSIGNED row as the main insert of items was not successful.
460: DELETE FROM ENI_OLTP_ITEM_STAR WHERE inventory_item_id = -1 AND organization_id = -99;
461: BIS_COLLECTION_UTILITIES.log('Removed UNASSIGNED row as main insert of items was not successful');
462: COMMIT;
463: END;
464:
465:
468: -- Update those records from the temporary table to the STAR table
469:
470: begin
471:
472: BIS_COLLECTION_UTILITIES.log(' Checking Temp table for any records ');
473: select 1 into l_exist_flag from eni_item_star_temp
474: where rownum = 1;
475:
476: if l_exist_flag = 1 then
473: select 1 into l_exist_flag from eni_item_star_temp
474: where rownum = 1;
475:
476: if l_exist_flag = 1 then
477: BIS_COLLECTION_UTILITIES.log('Updating STAR table with records from temp table');
478:
479: UPDATE eni_oltp_item_star a
480: SET ( value
481: , last_update_date
521: WHERE EXISTS( SELECT 'X' from eni_item_star_temp
522: WHERE a.inventory_item_id = inventory_item_id
523: AND a.organization_id = organization_id );
524:
525: BIS_COLLECTION_UTILITIES.log('Rows updated from temp table:'||sql%rowcount);
526:
527: BIS_COLLECTION_UTILITIES.log('Deleting from the temp table');
528: DELETE FROM eni_item_star_temp;
529:
523: AND a.organization_id = organization_id );
524:
525: BIS_COLLECTION_UTILITIES.log('Rows updated from temp table:'||sql%rowcount);
526:
527: BIS_COLLECTION_UTILITIES.log('Deleting from the temp table');
528: DELETE FROM eni_item_star_temp;
529:
530: END IF;
531:
532: EXCEPTION
533: WHEN NO_DATA_FOUND THEN
534: null;
535: WHEN OTHERS THEN
536: BIS_COLLECTION_UTILITIES.log(sqlerrm);
537: END;
538:
539: END IF; -- l_full_refresh = 'Y'
540:
538:
539: END IF; -- l_full_refresh = 'Y'
540:
541: IF l_full_refresh = 'N' THEN
542: BIS_COLLECTION_UTILITIES.log('');
543: BIS_COLLECTION_UTILITIES.log('Running in partial mode');
544: BIS_COLLECTION_UTILITIES.log('-----------------------');
545: BIS_COLLECTION_UTILITIES.log('');
546:
539: END IF; -- l_full_refresh = 'Y'
540:
541: IF l_full_refresh = 'N' THEN
542: BIS_COLLECTION_UTILITIES.log('');
543: BIS_COLLECTION_UTILITIES.log('Running in partial mode');
544: BIS_COLLECTION_UTILITIES.log('-----------------------');
545: BIS_COLLECTION_UTILITIES.log('');
546:
547: INSERT INTO eni_oltp_item_star (
540:
541: IF l_full_refresh = 'N' THEN
542: BIS_COLLECTION_UTILITIES.log('');
543: BIS_COLLECTION_UTILITIES.log('Running in partial mode');
544: BIS_COLLECTION_UTILITIES.log('-----------------------');
545: BIS_COLLECTION_UTILITIES.log('');
546:
547: INSERT INTO eni_oltp_item_star (
548: id
541: IF l_full_refresh = 'N' THEN
542: BIS_COLLECTION_UTILITIES.log('');
543: BIS_COLLECTION_UTILITIES.log('Running in partial mode');
544: BIS_COLLECTION_UTILITIES.log('-----------------------');
545: BIS_COLLECTION_UTILITIES.log('');
546:
547: INSERT INTO eni_oltp_item_star (
548: id
549: , value
627: );
628:
629: l_rows_inserted := SQL%ROWCOUNT;
630:
631: BIS_COLLECTION_UTILITIES.log('Records inserted into STAR table: '|| l_rows_inserted);
632:
633: END IF; -- if l_full_refresh = 'N'
634:
635: BIS_COLLECTION_UTILITIES.log('Collection completed successfully.');
631: BIS_COLLECTION_UTILITIES.log('Records inserted into STAR table: '|| l_rows_inserted);
632:
633: END IF; -- if l_full_refresh = 'N'
634:
635: BIS_COLLECTION_UTILITIES.log('Collection completed successfully.');
636:
637: BIS_COLLECTION_UTILITIES.log('Gathering statistics on table: ENI_OLTP_ITEM_STAR ');
638: FND_STATS.gather_table_stats (ownname=>'ENI', tabname=>'ENI_OLTP_ITEM_STAR');
639:
633: END IF; -- if l_full_refresh = 'N'
634:
635: BIS_COLLECTION_UTILITIES.log('Collection completed successfully.');
636:
637: BIS_COLLECTION_UTILITIES.log('Gathering statistics on table: ENI_OLTP_ITEM_STAR ');
638: FND_STATS.gather_table_stats (ownname=>'ENI', tabname=>'ENI_OLTP_ITEM_STAR');
639:
640: Exception
641: When no_data_found then
638: FND_STATS.gather_table_stats (ownname=>'ENI', tabname=>'ENI_OLTP_ITEM_STAR');
639:
640: Exception
641: When no_data_found then
642: BIS_COLLECTION_UTILITIES.log(sqlerrm);
643: errbuf := 'Error: No Data Found';
644: retcode := 2;
645: When unique_cons_violation then
646: BIS_COLLECTION_UTILITIES.log('Error: ' || sqlerrm );
642: BIS_COLLECTION_UTILITIES.log(sqlerrm);
643: errbuf := 'Error: No Data Found';
644: retcode := 2;
645: When unique_cons_violation then
646: BIS_COLLECTION_UTILITIES.log('Error: ' || sqlerrm );
647: BIS_COLLECTION_UTILITIES.log('Could be for one of two possible reasons: ');
648: BIS_COLLECTION_UTILITIES.log('1. Items cannot be assigned to multiple categories of a default category set');
649: BIS_COLLECTION_UTILITIES.log('2. The item flexfields have not been compiled');
650: errbuf := 'Error: ' || sqlerrm;
643: errbuf := 'Error: No Data Found';
644: retcode := 2;
645: When unique_cons_violation then
646: BIS_COLLECTION_UTILITIES.log('Error: ' || sqlerrm );
647: BIS_COLLECTION_UTILITIES.log('Could be for one of two possible reasons: ');
648: BIS_COLLECTION_UTILITIES.log('1. Items cannot be assigned to multiple categories of a default category set');
649: BIS_COLLECTION_UTILITIES.log('2. The item flexfields have not been compiled');
650: errbuf := 'Error: ' || sqlerrm;
651: --dbms_output.put_line('Items cannot be assigned to mul...');
644: retcode := 2;
645: When unique_cons_violation then
646: BIS_COLLECTION_UTILITIES.log('Error: ' || sqlerrm );
647: BIS_COLLECTION_UTILITIES.log('Could be for one of two possible reasons: ');
648: BIS_COLLECTION_UTILITIES.log('1. Items cannot be assigned to multiple categories of a default category set');
649: BIS_COLLECTION_UTILITIES.log('2. The item flexfields have not been compiled');
650: errbuf := 'Error: ' || sqlerrm;
651: --dbms_output.put_line('Items cannot be assigned to mul...');
652: retcode := 2;
645: When unique_cons_violation then
646: BIS_COLLECTION_UTILITIES.log('Error: ' || sqlerrm );
647: BIS_COLLECTION_UTILITIES.log('Could be for one of two possible reasons: ');
648: BIS_COLLECTION_UTILITIES.log('1. Items cannot be assigned to multiple categories of a default category set');
649: BIS_COLLECTION_UTILITIES.log('2. The item flexfields have not been compiled');
650: errbuf := 'Error: ' || sqlerrm;
651: --dbms_output.put_line('Items cannot be assigned to mul...');
652: retcode := 2;
653: When others then
650: errbuf := 'Error: ' || sqlerrm;
651: --dbms_output.put_line('Items cannot be assigned to mul...');
652: retcode := 2;
653: When others then
654: BIS_COLLECTION_UTILITIES.log(sqlerrm);
655: --dbms_output.put_line('Error '|| sqlerrm);
656: errbuf := 'Error: ' || sqlerrm;
657: retcode := 2;
658: END Create_Star_Table;