The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT name, chart_of_accounts_id, period_set_name, accounted_period_type
-- INTO ACCESS_SET_NAME, STRUCT_NUM, PERIOD_SET_NAME, PERIOD_TYPE
INTO ACCESS_SET_NAME, STRUCT_NUM, PERIOD_SET_NAME_1, PERIOD_TYPE_1
FROM gl_access_sets
WHERE access_set_id = P_ACCESS_SET_ID;
SELECT name, currency_code
INTO LEDGER_NAME, LEDGER_CURRENCY
FROM gl_ledgers
WHERE ledger_id = P_LEDGER_ID;
SELECT min(start_date)
INTO min_startdate
FROM GL_PERIOD_STATUSES
WHERE application_id = 101
AND ledger_id = P_LEDGER_ID
-- AND period_year = PERIOD_YEAR
AND period_year = PERIOD_YEAR_1
AND closing_status || '' in ('P', 'C', 'O')
AND adjustment_period_flag = 'N';
SELECT nvl(end_of_date_balance_num, 0)
INTO eod_bal
FROM GL_DAILY_BALANCES_V DBAL
-- WHERE dbal.period_set_name = PERIOD_SET_NAME
WHERE dbal.period_set_name = PERIOD_SET_NAME_1
-- AND dbal.period_type = PERIOD_TYPE
AND dbal.period_type = PERIOD_TYPE_1
AND dbal.ledger_id = P_LEDGER_ID
AND dbal.currency_code = REPORTING_CURR
AND dbal.currency_type = decode(P_CURRENCY_TYPE, 'E', 'E', 'U')
AND dbal.code_combination_id = CCID
AND dbal.accounting_date =
(SELECT ps.end_date
FROM gl_period_statuses ps,
gl_date_period_map dpm
WHERE dpm.accounting_date = (START_DATE -1)
-- AND dpm.period_set_name = PERIOD_SET_NAME
AND dpm.period_set_name = PERIOD_SET_NAME_1
-- AND dpm.period_type = PERIOD_TYPE
AND dpm.period_type = PERIOD_TYPE_1
AND ps.period_name = dpm.period_name
AND ps.application_id = 101
AND ps.ledger_id = P_LEDGER_ID);
SELECT nvl(begin_balance_dr, 0) - nvl(begin_balance_cr, 0)
INTO open_bal
FROM GL_BALANCES
WHERE code_combination_id = CCID
AND period_name = START_PERIOD_NAME
AND ledger_id = P_LEDGER_ID
AND currency_code = REPORTING_CURR
AND actual_flag = 'A'
AND nvl(translated_flag, 'R') = 'R';
select ps.period_year, ps.quarter_num, ps.period_num
into v_period_year, v_quarter_num, v_period_num
from gl_period_statuses ps, gl_date_period_map dpm
where dpm.accounting_date = reporting_date
and dpm.period_set_name = calendar_name
-- and dpm.period_type = PERIOD_TYPE
and dpm.period_type = PERIOD_TYPE_1
and dpm.period_name = ps.period_name
and ps.application_id = 101
and ps.ledger_id = ldgrid;
select ps.period_name, ps.start_date
into v_period_name, v_start_date
from gl_period_statuses ps
where ps.application_id = 101
and ps.ledger_id = ldgrid
and ps.adjustment_period_flag = 'N'
and ps.start_date =
(select min(ps1.start_date)
from gl_period_statuses ps1
where ps1.application_id = 101
and ps1.ledger_id = ldgrid
and ps1.period_year = v_period_year
and ps1.quarter_num = decode(balance_type,
'QATD', v_quarter_num,
ps1.quarter_num)
and ps1.period_num = decode(balance_type,
'PATD', v_period_num,
ps1.period_num)
and ps1.closing_status in ('P', 'C', 'O')
and ps1.adjustment_period_flag = 'N');
Function SELECT_BAL_p return varchar2 is
Begin
return SELECT_BAL;
Function SELECT_ALL_p return varchar2 is
Begin
return SELECT_ALL;