DBA Data[Home] [Help]

APPS.EGO_PUB_HIST_PURGE_PKG dependencies on FND_FILE

Line 94: fnd_file.put_line(fnd_file.Log,

90: l_delete_batch_system1 := 'Delete FROM EGO_PUB_BAT_SYSTEMS_B WHERE batch_id = :1 and SYSTEM_CODE = :2 ';
91: l_delete_batch_status2 := 'Delete FROM EGO_PUB_BAT_STATUS_B WHERE batch_id = :1 and SYSTEM_CODE = :2 and STATUS_CODE = :3 ';
92: l_delete_batch_status3 := 'Delete FROM EGO_PUB_BAT_STATUS_B WHERE batch_id = :1 and SYSTEM_CODE = :2 ';
93:
94: fnd_file.put_line(fnd_file.Log,
95: ' Processing data to delete record based on input ');
96:
97: /*Case when no Input has been passed, No action will be taken by this API*/
98: IF (p_batch_id IS NULL AND p_target_system_code IS NULL AND

Line 102: fnd_file.put_line(fnd_file.Log,

98: IF (p_batch_id IS NULL AND p_target_system_code IS NULL AND
99: p_from_date IS NULL AND p_to_date IS NULL AND p_status_code IS NULL AND
100: p_published_by IS NULL AND p_entity_type IS NULL) THEN
101: -- If all parameters contains null value then send useful message to the log file.
102: fnd_file.put_line(fnd_file.Log,
103: 'No record has been deleted because all the input parameters contains null value. User have to enter value for atleast one of the input paramters to delete data');
104: RETURN;
105: END IF;
106:

Line 110: fnd_file.put_line(fnd_file.Log,

106:
107: /* Validating From date & To Date as both are required */
108: IF ((p_from_date IS NOT NULL AND p_to_date IS NULL) OR
109: (p_from_date IS NULL AND p_to_date IS NOT NULL)) THEN
110: fnd_file.put_line(fnd_file.Log,
111: ' Date range is not provided to delete record. ');
112: RETURN;
113: END IF;
114:

Line 117: fnd_file.put_line(fnd_file.Log,

113: END IF;
114:
115: /*Case when batch_id is passed as input parameter to delete publish history*/
116: IF (p_batch_id IS NOT NULL) THEN
117: fnd_file.put_line(fnd_file.Log,
118: ' Control entrered into Batch ID varification block with : ' ||
119: p_batch_id);
120: l_where_clause := l_where_clause || ' AND hdr.batch_id = ' ||
121: p_batch_id;

Line 144: fnd_file.put_line(fnd_file.Log,

140:
141: /*Case when target_system_code is passed as input parameter to delete publish history*/
142: IF (p_target_system_code IS NOT NULL) THEN
143:
144: fnd_file.put_line(fnd_file.Log,
145: ' Control entrered into Target System varification block with : ' ||
146: p_target_system_code);
147: l_where_clause := l_where_clause || ' AND status.system_code = ''' ||
148: p_target_system_code || '''';

Line 170: fnd_file.put_line(fnd_file.Log,

166:
167: /* Taking the range of dates for purging */
168: IF (p_from_date IS NOT NULL AND p_to_date IS NOT NULL) THEN
169:
170: fnd_file.put_line(fnd_file.Log,
171: ' Control entrered into Date range varification block from : ' ||
172: l_from_date || ' to ' || l_to_date);
173: SELECT To_Char(To_Date(l_from_date, 'dd-mm-yy hh24:mi:ss'),
174: 'dd-mon-yy hh24:mi:ss')

Line 209: fnd_file.put_line(fnd_file.Log,

205: END IF;
206:
207: /*Case when publish status is passed as input parameter to delete publish history*/
208: IF (p_status_code IS NOT NULL) THEN
209: fnd_file.put_line(fnd_file.Log,
210: ' Control entrered into status varification block with : ' ||
211: p_status_code);
212: l_where_clause := l_where_clause || ' AND status.status_code = ''' ||
213: p_status_code || '''';

Line 229: fnd_file.put_line(fnd_file.Log,

225: END IF;
226:
227: /*Case when publisher is passed as input parameter to delete publish history*/
228: IF (p_published_by IS NOT NULL) THEN
229: fnd_file.put_line(fnd_file.Log,
230: ' Control entrered into Publiched by varification block with : ' ||
231: p_published_by);
232: l_where_clause := l_where_clause || ' AND hdr.PUBLISHED_BY = ' ||
233: p_published_by;

Line 247: fnd_file.put_line(fnd_file.Log,

243:
244: END IF;
245:
246: IF (p_entity_type IS NOT NULL) THEN
247: fnd_file.put_line(fnd_file.Log,
248: ' Control entrered into Entity type by varification block with : ' ||
249: p_entity_type);
250: l_where_clause := l_where_clause || ' AND hdr.batch_type = ' ||
251: p_entity_type;

Line 266: fnd_file.put_line(fnd_file.Log, ' l_batch_sql1 = ' || l_batch_sql1);

262: END IF;
263:
264: IF (l_where_clause1 IS NOT NULL) THEN
265: l_batch_sql1 := l_batch_sql1 || l_where_clause1;
266: fnd_file.put_line(fnd_file.Log, ' l_batch_sql1 = ' || l_batch_sql1);
267: EXECUTE IMMEDIATE l_batch_sql1 BULK COLLECT
268: INTO l_batch_tab1;
269: END IF;
270:

Line 273: fnd_file.put_line(fnd_file.Log, ' l_batch_sql2 = ' || l_batch_sql2);

269: END IF;
270:
271: IF (l_where_clause2 IS NOT NULL) THEN
272: l_batch_sql2 := l_batch_sql2 || l_where_clause2;
273: fnd_file.put_line(fnd_file.Log, ' l_batch_sql2 = ' || l_batch_sql2);
274: EXECUTE IMMEDIATE l_batch_sql2 BULK COLLECT
275: INTO l_batch_tab2;
276: END IF;
277:

Line 280: fnd_file.put_line(fnd_file.Log, ' l_batch_sql3 = ' || l_batch_sql3);

276: END IF;
277:
278: IF (l_where_clause3 IS NOT NULL) THEN
279: l_batch_sql3 := l_batch_sql3 || l_where_clause3;
280: fnd_file.put_line(fnd_file.Log, ' l_batch_sql3 = ' || l_batch_sql3);
281: EXECUTE IMMEDIATE l_batch_sql3 BULK COLLECT
282: INTO l_batch_tab3;
283: END IF;
284:

Line 286: fnd_file.put_line(fnd_file.Log,

282: INTO l_batch_tab3;
283: END IF;
284:
285: IF (l_batch_tab3.count > l_batch_tab2.count) THEN
286: fnd_file.put_line(fnd_file.Log,
287: 'getting the batch id from Systems table');
288: EXECUTE IMMEDIATE l_batch_sql3 BULK COLLECT
289: INTO l_batch_tab;
290: ELSIF (l_batch_tab3.count = 0 AND l_batch_tab2.count = 0 AND

Line 292: fnd_file.put_line(fnd_file.Log,

288: EXECUTE IMMEDIATE l_batch_sql3 BULK COLLECT
289: INTO l_batch_tab;
290: ELSIF (l_batch_tab3.count = 0 AND l_batch_tab2.count = 0 AND
291: l_batch_tab1.Count <> 0) THEN
292: fnd_file.put_line(fnd_file.Log,
293: 'getting the batch id from Batch header table');
294: EXECUTE IMMEDIATE l_batch_sql1 BULK COLLECT
295: INTO l_batch_tab;
296: ELSE

Line 298: fnd_file.put_line(fnd_file.Log, ' l_batch_sql =' || l_batch_sql);

294: EXECUTE IMMEDIATE l_batch_sql1 BULK COLLECT
295: INTO l_batch_tab;
296: ELSE
297: l_batch_sql := l_batch_sql || l_where_clause;
298: fnd_file.put_line(fnd_file.Log, ' l_batch_sql =' || l_batch_sql);
299: EXECUTE IMMEDIATE l_batch_sql BULK COLLECT
300: INTO l_batch_tab;
301: END IF;
302:

Line 303: fnd_file.put_line(fnd_file.Log,

299: EXECUTE IMMEDIATE l_batch_sql BULK COLLECT
300: INTO l_batch_tab;
301: END IF;
302:
303: fnd_file.put_line(fnd_file.Log,
304: ' before final execution of deleting the data from the tables');
305: -- Once we get batch_id for passed in parameter, we will delete data from all tables.
306:
307: fnd_file.put_line(fnd_file.Log,

Line 307: fnd_file.put_line(fnd_file.Log,

303: fnd_file.put_line(fnd_file.Log,
304: ' before final execution of deleting the data from the tables');
305: -- Once we get batch_id for passed in parameter, we will delete data from all tables.
306:
307: fnd_file.put_line(fnd_file.Log,
308: 'Total Count of batch ID : ' || l_batch_tab.Count);
309:
310: IF l_batch_tab.Count > 0 THEN
311: FOR i IN l_batch_tab.FIRST .. l_batch_tab.LAST LOOP

Line 312: fnd_file.put_line(fnd_file.Log,

308: 'Total Count of batch ID : ' || l_batch_tab.Count);
309:
310: IF l_batch_tab.Count > 0 THEN
311: FOR i IN l_batch_tab.FIRST .. l_batch_tab.LAST LOOP
312: fnd_file.put_line(fnd_file.Log,
313: ' Enetered FOR loop for ' || i || ' time');
314: l_batch_id := l_batch_tab(i);
315:
316: EXECUTE IMMEDIATE ' select count(*) from EGO_PUB_BAT_STATUS_B where BATCH_ID = ' ||

Line 323: fnd_file.put_line(fnd_file.Log,

319: EXECUTE IMMEDIATE ' select count(*) from EGO_PUB_BAT_SYSTEMS_B where BATCH_ID = ' ||
320: l_batch_id
321: INTO l_system_sel_count;
322:
323: fnd_file.put_line(fnd_file.Log,
324: 'ststus table count is ' || l_status_sel_count);
325: fnd_file.put_line(fnd_file.Log,
326: 'system table count is ' || l_system_sel_count);
327:

Line 325: fnd_file.put_line(fnd_file.Log,

321: INTO l_system_sel_count;
322:
323: fnd_file.put_line(fnd_file.Log,
324: 'ststus table count is ' || l_status_sel_count);
325: fnd_file.put_line(fnd_file.Log,
326: 'system table count is ' || l_system_sel_count);
327:
328: IF (l_where_clause2 IS NOT NULL) THEN
329: fnd_file.put_line(fnd_file.Log,

Line 329: fnd_file.put_line(fnd_file.Log,

325: fnd_file.put_line(fnd_file.Log,
326: 'system table count is ' || l_system_sel_count);
327:
328: IF (l_where_clause2 IS NOT NULL) THEN
329: fnd_file.put_line(fnd_file.Log,
330: ' Getting systems based on given status for deleting systems table');
331: l_where_clause2 := l_where_clause2 || ' AND BATCH_ID = ' ||
332: l_batch_id;
333: l_status_sys_seq := l_status_sys_seq || l_where_clause2;

Line 334: fnd_file.put_line(fnd_file.Log,

330: ' Getting systems based on given status for deleting systems table');
331: l_where_clause2 := l_where_clause2 || ' AND BATCH_ID = ' ||
332: l_batch_id;
333: l_status_sys_seq := l_status_sys_seq || l_where_clause2;
334: fnd_file.put_line(fnd_file.Log,
335: 'l_status_sys_seq = ' || l_status_sys_seq);
336: EXECUTE IMMEDIATE l_status_sys_seq BULK COLLECT
337: INTO l_status_syss;
338: fnd_file.put_line(fnd_file.Log,

Line 338: fnd_file.put_line(fnd_file.Log,

334: fnd_file.put_line(fnd_file.Log,
335: 'l_status_sys_seq = ' || l_status_sys_seq);
336: EXECUTE IMMEDIATE l_status_sys_seq BULK COLLECT
337: INTO l_status_syss;
338: fnd_file.put_line(fnd_file.Log,
339: 'l_status_syss count = ' || l_status_syss.count);
340:
341: IF l_status_syss.Count > 0 THEN
342: FOR j IN l_status_syss.FIRST .. l_status_syss.LAST LOOP

Line 344: fnd_file.put_line(fnd_file.Log,

340:
341: IF l_status_syss.Count > 0 THEN
342: FOR j IN l_status_syss.FIRST .. l_status_syss.LAST LOOP
343: l_sys_frm_status := l_status_syss(j);
344: fnd_file.put_line(fnd_file.Log,
345: 'deleting system ' || l_sys_frm_status ||
346: ' from systems table for the batch id = ' ||
347: l_batch_id);
348: EXECUTE IMMEDIATE l_delete_batch_system1

Line 355: fnd_file.put_line(fnd_file.Log,

351: END IF;
352: END IF;
353:
354: IF (l_status_sel_count >= 1 AND l_status_flag AND l_system_flag) THEN
355: fnd_file.put_line(fnd_file.Log,
356: 'Given status code and systems. There are other records along with the given input, so deleting only the provided input from status table');
357: EXECUTE IMMEDIATE l_delete_batch_status2
358: USING l_batch_id, p_target_system_code, p_status_code;
359: l_exec_status := FALSE;

Line 361: fnd_file.put_line(fnd_file.Log,

357: EXECUTE IMMEDIATE l_delete_batch_status2
358: USING l_batch_id, p_target_system_code, p_status_code;
359: l_exec_status := FALSE;
360: ELSIF (l_status_sel_count >= 1 AND l_status_flag) THEN
361: fnd_file.put_line(fnd_file.Log,
362: 'There are other records along with the given status code, so deleting only the provided input from status table ');
363: EXECUTE IMMEDIATE l_delete_batch_status1
364: USING l_batch_id, p_status_code;
365: l_exec_status := FALSE;

Line 367: fnd_file.put_line(fnd_file.Log,

363: EXECUTE IMMEDIATE l_delete_batch_status1
364: USING l_batch_id, p_status_code;
365: l_exec_status := FALSE;
366: ELSIF (l_status_sel_count >= 1 AND l_system_flag) THEN
367: fnd_file.put_line(fnd_file.Log,
368: 'There are other records along with the given system code, so deleting only the provided input from status table');
369: EXECUTE IMMEDIATE l_delete_batch_status3
370: USING l_batch_id, p_target_system_code;
371: l_exec_status := FALSE;

Line 375: fnd_file.put_line(fnd_file.Log,

371: l_exec_status := FALSE;
372: END IF;
373:
374: IF (l_system_sel_count >= 1 AND l_system_flag) THEN
375: fnd_file.put_line(fnd_file.Log,
376: 'There are other records along with the given system code, so deleting only the provided input from systems table');
377: EXECUTE IMMEDIATE l_delete_batch_system1
378: USING l_batch_id, p_target_system_code;
379: l_exec_sys := FALSE;

Line 383: fnd_file.put_line(fnd_file.Log,

379: l_exec_sys := FALSE;
380: END IF;
381:
382: IF (l_exec_status AND l_exec_sys) THEN
383: fnd_file.put_line(fnd_file.Log,
384: 'deleting compltely based on Batch ID as there are no other data in the status and systems table');
385: EXECUTE IMMEDIATE l_delete_batch_hdr
386: USING l_batch_id;
387: EXECUTE IMMEDIATE l_delete_batch_param

Line 414: fnd_file.put_line(fnd_file.Log,

410: USING l_batch_id;
411: END IF;
412: END IF;
413:
414: fnd_file.put_line(fnd_file.Log,
415: 'records are deleted based on the given parameters ');
416: END LOOP;
417: ELSE
418: fnd_file.put_line(fnd_file.Log,

Line 418: fnd_file.put_line(fnd_file.Log,

414: fnd_file.put_line(fnd_file.Log,
415: 'records are deleted based on the given parameters ');
416: END LOOP;
417: ELSE
418: fnd_file.put_line(fnd_file.Log,
419: 'No records are deleted as the count of batch ID is 0');
420:
421: END IF;
422:

Line 431: fnd_file.put_line(fnd_file.Log,

427: EXCEPTION
428: WHEN OTHERS THEN
429: err_buff := SQLERRM;
430: --Sending message to log file in case of runtime exception occurs.
431: fnd_file.put_line(fnd_file.Log,
432: 'Records are not deleted due to runtime exception ' ||
433: SQLERRM);
434: END Purge_Publish_History;
435: /* End Purge_Publish_History API*/