DBA Data[Home] [Help]

APPS.INV_HV_TXN_PURGE dependencies on MTL_MATERIAL_TRANSACTIONS

Line 97: FROM MTL_MATERIAL_TRANSACTIONS

93: AND (p_organization_id IS NULL OR organization_id = p_organization_id);
94:
95: CURSOR c_mmt IS
96: SELECT ROWID
97: FROM MTL_MATERIAL_TRANSACTIONS
98: WHERE transaction_date < l_cut_off_date
99: AND (p_organization_id IS NULL OR organization_id = p_organization_id);
100:
101:

Line 354: --Purging MTL_MATERIAL_TRANSACTIONS

350: END;
351:
352:
353:
354: --Purging MTL_MATERIAL_TRANSACTIONS
355: BEGIN
356:
357: IF (l_debug = 1) THEN
358: inv_trx_util_pub.TRACE(' Purging MTL_MATERIAL_TRANSACTIONS ... ' );

Line 358: inv_trx_util_pub.TRACE(' Purging MTL_MATERIAL_TRANSACTIONS ... ' );

354: --Purging MTL_MATERIAL_TRANSACTIONS
355: BEGIN
356:
357: IF (l_debug = 1) THEN
358: inv_trx_util_pub.TRACE(' Purging MTL_MATERIAL_TRANSACTIONS ... ' );
359: END IF;
360:
361: -- This will get the count of rows to be deleted
362: BEGIN

Line 365: FROM mtl_material_transactions

361: -- This will get the count of rows to be deleted
362: BEGIN
363: SELECT count(transaction_id)
364: INTO rows_to_del
365: FROM mtl_material_transactions
366: WHERE transaction_date < l_cut_off_date
367: AND (p_organization_id IS NULL OR organization_id = p_organization_id);
368:
369: EXCEPTION

Line 390: inv_trx_util_pub.TRACE(' Deleting from MTL_MATERIAL_TRANSACTIONS -- Direct deletion approach' );

386: IF rows_to_del < max_rows_to_del THEN
387: --Rows to be deleted are less hence delete them directly
388:
389: IF (l_debug = 1) THEN
390: inv_trx_util_pub.TRACE(' Deleting from MTL_MATERIAL_TRANSACTIONS -- Direct deletion approach' );
391: END IF;
392:
393: OPEN c_mmt;
394: LOOP

Line 403: DELETE FROM mtl_material_transactions

399: EXIT;
400: END IF;
401:
402: FORALL i IN rowid_list.first .. rowid_list.last
403: DELETE FROM mtl_material_transactions
404: WHERE ROWID = rowid_list(i);
405: COMMIT;
406: EXIT WHEN c_mmt%notfound;
407: END LOOP;

Line 410: inv_trx_util_pub.TRACE(' Deleted ' || rows_to_del || ' row(s) from MTL_MATERIAL_TRANSACTIONS ' );

406: EXIT WHEN c_mmt%notfound;
407: END LOOP;
408:
409: IF (l_debug = 1) THEN
410: inv_trx_util_pub.TRACE(' Deleted ' || rows_to_del || ' row(s) from MTL_MATERIAL_TRANSACTIONS ' );
411: END IF;
412:
413: CLOSE c_mmt;
414:

Line 416: inv_trx_util_pub.TRACE(' Purged MTL_MATERIAL_TRANSACTIONS sucessfully ' );

412:
413: CLOSE c_mmt;
414:
415: IF (l_debug = 1) THEN
416: inv_trx_util_pub.TRACE(' Purged MTL_MATERIAL_TRANSACTIONS sucessfully ' );
417: END IF;
418:
419: ELSE
420:

Line 422: s_sql_stmt := ' CREATE TABLE mtl_material_transactions_bu '

418:
419: ELSE
420:
421: -- Rows to be delted are more hence follow Temp table creation method
422: s_sql_stmt := ' CREATE TABLE mtl_material_transactions_bu '
423: || ' STORAGE (initial 1 M next 1 M minextents 1 maxextents unlimited) '
424: || ' NOLOGGING AS '
425: || ' SELECT * FROM MTL_MATERIAL_TRANSACTIONS '
426: || ' WHERE 1 = 1 ' ;

Line 425: || ' SELECT * FROM MTL_MATERIAL_TRANSACTIONS '

421: -- Rows to be delted are more hence follow Temp table creation method
422: s_sql_stmt := ' CREATE TABLE mtl_material_transactions_bu '
423: || ' STORAGE (initial 1 M next 1 M minextents 1 maxextents unlimited) '
424: || ' NOLOGGING AS '
425: || ' SELECT * FROM MTL_MATERIAL_TRANSACTIONS '
426: || ' WHERE 1 = 1 ' ;
427:
428: IF p_organization_id IS NOT NULL THEN
429: s_sql_stmt := s_sql_stmt || ' and organization_id <> ' || p_organization_id;

Line 442: inv_trx_util_pub.TRACE(' Temp Table mtl_material_transactions_bu created.' );

438: rows_processed := dbms_sql.execute(cursor_name);
439: DBMS_SQL.close_cursor(cursor_name);
440:
441: IF (l_debug = 1) THEN
442: inv_trx_util_pub.TRACE(' Temp Table mtl_material_transactions_bu created.' );
443: END IF;
444:
445: --Truncate the original table
446: s_sql_stmt := 'TRUNCATE TABLE '|| inv_user_name || '.MTL_MATERIAL_TRANSACTIONS';

Line 446: s_sql_stmt := 'TRUNCATE TABLE '|| inv_user_name || '.MTL_MATERIAL_TRANSACTIONS';

442: inv_trx_util_pub.TRACE(' Temp Table mtl_material_transactions_bu created.' );
443: END IF;
444:
445: --Truncate the original table
446: s_sql_stmt := 'TRUNCATE TABLE '|| inv_user_name || '.MTL_MATERIAL_TRANSACTIONS';
447: cursor_name := dbms_sql.open_cursor;
448: DBMS_SQL.PARSE(cursor_name, s_sql_stmt, dbms_sql.native);
449: rows_processed := dbms_sql.execute(cursor_name);
450: DBMS_SQL.close_cursor(cursor_name);

Line 453: inv_trx_util_pub.TRACE(' Truncated the table MTL_MATERIAL_TRANSACTIONS');

449: rows_processed := dbms_sql.execute(cursor_name);
450: DBMS_SQL.close_cursor(cursor_name);
451:
452: IF (l_debug = 1) THEN
453: inv_trx_util_pub.TRACE(' Truncated the table MTL_MATERIAL_TRANSACTIONS');
454: END IF;
455:
456: -- Insert required rows back to original table
457: s_sql_stmt := 'INSERT INTO MTL_MATERIAL_TRANSACTIONS SELECT * FROM mtl_material_transactions_bu';

Line 457: s_sql_stmt := 'INSERT INTO MTL_MATERIAL_TRANSACTIONS SELECT * FROM mtl_material_transactions_bu';

453: inv_trx_util_pub.TRACE(' Truncated the table MTL_MATERIAL_TRANSACTIONS');
454: END IF;
455:
456: -- Insert required rows back to original table
457: s_sql_stmt := 'INSERT INTO MTL_MATERIAL_TRANSACTIONS SELECT * FROM mtl_material_transactions_bu';
458: cursor_name := dbms_sql.open_cursor;
459: DBMS_SQL.PARSE(cursor_name, s_sql_stmt, dbms_sql.native);
460: rows_processed := dbms_sql.execute(cursor_name);
461: DBMS_SQL.close_cursor(cursor_name);

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

460: rows_processed := dbms_sql.execute(cursor_name);
461: DBMS_SQL.close_cursor(cursor_name);
462:
463: IF (l_debug = 1) THEN
464: inv_trx_util_pub.TRACE(' Inserted ' || rows_processed || ' row(s) into the table MTL_MATERIAL_TRANSACTIONS');
465: END IF;
466:
467: --Commit the transaction
468: COMMIT;

Line 474: s_sql_stmt := 'DROP TABLE mtl_material_transactions_bu';

470: inv_trx_util_pub.TRACE(' Commited the transactions ');
471: END IF;
472:
473: --Drop the temporary table
474: s_sql_stmt := 'DROP TABLE mtl_material_transactions_bu';
475: cursor_name := dbms_sql.open_cursor;
476: DBMS_SQL.PARSE(cursor_name, s_sql_stmt, dbms_sql.native);
477: rows_processed := dbms_sql.execute(cursor_name);
478: DBMS_SQL.close_cursor(cursor_name);

Line 481: inv_trx_util_pub.TRACE(' Dropped the temporary table mtl_material_transactions_bu');

477: rows_processed := dbms_sql.execute(cursor_name);
478: DBMS_SQL.close_cursor(cursor_name);
479:
480: IF (l_debug = 1) THEN
481: inv_trx_util_pub.TRACE(' Dropped the temporary table mtl_material_transactions_bu');
482: END IF;
483:
484: END IF;
485: