49:
50: CURSOR check_status is
51: select 1 from dual
52: where exists ( select 'X'
53: from fa_mass_update_batch_details
54: where batch_id = v_batch_id
55: and status_code IN ('P', 'R' ) );
56: BEGIN
57: if(x_retire_status = 'DELETED') then
122: if v_err_code <> '0' then
123: delete from fa_mass_update_batch_headers
124: where batch_id = v_batch_id;
125:
126: delete from fa_mass_update_batch_details
127: where batch_id = v_batch_id;
128:
129: raise_application_error(-20000, v_err_code);
130: else
131: -- success
132: delete from fa_mass_update_batch_headers
133: where batch_id = v_batch_id;
134:
135: delete from fa_mass_update_batch_details
136: where batch_id = v_batch_id;
137: end if;
138:
139: end if; -- v_dummy