309: UPDATE hxc_ar_trans_temp
310: SET thread_id = 0 ;
311:
312: -- Not much processing left, just insert the records from hxc_transacitons
313: -- to hxc_transactions_ar if they are not present already.
314:
315: INSERT INTO hxc_transactions_ar
316: (DATA_SET_ID,TRANSACTION_ID,TRANSACTION_PROCESS_ID,TRANSACTION_DATE,TYPE,
317: STATUS,EXCEPTION_DESCRIPTION,OBJECT_VERSION_NUMBER,CREATED_BY,CREATION_DATE,
311:
312: -- Not much processing left, just insert the records from hxc_transacitons
313: -- to hxc_transactions_ar if they are not present already.
314:
315: INSERT INTO hxc_transactions_ar
316: (DATA_SET_ID,TRANSACTION_ID,TRANSACTION_PROCESS_ID,TRANSACTION_DATE,TYPE,
317: STATUS,EXCEPTION_DESCRIPTION,OBJECT_VERSION_NUMBER,CREATED_BY,CREATION_DATE,
318: LAST_UPDATED_BY,LAST_UPDATE_DATE,LAST_UPDATE_LOGIN,TRANSACTION_CODE)
319: SELECT /*+ INDEX(bkuptxn hxc_transactions_pk) */
315: INSERT INTO hxc_transactions_ar
316: (DATA_SET_ID,TRANSACTION_ID,TRANSACTION_PROCESS_ID,TRANSACTION_DATE,TYPE,
317: STATUS,EXCEPTION_DESCRIPTION,OBJECT_VERSION_NUMBER,CREATED_BY,CREATION_DATE,
318: LAST_UPDATED_BY,LAST_UPDATE_DATE,LAST_UPDATE_LOGIN,TRANSACTION_CODE)
319: SELECT /*+ INDEX(bkuptxn hxc_transactions_pk) */
320: p_data_set_id,bkuptxn.TRANSACTION_ID,TRANSACTION_PROCESS_ID,
321: TRANSACTION_DATE,TYPE,STATUS,EXCEPTION_DESCRIPTION,OBJECT_VERSION_NUMBER,
322: CREATED_BY,CREATION_DATE,LAST_UPDATED_BY,LAST_UPDATE_DATE,LAST_UPDATE_LOGIN,
323: TRANSACTION_CODE
320: p_data_set_id,bkuptxn.TRANSACTION_ID,TRANSACTION_PROCESS_ID,
321: TRANSACTION_DATE,TYPE,STATUS,EXCEPTION_DESCRIPTION,OBJECT_VERSION_NUMBER,
322: CREATED_BY,CREATION_DATE,LAST_UPDATED_BY,LAST_UPDATE_DATE,LAST_UPDATE_LOGIN,
323: TRANSACTION_CODE
324: FROM hxc_transactions bkuptxn
325: WHERE bkuptxn.transaction_id IN ( SELECT temp.transaction_id
326: FROM hxc_ar_trans_temp temp
327: WHERE thread_id = 0 )
328: AND bkuptxn.transaction_id NOT IN ( SELECT transaction_id
325: WHERE bkuptxn.transaction_id IN ( SELECT temp.transaction_id
326: FROM hxc_ar_trans_temp temp
327: WHERE thread_id = 0 )
328: AND bkuptxn.transaction_id NOT IN ( SELECT transaction_id
329: FROM hxc_transactions_ar hxc
330: WHERE bkuptxn.transaction_id = hxc.transaction_id)
331: ;
332:
333: -- Delete those records from hxc_transactions.
329: FROM hxc_transactions_ar hxc
330: WHERE bkuptxn.transaction_id = hxc.transaction_id)
331: ;
332:
333: -- Delete those records from hxc_transactions.
334:
335: -- Bug 11781607
336: -- Added a NOT EXISTS condition to avoid deleting transactions
337: -- which have details falling outside the DATA Set.
335: -- Bug 11781607
336: -- Added a NOT EXISTS condition to avoid deleting transactions
337: -- which have details falling outside the DATA Set.
338:
339: DELETE FROM hxc_transactions ht
340: WHERE ROWID IN ( SELECT CHARTOROWID(trans_rowid)
341: FROM hxc_ar_trans_temp
342: WHERE thread_id = 0 )
343: AND NOT EXISTS( SELECT 1
706: -- Using the rowids, insert the transaction detail records into
707: -- hxc_transaction_details_ar.
708: -- Delete the records from hxc_transaction_details_ar using the ROWID.
709: -- Delete duplicate transaction ids from hxc_archive_temp.
710: -- Select all deposit transaction records from hxc_transactions table and
711: -- insert into hxc_transactions_ar table.
712: -- Select all retrieval transaction ids and insert into hxc_ar_trans_temp
713: -- table for the parent thread to process.
714: -- Delete all transaction records from hxc_transactions table, if the transaction
707: -- hxc_transaction_details_ar.
708: -- Delete the records from hxc_transaction_details_ar using the ROWID.
709: -- Delete duplicate transaction ids from hxc_archive_temp.
710: -- Select all deposit transaction records from hxc_transactions table and
711: -- insert into hxc_transactions_ar table.
712: -- Select all retrieval transaction ids and insert into hxc_ar_trans_temp
713: -- table for the parent thread to process.
714: -- Delete all transaction records from hxc_transactions table, if the transaction
715: -- id is present in hxc_archive_temp.
710: -- Select all deposit transaction records from hxc_transactions table and
711: -- insert into hxc_transactions_ar table.
712: -- Select all retrieval transaction ids and insert into hxc_ar_trans_temp
713: -- table for the parent thread to process.
714: -- Delete all transaction records from hxc_transactions table, if the transaction
715: -- id is present in hxc_archive_temp.
716: -- Delete from hxc_archive temp for the the next iteration of this loop.
717: -- * Loop to process attribute records.
718: -- Pick up attribute usage records for the records in hxc_temp_timecard_chunks
1250: /*
1251:
1252: DELETE FROM hxc_archive_temp
1253: WHERE EXISTS ( SELECT 1
1254: FROM hxc_transactions_ar
1255: WHERE transaction_id = master_id )
1256: AND thread_id = p_thread_id ;
1257: */
1258:
1257: */
1258:
1259: -- Bug 8888813
1260: -- If the upgrade for Deposit Transaction is not completed,
1261: -- ( Bug 8888811 ), hxc_transactions and hxc_transaction_details
1262: -- might still contain DEPOSIT transactions. Process them.
1263: IF NOT hxc_upgrade_pkg.txn_upgrade_completed
1264: THEN
1265:
1262: -- might still contain DEPOSIT transactions. Process them.
1263: IF NOT hxc_upgrade_pkg.txn_upgrade_completed
1264: THEN
1265:
1266: INSERT INTO hxc_transactions_ar
1267: (DATA_SET_ID,TRANSACTION_ID,TRANSACTION_PROCESS_ID,TRANSACTION_DATE,TYPE,
1268: STATUS,EXCEPTION_DESCRIPTION,OBJECT_VERSION_NUMBER,CREATED_BY,CREATION_DATE,
1269: LAST_UPDATED_BY,LAST_UPDATE_DATE,LAST_UPDATE_LOGIN,TRANSACTION_CODE)
1270: SELECT /*+ LEADING(temp) USE_NL(bkuptxn) */
1271: p_data_set_id,TRANSACTION_ID,TRANSACTION_PROCESS_ID,
1272: TRANSACTION_DATE,TYPE,STATUS,EXCEPTION_DESCRIPTION,OBJECT_VERSION_NUMBER,
1273: CREATED_BY,CREATION_DATE,LAST_UPDATED_BY,LAST_UPDATE_DATE,LAST_UPDATE_LOGIN,
1274: TRANSACTION_CODE
1275: FROM hxc_transactions bkuptxn,
1276: hxc_archive_temp temp
1277: WHERE transaction_id = master_id
1278: AND thread_id = p_thread_id
1279: AND transaction_id NOT IN ( SELECT transaction_id
1276: hxc_archive_temp temp
1277: WHERE transaction_id = master_id
1278: AND thread_id = p_thread_id
1279: AND transaction_id NOT IN ( SELECT transaction_id
1280: FROM hxc_transactions_ar hxc
1281: WHERE bkuptxn.transaction_id = hxc.transaction_id)
1282: AND type <> 'RETRIEVAL'
1283: ;
1284:
1284:
1285: l_trans_count := l_trans_count + SQL%ROWCOUNT;
1286:
1287: DELETE /*+ LEADING(temp) USE_NL(bkuptxn) */
1288: FROM hxc_transactions bkuptxn
1289: WHERE transaction_id IN ( SELECT master_id
1290: FROM hxc_archive_temp temp
1291: WHERE thread_id = p_thread_id)
1292: AND type <> 'RETRIEVAL';
1300: SELECT bkuptxn.transaction_id,
1301: p_data_set_id,
1302: p_thread_id,
1303: ROWIDTOCHAR(bkuptxn.ROWID)
1304: FROM hxc_transactions bkuptxn,
1305: hxc_archive_temp temp
1306: WHERE transaction_id = master_id
1307: AND thread_id = p_thread_id
1308: AND type = 'RETRIEVAL';