DBA Data[Home] [Help]

APPS.INV_HV_TXN_PURGE dependencies on MTL_MATERIAL_TXN_ALLOCATIONS

Line 91: FROM MTL_MATERIAL_TXN_ALLOCATIONS

87: AND open_flag = 'Y';
88:
89: CURSOR c_mmta IS
90: SELECT ROWID
91: FROM MTL_MATERIAL_TXN_ALLOCATIONS
92: WHERE transaction_date < l_cut_off_date
93: AND (p_organization_id IS NULL OR organization_id = p_organization_id);
94:
95: CURSOR c_mmt IS

Line 206: --Purging MTL_MATERIAL_TXN_ALLOCATIONS

202: END;
203:
204:
205:
206: --Purging MTL_MATERIAL_TXN_ALLOCATIONS
207: BEGIN
208:
209: IF (l_debug = 1) THEN
210: inv_trx_util_pub.TRACE(' Purging MTL_MATERIAL_TXN_ALLOCATIONS ... ' );

Line 210: inv_trx_util_pub.TRACE(' Purging MTL_MATERIAL_TXN_ALLOCATIONS ... ' );

206: --Purging MTL_MATERIAL_TXN_ALLOCATIONS
207: BEGIN
208:
209: IF (l_debug = 1) THEN
210: inv_trx_util_pub.TRACE(' Purging MTL_MATERIAL_TXN_ALLOCATIONS ... ' );
211: END IF;
212:
213: -- This will get the count of rows to be deleted
214: BEGIN

Line 217: FROM mtl_material_txn_allocations

213: -- This will get the count of rows to be deleted
214: BEGIN
215: SELECT count(transaction_id)
216: INTO rows_to_del
217: FROM mtl_material_txn_allocations
218: WHERE transaction_date < l_cut_off_date
219: AND (p_organization_id IS NULL OR organization_id = p_organization_id);
220:
221: EXCEPTION

Line 242: inv_trx_util_pub.TRACE(' Deleting from MTL_MATERIAL_TXN_ALLOCATIONS -- Direct deletion approach' );

238: IF rows_to_del < max_rows_to_del THEN
239: --Rows to be deleted are less hence delete them directly
240:
241: IF (l_debug = 1) THEN
242: inv_trx_util_pub.TRACE(' Deleting from MTL_MATERIAL_TXN_ALLOCATIONS -- Direct deletion approach' );
243: END IF;
244:
245: OPEN c_mmta;
246: LOOP

Line 256: DELETE FROM mtl_material_txn_allocations

252: EXIT;
253: END IF;
254:
255: FORALL i IN rowid_list.first .. rowid_list.last
256: DELETE FROM mtl_material_txn_allocations
257: WHERE ROWID = rowid_list(i);
258:
259: COMMIT;
260: EXIT WHEN c_mmta%notfound;

Line 264: inv_trx_util_pub.TRACE(' Deleted ' || rows_to_del || ' row(s) from MTL_MATERIAL_TXN_ALLOCATIONS ' );

260: EXIT WHEN c_mmta%notfound;
261: END LOOP;
262:
263: IF (l_debug = 1) THEN
264: inv_trx_util_pub.TRACE(' Deleted ' || rows_to_del || ' row(s) from MTL_MATERIAL_TXN_ALLOCATIONS ' );
265: END IF;
266:
267: CLOSE c_mmta;
268:

Line 270: inv_trx_util_pub.TRACE(' Purged MTL_MATERIAL_TXN_ALLOCATIONS sucessfully ' );

266:
267: CLOSE c_mmta;
268:
269: IF (l_debug = 1) THEN
270: inv_trx_util_pub.TRACE(' Purged MTL_MATERIAL_TXN_ALLOCATIONS sucessfully ' );
271: END IF;
272:
273: ELSE
274: -- Rows to be delted are more hence follow Temp table creation method

Line 278: || ' SELECT * FROM MTL_MATERIAL_TXN_ALLOCATIONS '

274: -- Rows to be delted are more hence follow Temp table creation method
275: s_sql_stmt := ' CREATE TABLE mtl_material_txn_alloc_bu '
276: || ' STORAGE (initial 1 M next 1 M minextents 1 maxextents unlimited) '
277: || ' NOLOGGING AS '
278: || ' SELECT * FROM MTL_MATERIAL_TXN_ALLOCATIONS '
279: || ' WHERE 1 = 1 ' ;
280:
281: IF p_organization_id IS NOT NULL THEN
282: s_sql_stmt := s_sql_stmt || ' and organization_id <> ' || p_organization_id;

Line 299: s_sql_stmt := 'TRUNCATE TABLE '|| inv_user_name || '.MTL_MATERIAL_TXN_ALLOCATIONS';

295: inv_trx_util_pub.TRACE(' Temp Table mtl_material_txn_alloc_bu created.' );
296: END IF;
297:
298: --Truncate the original table
299: s_sql_stmt := 'TRUNCATE TABLE '|| inv_user_name || '.MTL_MATERIAL_TXN_ALLOCATIONS';
300: cursor_name := dbms_sql.open_cursor;
301: DBMS_SQL.PARSE(cursor_name, s_sql_stmt, dbms_sql.native);
302: rows_processed := dbms_sql.execute(cursor_name);
303: DBMS_SQL.close_cursor(cursor_name);

Line 306: inv_trx_util_pub.TRACE(' Truncated the table MTL_MATERIAL_TXN_ALLOCATIONS');

302: rows_processed := dbms_sql.execute(cursor_name);
303: DBMS_SQL.close_cursor(cursor_name);
304:
305: IF (l_debug = 1) THEN
306: inv_trx_util_pub.TRACE(' Truncated the table MTL_MATERIAL_TXN_ALLOCATIONS');
307: END IF;
308:
309: -- Insert required rows back to original table
310: s_sql_stmt := 'INSERT INTO MTL_MATERIAL_TXN_ALLOCATIONS SELECT * FROM mtl_material_txn_alloc_bu';

Line 310: s_sql_stmt := 'INSERT INTO MTL_MATERIAL_TXN_ALLOCATIONS SELECT * FROM mtl_material_txn_alloc_bu';

306: inv_trx_util_pub.TRACE(' Truncated the table MTL_MATERIAL_TXN_ALLOCATIONS');
307: END IF;
308:
309: -- Insert required rows back to original table
310: s_sql_stmt := 'INSERT INTO MTL_MATERIAL_TXN_ALLOCATIONS SELECT * FROM mtl_material_txn_alloc_bu';
311: cursor_name := dbms_sql.open_cursor;
312: DBMS_SQL.PARSE(cursor_name, s_sql_stmt, dbms_sql.native);
313: rows_processed := dbms_sql.execute(cursor_name);
314: DBMS_SQL.close_cursor(cursor_name);

Line 317: inv_trx_util_pub.TRACE(' Inserted ' || rows_processed || ' row(s) into the table MTL_MATERIAL_TXN_ALLOCATIONS');

313: rows_processed := dbms_sql.execute(cursor_name);
314: DBMS_SQL.close_cursor(cursor_name);
315:
316: IF (l_debug = 1) THEN
317: inv_trx_util_pub.TRACE(' Inserted ' || rows_processed || ' row(s) into the table MTL_MATERIAL_TXN_ALLOCATIONS');
318: END IF;
319:
320: --Commit the transaction
321: COMMIT;