The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT b.lookup_id, b.parameter,b.datatype,
b.dyn_sql_stmt, b.bind_var
FROM psp_auto_lookups b
where business_group_id=p_business_group_id
and set_of_books_id=p_set_of_books_id
order by lookup_id;
/* insert into psp_autotemp values(p_runid,l_lookup_id,l_data_type,v_ret_varchar,v_ret_number,v_ret_date
);
new_sql_string :='SELECT 1 from dual where '||x_string;
SELECT acct_id, expenditure_type,
acct_seq_num --added for debug purposes
FROM psp_auto_accts a
WHERE acct_type = 'E'
AND period_type = p_period_type
AND p_payroll_date BETWEEN start_date_active AND NVL(end_date_active, p_payroll_date)
AND business_group_id=p_business_group_id
and set_of_books_id=p_set_of_books_id
AND EXISTS
(SELECT '1' from psp_auto_rules where acct_id=a.acct_id)
ORDER BY acct_seq_num;
SELECT acct_id,segment_num, natural_account,
acct_seq_num --added for debug purposes
FROM psp_auto_accts a
WHERE acct_type = 'N'
AND period_type = p_period_type
AND segment_num = l_segment_num
and business_group_id=p_business_group_id
and set_of_books_id=p_set_of_books_id
AND p_payroll_date BETWEEN start_date_active AND NVL(end_date_active, p_payroll_date)
AND EXISTS
(SELECT '1' from psp_auto_rules where acct_id=a.acct_id)
ORDER BY acct_seq_num;
SELECT a.param_line_num, a.lookup_id,
a.operand, a.user_value
FROM psp_auto_params a
WHERE a.acct_id = p_acct_id
and exists
(select lookup_id from psp_auto_lookups where
lookup_id=a.lookup_id);
SELECT calculator_rule
FROM psp_auto_rules
WHERE acct_id = p_acct_id;
SELECT expenditure_type
FROM psp_auto_bypass
WHERE expenditure_type = p_expenditure_type
and set_of_books_id=p_set_of_books_id
and business_group_id=p_business_group_id;
SELECT panb.natural_account
FROM psp_auto_na_bypass panb
WHERE panb.natural_account = segs(l_seg_no)
AND panb.segment_num = l_segment_num
AND panb.set_of_books_id = p_set_of_books_id
And panb.business_group_id = p_business_group_id;
SELECT distinct(ppf.period_type)
FROM per_all_assignments_f paf,
pay_all_payrolls_f ppf
WHERE paf.assignment_id = p_assignment_id
AND p_payroll_date BETWEEN paf.effective_start_date AND NVL(paf.effective_end_date,p_payroll_date)
AND paf.payroll_id = ppf.payroll_id;
SELECT SEGMENT_NUM
FROM fnd_id_flex_segments fifs,
gl_sets_of_books gsob,
fnd_application fa
WHERE gsob.set_of_books_id = p_set_of_books_id
AND fifs.id_flex_num = gsob.chart_of_accounts_id
AND fifs.id_flex_code = 'GL#'
AND enabled_flag = 'Y'
AND fifs.application_id = fa.application_id
AND fa.application_short_name = 'SQLGL'
ORDER BY SEGMENT_NUM ASC;
SELECT segment_number
INTO l_segment_num
FROM psp_auto_segments
WHERE business_group_id = p_business_group_id
AND set_of_books_id = p_set_of_books_id;
-- Delete all records from PL/SQL table that will
-- hold the resolved values of the parameter expressions
-- for a given rule, either 'TRUE' or 'FALSE'.
v_resolved.DELETE;
lookup_array.delete;
/*Instead of choosing a last segment it is better to give client a chance to select a
Natural account seg serial num depending on the profile setting*/
-- l_seg_no := TO_NUMBER(FND_PROFILE.VALUE('PSP_AUTOP_SEG_NUM'));