The following lines contain the word 'select', 'insert', 'update' or 'delete':
THEN -- update max_err_num to what it was before the run
IF g_debug THEN
l_proc_step := 10;
UPDATE ben_batch_parameter
SET max_err_num = p_max_err_num
WHERE batch_parameter_id = p_batch_parameter_id;
debug(SQL%ROWCOUNT||' rows updated.');
ELSE -- did not exist before run so delete the one which was inserted
IF g_debug THEN
l_proc_step := 20;
DELETE FROM ben_batch_parameter WHERE batch_parameter_id = p_batch_parameter_id;
debug(SQL%ROWCOUNT||' rows deleted.');
2. set max error count to 1, insert if a row did not exist in ben_batch_param
3. count the number of ben_reporting entries for this person
-- to count try join with ben_benefit_actions
4. set audit flag to Y
5. do the usual call
6. count the number of ben_erporting_entries for this person
7. If it differs from the count before execution then raise exception
8. or if an exception has occured and we are in the expcetion block
then
9. check for the latest ben_reporting entry
10. if there is one retrive the text set that token for pqp dummy message
11. and fnd raise error.
*/
OPEN csr_benmngle_batch_parameter(p_business_group_id => p_business_group_id);
UPDATE ben_batch_parameter
SET max_err_num = 1
WHERE batch_parameter_id = l_benmngle_batch_parameter.batch_parameter_id;
INSERT INTO ben_batch_parameter
(batch_parameter_id -- NOT NULL NUMBER(15)
,batch_exe_cd -- VARCHAR2(30)
,business_group_id -- NOT NULL NUMBER(15)
,thread_cnt_num -- NUMBER(15)
,max_err_num -- NUMBER(15)
,chunk_size -- NUMBER(15)
,last_update_date -- DATE
,last_updated_by -- NUMBER(15)
,last_update_login -- NUMBER(15)
,created_by -- NUMBER(15)
,creation_date -- DATE
,object_version_number -- NUMBER(9)
)
SELECT ben_batch_parameter_s.NEXTVAL --batch_parameter_id
,'BENMNGLE' --batch_exe_cd
,p_business_group_id --business_group_id
,NULL --thread_cnt_num
,1 --max_err_num
,NULL --chunk_size
,SYSDATE --last_update_date
,-1 --last_updated_by
,-1 --last_update_login
,-1 --created_by
,SYSDATE --creation_date
,1 --object_version_number
FROM DUAL;
UPDATE fnd_sessions
SET effective_date = p_effective_date
WHERE session_id = USERENV('sessionid');
UPDATE fnd_sessions
SET effective_date = p_effective_date
WHERE session_id = USERENV('sessionid');