The following lines contain the word 'select', 'insert', 'update' or 'delete':
Select batch_id
From XTR_BATCHES
Where company_code = p_company_code
and batch_id between p_batch_id_from and p_batch_id_to
Order by batch_id desc;
Select period_start, period_end
From XTR_BATCHES
Where batch_id = p_curr_batch_id;
Select 1
From XTR_BATCHES
Where batch_id = p_curr_batch_id
and gl_group_id is not null;
Select e.batch_id
From XTR_BATCHES B, XTR_BATCH_EVENTS E
Where b.batch_id = e.batch_id
and e.batch_id > p_curr_batch_id
and b.company_code = p_company_code
and e.event_code = p_event_code
and b.batch_type is null
order by e.batch_id asc;
Select 1
From XTR_BATCHES
where batch_id = l_late_batch_id
and gl_group_id is not null; */
While BATCH_SEQ%FOUND LOOP -- Delete Batches.Start from greatest ID.
-- Raise exception if the deleted batch id has been transferred to GL
Open CHK_TRANS_GL;
Select batch_type
Into v_batch_type
From Xtr_Batches
Where batch_id = p_curr_batch_id;
-- Raise exception if the deleted batch id which has later batch id existed.
Open FIND_LATE_BATCH;
| Procedure to delete non-transferred journal entries for the |
| specified company and date range and reset the 'journal_created'|
| flag in DDA to allow for re-generation of journals at a later |
| date. |
| CALLED BY |
| Clear_Journal_Process |
| PARAMETERS |
| in_company company code. (required) |
| in_start_date date. (required) |
| in_end_date date. (required) |
| HISTORY |
| 05/19/99 eklau Created. |
| 06/15/99 eklau Added logic to exclude clearing journal |
| lines with status = 'R' in column |
| JNL_REVERSAL_IND. These are reversal |
| entries for closed/cancelled deals which|
| no longer have associating DDA rows. |
--------------------------------------------------------------------- */
PROCEDURE CLEAR_JOURNALS
(in_company IN VARCHAR2,
in_batch_id IN NUMBER) is
Cursor GET_BATCH_TYPE is
Select batch_type
from xtr_batches
where batch_id = in_batch_id;
Update XTR_DEAL_DATE_AMOUNTS
Set BATCH_ID = null
Where company_code = in_company
and batch_id = in_batch_id;
Delete from XTR_JOURNALS
Where company_code = in_company
and batch_id = in_batch_id;
Delete from XTR_BATCH_EVENTS
Where batch_id = in_batch_id
and event_code = p_event_code;
Delete from XTR_BATCHES
Where batch_id = in_batch_id;