Recreating the view (k10v_citem) might improve the response of functions that reference the item master.
This improvement is included in 2.0.13-PATCH_002 and 2.0.14.
For 2.0.13-PATCH_002, 2.0.14 or later versions, there is no need to apply the improvement.
There is no problem updating your version to 2.0.13-PATCH_002, 2.0.14 or later after recreating the view according to this FAQ.
■View to be recreated
k10v_citem
■SQL for recreation
・PostgreSQL
---------------------------------------
create or replace view k10v_citem
as
select
itm_full.company_cd
, itm_full.item_id
, itm_full.locale_id
, itm_full.item_type_cd
, typ.item_type_name
, itm_full.company_item_cd
, itm_full.item_cd
, itm_full.item_name
, itm_full.sort_key
, itm_full.allow_del_flag
, itm_full.delete_flag
, typ.extension_a as type_extension_a
, typ.extension_b as type_extension_b
, typ.extension_c as type_extension_c
, typ.extension_d as type_extension_d
, typ.extension_e as type_extension_e
, typ.extension_f as type_extension_f
, typ.extension_g as type_extension_g
, typ.extension_h as type_extension_h
, typ.extension_i as type_extension_i
, typ.extension_j as type_extension_j
, itm_full.extension_a
, itm_full.extension_b
, itm_full.extension_c
, itm_full.extension_d
, itm_full.extension_e
, itm_full.extension_f
, itm_full.extension_g
, itm_full.extension_h
, itm_full.extension_i
, itm_full.extension_j
, itm_full.entry_ts
, itm_full.entry_user_cd
, itm_full.renew_cnt
, itm_full.renew_ts
, itm_full.renew_user_cd
from (select
itm.company_cd as company_cd
, itm.item_id as item_id
, itm.locale_id as locale_id
, itm.item_type_cd as item_type_cd
, cast(null as varchar(10)) as company_item_cd
, itm.item_cd as item_cd
, itm.item_name as item_name
, itm.sort_key as sort_key
, itm.allow_del_flag as allow_del_flag
, '0' as delete_flag
, itm.extension_a as extension_a
, itm.extension_b as extension_b
, itm.extension_c as extension_c
, itm.extension_d as extension_d
, itm.extension_e as extension_e
, itm.extension_f as extension_f
, itm.extension_g as extension_g
, itm.extension_h as extension_h
, itm.extension_i as extension_i
, itm.extension_j as extension_j
, itm.entry_ts
, itm.entry_user_cd
, itm.renew_cnt
, itm.renew_ts
, itm.renew_user_cd
from ( select
dept.company_cd
, itm.item_id
, itm.item_type_cd
, itm.locale_id
, typ.item_type_name
, itm.item_cd
, itm.item_name
, itm.sort_key
, itm.allow_del_flag
, typ.extension_a type_extension_a
, typ.extension_b type_extension_b
, typ.extension_c type_extension_c
, typ.extension_d type_extension_d
, typ.extension_e type_extension_e
, typ.extension_f type_extension_f
, typ.extension_g type_extension_g
, typ.extension_h type_extension_h
, typ.extension_i type_extension_i
, typ.extension_j type_extension_j
, itm.extension_a
, itm.extension_b
, itm.extension_c
, itm.extension_d
, itm.extension_e
, itm.extension_f
, itm.extension_g
, itm.extension_h
, itm.extension_i
, itm.extension_j
, itm.entry_ts
, itm.entry_user_cd
, itm.renew_cnt
, itm.renew_ts
, itm.renew_user_cd
from (select distinct
w.company_cd
, w.locale_id
from imm_department w
where
w.company_cd = w.department_set_cd
and w.company_cd = w.department_cd
) dept
inner join k10c_item_type typ
on dept.locale_id = typ.locale_id
inner join k10c_item itm
on typ.item_type_cd = itm.item_type_cd
and typ.locale_id = itm.locale_id
) itm
where
not exists (
select '1' from k10c_item_company itm_cmp
where itm.company_cd = itm_cmp.company_cd
and itm.item_id = itm_cmp.item_id
and itm.locale_id = itm_cmp.locale_id
)
union all
select
itm_cmp.company_cd as company_cd
, itm_cmp.item_id as item_id
, itm_cmp.locale_id as locale_id
, itm_cmp.item_type_cd as item_type_cd
, itm_cmp.item_cd as company_item_cd
, itm_cmp.item_cd as item_cd
, itm_cmp.item_name as item_name
, itm_cmp.sort_key as sort_key
, itm.allow_del_flag as allow_del_flag
, itm_cmp.delete_flag as delete_flag
, coalesce(itm_cmp.extension_a, itm.extension_a) as extension_a
, coalesce(itm_cmp.extension_b, itm.extension_b) as extension_b
, coalesce(itm_cmp.extension_c, itm.extension_c) as extension_c
, coalesce(itm_cmp.extension_d, itm.extension_d) as extension_d
, coalesce(itm_cmp.extension_e, itm.extension_e) as extension_e
, coalesce(itm_cmp.extension_f, itm.extension_f) as extension_f
, coalesce(itm_cmp.extension_g, itm.extension_g) as extension_g
, coalesce(itm_cmp.extension_h, itm.extension_h) as extension_h
, coalesce(itm_cmp.extension_i, itm.extension_i) as extension_i
, coalesce(itm_cmp.extension_j, itm.extension_j) as extension_j
, itm_cmp.entry_ts
, itm_cmp.entry_user_cd
, itm_cmp.renew_cnt
, itm_cmp.renew_ts
, itm_cmp.renew_user_cd
from k10c_item_company itm_cmp
left join k10c_item itm
on itm_cmp.item_id = itm.item_id
and itm_cmp.locale_id = itm.locale_id
) itm_full
left outer join k10c_item_type typ
on itm_full.item_type_cd = typ.item_type_cd
and itm_full.locale_id = typ.locale_id
;
---------------------------------------
・Oracle Database
---------------------------------------
create or replace view k10v_citem
as
select
itm_full.company_cd
, itm_full.item_id
, itm_full.locale_id
, itm_full.item_type_cd
, typ.item_type_name
, itm_full.company_item_cd
, itm_full.item_cd
, itm_full.item_name
, itm_full.sort_key
, itm_full.allow_del_flag
, itm_full.delete_flag
, typ.extension_a as type_extension_a
, typ.extension_b as type_extension_b
, typ.extension_c as type_extension_c
, typ.extension_d as type_extension_d
, typ.extension_e as type_extension_e
, typ.extension_f as type_extension_f
, typ.extension_g as type_extension_g
, typ.extension_h as type_extension_h
, typ.extension_i as type_extension_i
, typ.extension_j as type_extension_j
, itm_full.extension_a
, itm_full.extension_b
, itm_full.extension_c
, itm_full.extension_d
, itm_full.extension_e
, itm_full.extension_f
, itm_full.extension_g
, itm_full.extension_h
, itm_full.extension_i
, itm_full.extension_j
, itm_full.entry_ts
, itm_full.entry_user_cd
, itm_full.renew_cnt
, itm_full.renew_ts
, itm_full.renew_user_cd
from (select
itm.company_cd as company_cd
, itm.item_id as item_id
, itm.locale_id as locale_id
, itm.item_type_cd as item_type_cd
, cast(null as varchar2(10)) as company_item_cd
, itm.item_cd as item_cd
, itm.item_name as item_name
, itm.sort_key as sort_key
, itm.allow_del_flag as allow_del_flag
, '0' as delete_flag
, itm.extension_a as extension_a
, itm.extension_b as extension_b
, itm.extension_c as extension_c
, itm.extension_d as extension_d
, itm.extension_e as extension_e
, itm.extension_f as extension_f
, itm.extension_g as extension_g
, itm.extension_h as extension_h
, itm.extension_i as extension_i
, itm.extension_j as extension_j
, itm.entry_ts
, itm.entry_user_cd
, itm.renew_cnt
, itm.renew_ts
, itm.renew_user_cd
from ( select
dept.company_cd
, itm.item_id
, itm.item_type_cd
, itm.locale_id
, typ.item_type_name
, itm.item_cd
, itm.item_name
, itm.sort_key
, itm.allow_del_flag
, typ.extension_a type_extension_a
, typ.extension_b type_extension_b
, typ.extension_c type_extension_c
, typ.extension_d type_extension_d
, typ.extension_e type_extension_e
, typ.extension_f type_extension_f
, typ.extension_g type_extension_g
, typ.extension_h type_extension_h
, typ.extension_i type_extension_i
, typ.extension_j type_extension_j
, itm.extension_a
, itm.extension_b
, itm.extension_c
, itm.extension_d
, itm.extension_e
, itm.extension_f
, itm.extension_g
, itm.extension_h
, itm.extension_i
, itm.extension_j
, itm.entry_ts
, itm.entry_user_cd
, itm.renew_cnt
, itm.renew_ts
, itm.renew_user_cd
from (select distinct
w.company_cd
, w.locale_id
from imm_department w
where
w.company_cd = w.department_set_cd
and w.company_cd = w.department_cd
) dept
inner join k10c_item_type typ
on dept.locale_id = typ.locale_id
inner join k10c_item itm
on typ.item_type_cd = itm.item_type_cd
and typ.locale_id = itm.locale_id
) itm
where
not exists (
select '1' from k10c_item_company itm_cmp
where itm.company_cd = itm_cmp.company_cd
and itm.item_id = itm_cmp.item_id
and itm.locale_id = itm_cmp.locale_id
)
union all
select
itm_cmp.company_cd as company_cd
, itm_cmp.item_id as item_id
, itm_cmp.locale_id as locale_id
, itm_cmp.item_type_cd as item_type_cd
, itm_cmp.item_cd as company_item_cd
, itm_cmp.item_cd as item_cd
, itm_cmp.item_name as item_name
, itm_cmp.sort_key as sort_key
, itm.allow_del_flag as allow_del_flag
, itm_cmp.delete_flag as delete_flag
, coalesce(itm_cmp.extension_a, itm.extension_a) as extension_a
, coalesce(itm_cmp.extension_b, itm.extension_b) as extension_b
, coalesce(itm_cmp.extension_c, itm.extension_c) as extension_c
, coalesce(itm_cmp.extension_d, itm.extension_d) as extension_d
, coalesce(itm_cmp.extension_e, itm.extension_e) as extension_e
, coalesce(itm_cmp.extension_f, itm.extension_f) as extension_f
, coalesce(itm_cmp.extension_g, itm.extension_g) as extension_g
, coalesce(itm_cmp.extension_h, itm.extension_h) as extension_h
, coalesce(itm_cmp.extension_i, itm.extension_i) as extension_i
, coalesce(itm_cmp.extension_j, itm.extension_j) as extension_j
, itm_cmp.entry_ts
, itm_cmp.entry_user_cd
, itm_cmp.renew_cnt
, itm_cmp.renew_ts
, itm_cmp.renew_user_cd
from k10c_item_company itm_cmp
left join k10c_item itm
on itm_cmp.item_id = itm.item_id
and itm_cmp.locale_id = itm.locale_id
) itm_full
left outer join k10c_item_type typ
on itm_full.item_type_cd = typ.item_type_cd
and itm_full.locale_id = typ.locale_id
;
---------------------------------------
・Microsoft SQL Server
---------------------------------------
drop view k10v_citem;
create view k10v_citem
as
select
itm_full.company_cd
, itm_full.item_id
, itm_full.locale_id
, itm_full.item_type_cd
, typ.item_type_name
, itm_full.company_item_cd
, itm_full.item_cd
, itm_full.item_name
, itm_full.sort_key
, itm_full.allow_del_flag
, itm_full.delete_flag
, typ.extension_a as type_extension_a
, typ.extension_b as type_extension_b
, typ.extension_c as type_extension_c
, typ.extension_d as type_extension_d
, typ.extension_e as type_extension_e
, typ.extension_f as type_extension_f
, typ.extension_g as type_extension_g
, typ.extension_h as type_extension_h
, typ.extension_i as type_extension_i
, typ.extension_j as type_extension_j
, itm_full.extension_a
, itm_full.extension_b
, itm_full.extension_c
, itm_full.extension_d
, itm_full.extension_e
, itm_full.extension_f
, itm_full.extension_g
, itm_full.extension_h
, itm_full.extension_i
, itm_full.extension_j
, itm_full.entry_ts
, itm_full.entry_user_cd
, itm_full.renew_cnt
, itm_full.renew_ts
, itm_full.renew_user_cd
from (select
itm.company_cd as company_cd
, itm.item_id as item_id
, itm.locale_id as locale_id
, itm.item_type_cd as item_type_cd
, cast(null as nvarchar(10)) as company_item_cd
, itm.item_cd as item_cd
, itm.item_name as item_name
, itm.sort_key as sort_key
, itm.allow_del_flag as allow_del_flag
, '0' as delete_flag
, itm.extension_a as extension_a
, itm.extension_b as extension_b
, itm.extension_c as extension_c
, itm.extension_d as extension_d
, itm.extension_e as extension_e
, itm.extension_f as extension_f
, itm.extension_g as extension_g
, itm.extension_h as extension_h
, itm.extension_i as extension_i
, itm.extension_j as extension_j
, itm.entry_ts
, itm.entry_user_cd
, itm.renew_cnt
, itm.renew_ts
, itm.renew_user_cd
from ( select
dept.company_cd
, itm.item_id
, itm.item_type_cd
, itm.locale_id
, typ.item_type_name
, itm.item_cd
, itm.item_name
, itm.sort_key
, itm.allow_del_flag
, typ.extension_a type_extension_a
, typ.extension_b type_extension_b
, typ.extension_c type_extension_c
, typ.extension_d type_extension_d
, typ.extension_e type_extension_e
, typ.extension_f type_extension_f
, typ.extension_g type_extension_g
, typ.extension_h type_extension_h
, typ.extension_i type_extension_i
, typ.extension_j type_extension_j
, itm.extension_a
, itm.extension_b
, itm.extension_c
, itm.extension_d
, itm.extension_e
, itm.extension_f
, itm.extension_g
, itm.extension_h
, itm.extension_i
, itm.extension_j
, itm.entry_ts
, itm.entry_user_cd
, itm.renew_cnt
, itm.renew_ts
, itm.renew_user_cd
from (select distinct
w.company_cd
, w.locale_id
from imm_department w
where
w.company_cd = w.department_set_cd
and w.company_cd = w.department_cd
) dept
inner join k10c_item_type typ
on dept.locale_id = typ.locale_id
inner join k10c_item itm
on typ.item_type_cd = itm.item_type_cd
and typ.locale_id = itm.locale_id
) itm
where
not exists (
select '1' from k10c_item_company itm_cmp
where itm.company_cd = itm_cmp.company_cd
and itm.item_id = itm_cmp.item_id
and itm.locale_id = itm_cmp.locale_id
)
union all
select
itm_cmp.company_cd as company_cd
, itm_cmp.item_id as item_id
, itm_cmp.locale_id as locale_id
, itm_cmp.item_type_cd as item_type_cd
, itm_cmp.item_cd as company_item_cd
, itm_cmp.item_cd as item_cd
, itm_cmp.item_name as item_name
, itm_cmp.sort_key as sort_key
, itm.allow_del_flag as allow_del_flag
, itm_cmp.delete_flag as delete_flag
, coalesce(itm_cmp.extension_a, itm.extension_a) as extension_a
, coalesce(itm_cmp.extension_b, itm.extension_b) as extension_b
, coalesce(itm_cmp.extension_c, itm.extension_c) as extension_c
, coalesce(itm_cmp.extension_d, itm.extension_d) as extension_d
, coalesce(itm_cmp.extension_e, itm.extension_e) as extension_e
, coalesce(itm_cmp.extension_f, itm.extension_f) as extension_f
, coalesce(itm_cmp.extension_g, itm.extension_g) as extension_g
, coalesce(itm_cmp.extension_h, itm.extension_h) as extension_h
, coalesce(itm_cmp.extension_i, itm.extension_i) as extension_i
, coalesce(itm_cmp.extension_j, itm.extension_j) as extension_j
, itm_cmp.entry_ts
, itm_cmp.entry_user_cd
, itm_cmp.renew_cnt
, itm_cmp.renew_ts
, itm_cmp.renew_user_cd
from k10c_item_company itm_cmp
left join k10c_item itm
on itm_cmp.item_id = itm.item_id
and itm_cmp.locale_id = itm.locale_id
) itm_full
left outer join k10c_item_type typ
on itm_full.item_type_cd = typ.item_type_cd
and itm_full.locale_id = typ.locale_id
;
---------------------------------------
-- Target ----------------------------------------------------------------------
iAP/Accel Applications/Accel Kaiden! Platform module/2.0.0 to 2.0.12, 2.0.13, 2.0.13-PATCH_001
--------------------------------------------------------------------------------
FAQID:1269