[Home] [Help]
3:
4: -- global package data type and variables
5: TYPE r_parameters IS RECORD (
6: p_process hxc_retrieval_processes.NAME%TYPE,
7: p_transaction_code hxc_transactions.transaction_code%TYPE,
8: p_start_date DATE,
9: p_end_date DATE,
10: p_incremental VARCHAR2 (1),
11: p_rerun_flag VARCHAR2 (1),
118:
119: -- package cursor
120: CURSOR csr_get_tx_id
121: IS
122: SELECT hxc_transactions_s.NEXTVAL
123: FROM SYS.DUAL;
124:
125: CURSOR csr_get_tx_detail_id (p_max BINARY_INTEGER)
126: IS
843:
844: CURSOR csr_chk_tx
845: IS
846: SELECT 'x'
847: FROM hxc_transactions tx
848: WHERE tx.status = 'IN PROGRESS'
849: AND tx.TYPE = 'RETRIEVAL'
850: AND tx.transaction_process_id = p_process_id
851: AND EXISTS (SELECT 'y'
1337: l_not_exists VARCHAR2 (450)
1338: := '
1339: AND NOT EXISTS (select ''x''
1340: FROM hxc_transaction_details txd
1341: , hxc_transactions tx
1342: WHERE tx.transaction_process_id = :p_process_id
1343: AND tx.type = ''RETRIEVAL''
1344: AND tx.status = ''SUCCESS''
1345: AND tx.transaction_id = txd.transaction_id
1588: txd.time_building_block_id,
1589: NVL (MAX (txd.time_building_block_ovn), 0)
1590: FROM hxc_retrieval_range_blks rrb,
1591: hxc_transaction_details txd,
1592: hxc_transactions tx
1593: WHERE tx.transaction_process_id = p_retrieval_process_id
1594: AND tx.TYPE = 'RETRIEVAL'
1595: AND tx.status = 'SUCCESS'
1596: AND tx.transaction_id = txd.transaction_id
1607: )
1608: IS
1609: SELECT txd.time_building_block_id,
1610: NVL (MAX (txd.time_building_block_ovn), 0)
1611: FROM hxc_transaction_details txd, hxc_transactions tx
1612: WHERE tx.transaction_process_id = p_retrieval_process_id
1613: AND tx.TYPE = 'RETRIEVAL'
1614: AND tx.status = 'SUCCESS'
1615: AND tx.transaction_id = txd.transaction_id
1631: CURSOR csr_get_max_ovn (p_retrieval_process_id NUMBER, p_since_date DATE)
1632: IS
1633: SELECT txd.time_building_block_id,
1634: NVL (MAX (txd.time_building_block_ovn), 0)
1635: FROM hxc_transaction_details txd, hxc_transactions tx
1636: WHERE tx.transaction_process_id = p_retrieval_process_id
1637: AND tx.TYPE = 'RETRIEVAL'
1638: AND tx.status = 'SUCCESS'
1639: AND tx.transaction_id = txd.transaction_id
1840: p_rollback IN BOOLEAN DEFAULT FALSE
1841: )
1842: IS
1843: PRAGMA AUTONOMOUS_TRANSACTION;
1844: l_tx_id hxc_transactions.transaction_id%TYPE;
1845: l_time_max INTEGER;
1846: l_day_max INTEGER;
1847: l_detail_max INTEGER;
1848: l_error_max INTEGER;
1881: hr_utility.set_location ('Processing ' || l_proc, 7);
1882: END IF;
1883:
1884: -- already inserted - lets update it!
1885: UPDATE hxc_transactions
1886: SET status = p_status,
1887: exception_description = p_description
1888: WHERE transaction_id = hxc_generic_retrieval_pkg.g_transaction_id;
1889: ELSE
1903: THEN
1904: hr_utility.set_location ('Processing ' || l_proc, 30);
1905: END IF;
1906:
1907: INSERT INTO hxc_transactions
1908: (transaction_id,
1909: transaction_process_id, transaction_date,
1910: transaction_code,
1911: TYPE, status, exception_description
1994: INTO l_tx_id;
1995:
1996: CLOSE csr_get_tx_id;
1997:
1998: INSERT INTO hxc_transactions
1999: (transaction_id, transaction_process_id,
2000: transaction_date, TYPE, status,
2001: exception_description
2002: )
2008: IF (p_description IS NULL OR p_description LIKE '%ORA-20001%')
2009: THEN
2010: -- insure we do not write over a meaningful excpetion already
2011: -- set within the retrieval
2012: UPDATE hxc_transactions
2013: SET status = p_status
2014: WHERE transaction_id = hxc_generic_retrieval_pkg.g_transaction_id;
2015: ELSE
2016: -- record the proper exception most likely thrown by the recipient
2014: WHERE transaction_id = hxc_generic_retrieval_pkg.g_transaction_id;
2015: ELSE
2016: -- record the proper exception most likely thrown by the recipient
2017: -- application code
2018: UPDATE hxc_transactions
2019: SET status = p_status,
2020: exception_description = p_description
2021: WHERE transaction_id = hxc_generic_retrieval_pkg.g_transaction_id;
2022: END IF;
6308: where tbb_latest.resource_id BETWEEN :p_lower_range and :p_upper_range
6309: and tbb_latest.approval_status <> ''ERROR''
6310: AND NOT EXISTS (select ''x''
6311: FROM hxc_transaction_details txd
6312: , hxc_transactions tx
6313: WHERE tx.transaction_process_id = :p_process_id
6314: AND tx.type = ''RETRIEVAL''
6315: AND tx.status = ''SUCCESS''
6316: AND tx.transaction_id = txd.transaction_id
6334: tbb_latest.last_update_date > :p_since_date
6335: AND tbb_latest.approval_status <> ''ERROR''
6336: AND NOT EXISTS (select ''x''
6337: FROM hxc_transaction_details txd
6338: , hxc_transactions tx
6339: WHERE tx.transaction_process_id = :p_process_id
6340: AND tx.type = ''RETRIEVAL''
6341: AND tx.status = ''SUCCESS''
6342: AND tx.transaction_id = txd.transaction_id
6440: , hxc_time_building_blocks detail_block
6441: , hxc_time_building_blocks day_block
6442: , hxc_time_attributes timecard_att
6443: , hxc_transaction_details txd
6444: , hxc_transactions tx
6445: WHERE
6446: tx.transaction_code = :p_transaction_code
6447: AND
6448: txd.transaction_id = tx.transaction_id
6642: IS
6643: CURSOR chk_transaction
6644: IS
6645: SELECT transaction_id
6646: FROM hxc_transactions tx
6647: WHERE transaction_process_id = p_process_id
6648: AND status = 'IN PROGRESS';
6649:
6650: CURSOR csr_chk_where_clause (
6669: SELECT TO_CHAR (SYSDATE, 'HH24:MI:SS DD-MON-YY')
6670: FROM hxc_retrieval_ranges
6671: WHERE transaction_id = p_transaction_id;
6672:
6673: l_transaction_id hxc_transactions.transaction_id%TYPE;
6674: l_bee_ok VARCHAR2 (1);
6675: l_cnt PLS_INTEGER := 0;
6676: l_no_ranges BOOLEAN := TRUE;
6677: l_dummy VARCHAR2 (20);
7776: -- Gets called when the transaction is updated with either 'SUCESS' or 'DELETE'
7777: -- from update_transaction_status
7778: -- Deletes based on concurrent process id which is unique for each process
7779: -- Ref. Bug 5669202
7780: PROCEDURE delete_retrieval_ranges (p_transaction_id IN hxc_transactions.transaction_id%TYPE)
7781: IS
7782: PRAGMA AUTONOMOUS_TRANSACTION;
7783: BEGIN
7784:
7816: -- p_exception_description - exception description
7817: -- p_rollback - is the retrieval being rolled back
7818: PROCEDURE update_transaction_status (
7819: p_process hxc_retrieval_processes.NAME%TYPE,
7820: p_status hxc_transactions.status%TYPE,
7821: p_exception_description hxc_transactions.exception_description%TYPE,
7822: p_rollback BOOLEAN DEFAULT FALSE
7823: )
7824: IS
7817: -- p_rollback - is the retrieval being rolled back
7818: PROCEDURE update_transaction_status (
7819: p_process hxc_retrieval_processes.NAME%TYPE,
7820: p_status hxc_transactions.status%TYPE,
7821: p_exception_description hxc_transactions.exception_description%TYPE,
7822: p_rollback BOOLEAN DEFAULT FALSE
7823: )
7824: IS
7825: -- going to call the chk_retrieval_process procedure - do not need mapping id
7824: IS
7825: -- going to call the chk_retrieval_process procedure - do not need mapping id
7826: l_process_id hxc_retrieval_processes.retrieval_process_id%TYPE;
7827: l_mapping_id hxc_mappings.mapping_id%TYPE;
7828: l_tx_id hxc_transactions.transaction_id%TYPE;
7829: l_proc VARCHAR2 (72);
7830: l_time_max INTEGER;
7831: l_day_max INTEGER;
7832: l_detail_max INTEGER;
7906: INTO l_tx_id;
7907:
7908: CLOSE csr_get_tx_id;
7909:
7910: INSERT INTO hxc_transactions
7911: (transaction_id, transaction_process_id,
7912: transaction_date, TYPE, status,
7913: exception_description
7914: )
7916: SYSDATE, 'RETRIEVAL_STATUS_UPDATE', p_status,
7917: p_exception_description
7918: );
7919:
7920: UPDATE hxc_transactions
7921: SET status = p_status,
7922: exception_description = p_exception_description
7923: WHERE transaction_id = hxc_generic_retrieval_pkg.g_transaction_id;
7924: