The following lines contain the word 'select', 'insert', 'update' or 'delete':
select
art.org_id,
art.article_id,
artv.article_version_id,
artv.article_status,
artv.adoption_type,
artv.global_yn,
'AP-'||
to_char(art.org_id)||'.'||
to_char(art.article_id)||'.'||
to_char(artv.article_version_id)||'.'||
to_char(artv.object_version_number) ikey,
substr(nvl(art.article_number, art.article_title),0,240) ukey,
artv.object_version_number+1,
art.article_title,
artv.article_version_number
from
okc_articles_all art,
okc_article_versions artv
where art.article_id = artv.article_id
and art.standard_yn = 'Y'
and artv.article_status in ('DRAFT','REJECTED')
and art.org_id = cp_org_id
and artv.article_version_id = cp_version_id
and greatest(nvl(trunc(end_date), trunc(sysdate))+1, trunc(sysdate)) <> trunc(sysdate); -- bug#3517002
for update of
artv.article_status,
artv.object_version_number,
artv.last_update_date,
artv.last_updated_by
nowait;
select
arta.local_org_id,
art.article_id,
arta.global_article_version_id,
arta.adoption_status,
arta.adoption_type,
artv.global_yn,
'AD-'||
to_char(arta.local_org_id)||'.'||
to_char(art.article_id)||'.'||
to_char(artv.article_version_id)||'.'||
to_char(arta.object_version_number) ikey,
substr(nvl(art.article_number,art.article_title),0,240) ukey,
arta.object_version_number+1,
art.article_title,
artv.article_version_number
from
okc_articles_all art,
okc_article_versions artv,
okc_article_adoptions arta
where art.article_id = artv.article_id
and art.standard_yn = 'Y'
and artv.global_yn = 'Y'
and arta.adoption_type = 'AVAILABLE'
and (arta.adoption_status = 'REJECTED' or arta.adoption_status is null)
and arta.local_org_id = cp_org_id
and artv.article_version_id = cp_version_id
and arta.global_article_version_id = artv.article_version_id
and artv.article_status = 'APPROVED'
and sysdate <= nvl(artv.end_date,sysdate+1)
and not exists
(
select 1
from okc_article_adoptions
where global_article_version_id in
(select article_version_id
from okc_article_versions
where article_id = art.article_id)
and local_org_id = arta.local_org_id
and adoption_type = 'LOCALIZED'
union
select 1
from okc_article_adoptions
where global_article_version_id in
(select article_version_id
from okc_article_versions
where article_id = art.article_id)
and local_org_id = arta.local_org_id
and adoption_type = 'ADOPTED'
and article_version_number > artv.article_version_number
);
for update of
arta.adoption_type,
arta.adoption_status,
arta.object_version_number,
arta.last_update_date,
arta.last_updated_by
nowait;
select nvl(display_name, name)
from wf_users
where name = nvl(id, 'WFADMIN');
select
art.org_id,
art.article_id,
artv.article_version_id,
artv.article_status,
artv.adoption_type,
artv.global_yn,
'AI-'||
to_char(art.org_id)||'.'||
to_char(art.article_id)||'.'||
to_char(artv.article_version_id)||'.'||
to_char(artv.object_version_number) ikey,
substr(nvl(art.article_number,art.article_title),0,240) ukey,
artv.object_version_number
from
okc_articles_all art,
okc_article_versions artv,
okc_art_interface_all int
where art.article_id = artv.article_id
and art.standard_yn = 'Y'
and artv.article_status in ('PENDING_APPROVAL','APPROVED')
and art.article_title = int.article_title
and int.process_status in ('W', 'S') -- this process status tells
-- that the article has been imported
and int.request_id = c_req_id -- in order to find articles imported
-- in this process only
and int.batch_number = c_batch_num -- added for performance
and int.org_id = c_org_id -- added for performance
and int.article_status in ('PENDING_APPROVAL', 'APPROVED')
and artv.article_version_number = int.article_version_number;
select article_intent into art_intent
from okc_articles_all
where article_id = art_id;
select article_intent into art_intent
from okc_articles_all
where article_id = art_id;
select article_intent into art_intent
from okc_articles_all a, okc_article_versions v
where a.article_id = v.article_id
and v.article_version_id = art_ver_id;
select decode(p_art_intent, 'S', org_information2, 'B', org_information6, 'SYSADMIN')
from hr_organization_information
where organization_id = p_org_id
and org_information_context = 'OKC_TERMS_LIBRARY_DETAILS';
select 'Y' into result FROM wf_items_v
where item_type = 'OKCARTAP'
and item_key = p_ikey;
update okc_article_versions
set
article_status = 'PENDING_APPROVAL',
object_version_number = c_tab(write_ptr).ovn,
last_update_date = sysdate,
last_updated_by = fnd_global.user_id
where current of cv;
update okc_article_adoptions
set
adoption_type = 'ADOPTED',
adoption_status = 'PENDING_APPROVAL',
object_version_number = c_tab(write_ptr).ovn,
last_update_date = sysdate,
last_updated_by = fnd_global.user_id
where current of ca;
select
adoption_type,
hr.organization_id,
decode(p_art_intent, 'S', org_information3, 'B', org_information7,
'SYSADMIN') notified
from
okc_article_adoptions arta,
hr_organization_information hri,
hr_organization_units hr
where
global_article_version_id = p_artv_id
and
hri.organization_id = local_org_id
and
hr.organization_id = local_org_id
and
org_information_context = 'OKC_TERMS_LIBRARY_DETAILS';
SELECT user_name
FROM fnd_user
WHERE user_name = notified_usr
AND nvl(end_date, sysdate + 1) > sysdate;
select nvl(display_name, name) into approver_name
from wf_users where name = approver_role;
select
art.article_title,
art.article_number,
artv.article_version_number,
artv.article_description,
tm.meaning type_meaning,
im.meaning intent_meaning,
gm.meaning global_meaning,
pm.meaning provision_meaning,
artv.start_date,
artv.end_date
from
okc_articles_all art,
okc_article_versions artv,
okc_lookups_v tm,
okc_lookups_v im,
okc_lookups_v gm,
okc_lookups_v pm
where art.standard_yn = 'Y'
and art.org_id = cp_org_id
and article_version_id = cp_art_ver_id
and art.article_id = artv.article_id
and tm.lookup_type ='OKC_SUBJECT'
and im.lookup_type ='OKC_ARTICLE_INTENT'
and gm.lookup_type ='OKC_YN'
and pm.lookup_type ='OKC_YN'
and tm.lookup_code = art.article_type
and im.lookup_code = art.article_intent
and gm.lookup_code = artv.global_yn
and pm.lookup_code = artv.provision_yn;
select
art.article_title,
art.article_number,
artv.article_version_number,
artv.article_description,
tm.meaning type_meaning,
im.meaning intent_meaning,
gm.meaning global_meaning,
pm.meaning provision_meaning,
artv.start_date,
artv.end_date
from
okc_articles_all art,
okc_article_versions artv,
okc_article_adoptions arta,
okc_lookups_v tm,
okc_lookups_v im,
okc_lookups_v gm,
okc_lookups_v pm
where art.standard_yn = 'Y'
and artv.global_yn = 'Y'
and arta.local_org_id = cp_org_id
and article_version_id = cp_art_ver_id
and art.article_id = artv.article_id
and artv.article_version_id = arta.global_article_version_id
and tm.lookup_type ='OKC_SUBJECT'
and im.lookup_type ='OKC_ARTICLE_INTENT'
and gm.lookup_type ='OKC_YN'
and pm.lookup_type ='OKC_YN'
and tm.lookup_code = art.article_type
and im.lookup_code = art.article_intent
and gm.lookup_code = artv.global_yn
and pm.lookup_code = artv.provision_yn;
select meaning from okc_lookups_v
where lookup_type = 'OKC_ARTICLE_STATUS'
and lookup_code = 'PENDING_APPROVAL';
select meaning from okc_lookups_v
where lookup_type = 'OKC_ARTICLE_ADOPTION_TYPE'
and lookup_code = 'ADOPTED';
procedure selector( itemtype in varchar2,
itemkey in varchar2,
actid in number,
command in varchar2,
resultout in out nocopy varchar2)
is
l_current_org_id number;
WF_CORE.CONTEXT ('OKC_ARTWF_PVT', 'selector', itemtype,
itemkey, to_char(actid), command);
procedure select_process( itemtype in varchar2,
itemkey in varchar2,
actid in number,
command in varchar2,
resultout in out nocopy varchar2)
is
adoption_type okc_article_adoptions.adoption_type%type;
WF_CORE.CONTEXT ('OKC_ARTWF_PVT', 'select_process', itemtype,
itemkey, to_char(actid), command);
select user_name
from fnd_user_view
where user_id = fnd_global.user_id;
select 'Y' into result
from okc_articles_local_v
where org_id = p_org_id
and article_version_id = p_article_version_id;
select 'Y' into result
from (
select 'Y'
from
okc_articles_all art,
okc_article_versions artv
where art.standard_yn = 'Y'
and art.article_id = artv.article_id
and artv.article_version_id = p_article_version_id
and art.org_id = p_org_id
union all
select 'Y'
from
okc_articles_all art,
okc_article_versions artv,
okc_article_adoptions arta
where art.standard_yn = 'Y'
and artv.global_yn = 'Y'
and art.article_id = artv.article_id
and artv.article_version_id = arta.global_article_version_id
and artv.article_version_id = p_article_version_id
and arta.local_org_id = p_org_id
and arta.local_article_version_id is null
)
where rownum <= 1;
select 'Y' into result
from okc_articles_local_v
where org_id = p_org_id
and article_version_id = p_article_version_id
and article_status is null;
select 'Y' into result
from (
select
decode(artv.article_status, 'APPROVED', decode(greatest(nvl(trunc(end_date),
trunc(sysdate))+1, trunc(sysdate)), trunc(sysdate), 'EXPIRED', artv.article_status),
artv.article_status) article_status
from
okc_articles_all art,
okc_article_versions artv
where art.standard_yn = 'Y'
and art.article_id = artv.article_id
and artv.article_version_id = p_article_version_id
and art.org_id = p_org_id
union all
select
decode(arta.adoption_type, 'AVAILABLE', decode( decode(greatest(nvl(trunc(end_date),
trunc(sysdate))+1, trunc(sysdate)), trunc(sysdate), 'EXPIRED', artv.article_status),
'APPROVED', arta.adoption_status, 'EXPIRED', 'EXPIRED', 'ON_HOLD', 'ON_HOLD', 'REJECTED',
'REJECTED' ), 'ADOPTED', decode( decode(arta.adoption_status, 'PENDING_APPROVAL', 'PENDING_APPROVAL',
decode(greatest(nvl(trunc(end_date), trunc(sysdate))+1, trunc(sysdate)), trunc(sysdate), 'EXPIRED',
artv.article_status) ), 'APPROVED', arta.adoption_status, 'EXPIRED', 'EXPIRED', 'ON_HOLD', 'ON_HOLD',
'PENDING_APPROVAL', 'PENDING_APPROVAL' ) ) article_status
from
okc_articles_all art,
okc_article_versions artv,
okc_article_adoptions arta
where art.standard_yn = 'Y'
and artv.global_yn = 'Y'
and art.article_id = artv.article_id
and artv.article_version_id = arta.global_article_version_id
and artv.article_version_id = p_article_version_id
and arta.local_org_id = p_org_id
and arta.local_article_version_id is null
) a
where rownum <= 1
and article_status is null;
select 'Y' into result
from okc_articles_local_v
where org_id = p_org_id
and article_version_id = p_article_version_id
and article_status = upper(p_article_status);
select 'Y' into result
from (
select
decode(artv.article_status, 'APPROVED', decode(greatest(nvl(trunc(end_date),
trunc(sysdate))+1, trunc(sysdate)), trunc(sysdate), 'EXPIRED', artv.article_status),
artv.article_status) article_status
from
okc_articles_all art,
okc_article_versions artv
where art.standard_yn = 'Y'
and art.article_id = artv.article_id
and artv.article_version_id = p_article_version_id
and art.org_id = p_org_id
union all
select
decode(arta.adoption_type, 'AVAILABLE', decode( decode(greatest(nvl(trunc(end_date),
trunc(sysdate))+1, trunc(sysdate)), trunc(sysdate), 'EXPIRED', artv.article_status),
'APPROVED', arta.adoption_status, 'EXPIRED', 'EXPIRED', 'ON_HOLD', 'ON_HOLD', 'REJECTED',
'REJECTED' ), 'ADOPTED', decode( decode(arta.adoption_status, 'PENDING_APPROVAL',
'PENDING_APPROVAL', decode(greatest(nvl(trunc(end_date), trunc(sysdate))+1, trunc(sysdate)),
trunc(sysdate), 'EXPIRED', artv.article_status) ), 'APPROVED', arta.adoption_status, 'EXPIRED',
'EXPIRED', 'ON_HOLD', 'ON_HOLD', 'PENDING_APPROVAL', 'PENDING_APPROVAL' ) ) article_status
from
okc_articles_all art,
okc_article_versions artv,
okc_article_adoptions arta
where art.standard_yn = 'Y'
and artv.global_yn = 'Y'
and art.article_id = artv.article_id
and artv.article_version_id = arta.global_article_version_id
and artv.article_version_id = p_article_version_id
and arta.local_org_id = p_org_id
and arta.local_article_version_id is null
) a
where rownum <= 1
and article_status = upper(p_article_status);
select 'Y' into result
from okc_articles_global_v
where org_id = p_org_id
and article_version_id = p_article_version_id;
select 'Y' into result
from (
select 'Y'
from
okc_articles_all art,
okc_article_versions artv
where
art.standard_yn = 'Y'
and art.article_id = artv.article_id
and org_id = p_org_id
and article_version_id = p_article_version_id
) a
where rownum <= 1;
select 'Y' into result
from okc_articles_global_v
where org_id = p_org_id
and article_version_id = p_article_version_id
and article_status is null;
select 'Y' into result
from (
select
decode(artv.article_status, 'APPROVED', decode(greatest(nvl(trunc(end_date),
trunc(sysdate))+1, trunc(sysdate)), trunc(sysdate), 'EXPIRED', artv.article_status),
artv.article_status) article_status
from
okc_articles_all art,
okc_article_versions artv
where
art.standard_yn = 'Y'
and art.article_id = artv.article_id
and org_id = p_org_id
and article_version_id = p_article_version_id
) a
where rownum <= 1
and article_status is null;
select 'Y' into result
from okc_articles_global_v
where org_id = p_org_id
and article_version_id = p_article_version_id
and article_status = upper(p_article_status);
select 'Y' into result
from (
select
decode(artv.article_status, 'APPROVED', decode(greatest(nvl(trunc(end_date),
trunc(sysdate))+1, trunc(sysdate)), trunc(sysdate), 'EXPIRED', artv.article_status),
artv.article_status) article_status
from
okc_articles_all art,
okc_article_versions artv
where
art.standard_yn = 'Y'
and art.article_id = artv.article_id
and org_id = p_org_id
and article_version_id = p_article_version_id
) a
where article_status = upper(p_article_status);
select name into org_name
from hr_organization_units
where organization_id = p_org_id;
select
otl.name into org_name
from
hr_all_organization_units o,
hr_all_organization_units_tl otl
where
o.organization_id = otl.organization_id
and otl.language = userenv('LANG')
and o.organization_id = p_org_id;
select 'Y' into result
from wf_users
where name = approverS;
select 'Y' into result
from wf_users
where name = approverB;
select 'Y' into result
from wf_users
where name = approverS;
select 'Y' into result
from wf_users
where name = approverB;
select display_name
from wf_users
where name = new_approver;
select context into str
from wf_notifications
where notification_id = nid;
select context into str
from wf_notifications
where notification_id = nid;
select
otl.name into org_name
from
hr_all_organization_units o,
hr_all_organization_units_tl otl
where
o.organization_id = otl.organization_id
and otl.language = userenv('LANG')
and o.organization_id = (
select org_id
from okc_terms_templates_all
where template_id = p_template_id
);
select meaning into intent_meaning
from okc_lookups_v
where lookup_type = 'OKC_TERMS_INTENT'
and lookup_code = (
select intent
from okc_terms_templates_all
where template_id = p_template_id
);
select name
from wf_notification_attributes
where notification_id = nid;
select article_text into text
from okc_article_versions
where article_version_id = (
select global_article_version_id
from okc_article_adoptions
where local_org_id = p_org_id
and local_article_version_id = p_article_version_id
);
select nvl(translated_yn, 'N') into yn
from okc_article_versions
where article_version_id = p_article_version_id;
select 'Y' into yn
from okc_article_adoptions
where local_org_id = p_org_id
and local_article_version_id = p_article_version_id;
select global_article_version_id into id
from okc_article_adoptions
where local_org_id = p_org_id
and local_article_version_id = p_article_version_id;