The following lines contain the word 'select', 'insert', 'update' or 'delete':
select distinct asl.ledger_id ledger_id from
gl_access_set_ledgers_v asl, gl_access_sets_v asv
where asl.access_set_id = asv.access_set_id
and asl.access_set_id = p_access_set_id
and asl.access_privilege_code in ('B','F')
and asl.object_type_code = 'L'
and asv.security_segment_code <> 'M'
order by ledger_id;
SELECT nvl(use_workflow_flag,'N')
FROM igi_itr_charge_setup
WHERE set_of_books_id = p_set_of_books_id;
SELECT nvl(auto_approve_exceed_days,7)
FROM igi_itr_charge_setup
WHERE set_of_books_id = p_set_of_books_id;
SELECT it_service_line_id
FROM igi_itr_charge_lines lines
WHERE lines.set_of_books_id = p_set_of_books_id
AND sysdate > (lines.submit_date + p_timeout_days)
AND lines.status_flag = 'V'
AND lines.it_header_id=p_header_id;
SELECT Distinct it_header_id from igi_itr_charge_lines lines
WHERE lines.set_of_books_id = p_set_of_books_id
AND sysdate > (lines.submit_date + p_timeout_days)
AND lines.status_flag = 'V';
UPDATE igi_itr_charge_lines
SET status_flag = 'A'
,last_updated_by = l_user_id
,last_update_login = l_conc_login_id
,last_update_date = sysdate
WHERE it_service_line_id = l_it_service_line_id;
/* Now need to update the action history table with information
** indicating that the service line has been auto-approved.
** So start by fetching all the information needed for insertion
** into the action history table
*/
SELECT max(sequence_num) + 1
INTO l_sequence_num
FROM igi_itr_action_history
WHERE it_service_line_id = l_it_service_line_id;
SELECT auth.authoriser_id
INTO l_rec_fnd_user_id
FROM igi_itr_charge_ranges auth
,igi_itr_charge_lines itrl
WHERE itrl.it_service_line_id = l_it_service_line_id
AND itrl.charge_range_id = auth.charge_range_id;
/* Call common package to insert record into action
** history table
*/
igi_itr_action_history_ss_pkg.insert_row(
X_Service_Line_Id => l_it_service_line_id
,X_Sequence_Num => l_sequence_num
,X_Action_Code => 'U'
,X_Action_Date => sysdate
,X_Employee_Id => l_rec_fnd_user_id
,X_Use_Workflow_Flag => 'N'
,X_Note => null
,X_Created_By => l_user_id
,X_Creation_Date => sysdate
,X_Last_Update_Login => l_conc_login_id
,X_Last_Update_Date => sysdate
,X_Last_Updated_By => l_user_id
);
FND_LOG.STRING( l_state_level,'igi.plsql.igiitrxb.IGI_ITR_TIMEOUT_PKG.find_services','Action History table has been updated for service line id '||l_it_service_line_id );
IGIGITCH.update_header_status(l_it_header_id);