38: l_total_count4 number;
39:
40: --Bug3681437:Used the trunc cmd for transaction_date validation for all 5 cursors below
41:
42: -- bug 4951747 : removed trunc to leverage MTL_MATERIAL_TRANSACTIONS_N5 index
43:
44: -- Bug 5894075 : removed trunc from all the queries and added - (1/(24*3600)) to max date
45: CURSOR c_mmt IS
46: SELECT ROWID, TRANSACTION_ID
43:
44: -- Bug 5894075 : removed trunc from all the queries and added - (1/(24*3600)) to max date
45: CURSOR c_mmt IS
46: SELECT ROWID, TRANSACTION_ID
47: FROM MTL_MATERIAL_TRANSACTIONS
48: WHERE transaction_date >= l_min_date and transaction_date <= l_max_date + 1-(1/(24*3600))
49: AND organization_id = p_organization_id;
50:
51: CURSOR c_mmta IS
293: l_count := SQL%ROWCOUNT;
294: COMMIT;
295: l_total_count4 := l_total_count4 + l_count;
296:
297: -- *************** Purge from MTL_MATERIAL_TRANSACTIONS ********************
298: l_count := 0;
299:
300: FORALL i IN rowid_list.first .. rowid_list.last
301: DELETE FROM MTL_MATERIAL_TRANSACTIONS
297: -- *************** Purge from MTL_MATERIAL_TRANSACTIONS ********************
298: l_count := 0;
299:
300: FORALL i IN rowid_list.first .. rowid_list.last
301: DELETE FROM MTL_MATERIAL_TRANSACTIONS
302: WHERE ROWID = rowid_list(i);
303:
304: l_count := SQL%ROWCOUNT;
305: COMMIT;