The following lines contain the word 'select', 'insert', 'update' or 'delete':
Finds a free chunk to reuse and updates the free chunk list
accordingly.
*/
procedure find_free_chunk
(p_chunk_size in number
,p_free_chunks in out nocopy free_chunk_t
,p_start out nocopy number
) is
l_first_free binary_integer;
p_free_chunks.delete(l_candidate);
,p_delete_index in binary_integer
) is
begin
p_free_chunks(p_merge_index) := p_count1 + p_count2;
if p_delete_index is not null then
p_free_chunks.delete(p_delete_index);
,p_delete_index => null
);
,p_delete_index => l_next
);
,p_delete_index => l_first_chunk
);
select u.route_id
from ff_database_items d
, ff_user_entities u
where d.user_name = p_dbi_name
and d.user_entity_id = u.user_entity_id
and (
u.legislation_code is null and u.business_group_id is null or
u.legislation_code = p_legislation_code or
u.business_group_id = p_business_group_id or
u.legislation_code =
(
select b.legislation_code
from per_business_groups_perf b
where b.business_group_id = p_business_group_id
)
)
;
select null
from ff_routes r
where r.route_id = p_route_id
;
select rcu.context_id
from ff_route_context_usages rcu
where rcu.route_id = p_route_id
;
select fdiu.item_name name,
to_number(substr(fdiu.item_generated_name, 2)) varpos,
decode(fdiu.indicator_var_name, NULL, INVALID_POS,
to_number(substr(fdiu.indicator_var_name, 2))) indpos,
decode(fdiu.data_type,
'D', 'DATE',
'N', 'NUMBER',
'T', 'TEXT', 'XXX') data_type,
fdiu.usage,
decode(fdiu.usage,
'U', 1,
'I', 2, 'B', 2, 'O', 2,
'D', 3) usageorder,
0 context_sum1,
0 context_sum2,
fdiu.context_id,
fdiu.route_id
from ff_fdi_usages_f fdiu
where fdiu.formula_id = p_formula_id
and p_effective_date between
fdiu.effective_start_date and fdiu.effective_end_date
and fdiu.load_when_running = 'Y'
order by 6, fdiu.item_name; -- *** IMPORTANT.
select 'FFP' || fff.formula_id || '_' ||
to_char(fff.effective_start_date, 'DDMMYYYY'),
fff.effective_start_date,
fff.effective_end_date,
fff.formula_name,
fff.business_group_id,
fff.legislation_code,
fci.fdiu_entry_count
into l_package_name,
l_effective_start_date,
l_effective_end_date,
l_formula_name,
l_business_group_id,
l_legislation_code,
l_fdiu_entry_count
from ff_formulas_f fff,
ff_compiled_info_f fci
where fff.formula_id = p_formula_id
and p_effective_date between
fff.effective_start_date and fff.effective_end_date
and fci.formula_id = fff.formula_id
and p_effective_date between
fci.effective_start_date and fci.effective_end_date;
* It is safe to update the global structure because it can't be used
* until the formula information structures are updated.
*/
p_fdiu_info(l_fdiu_row).name := l_fdiu_name(i);
g_fmla_lookups.delete;
g_fmla_info.delete;
g_free_fdiu.delete;
g_fdiu_info.delete;
g_hash_info.delete;
g_dbi_info.delete;
g_ctx_info.delete;
g_route_ctx_sums.delete;
p_inputs.delete; -- must start with empty inputs table.
p_outputs.delete; -- must start with empty outputs table.