[Home] [Help]
The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT count(*)
FROM amv_matching_queue_tbl;
Select
content_type_id,
application_id,
status_code status,
expiration_date
From jtf_amv_items_b
Where item_id = p_item_id;
Select 1
From jtf_amv_item_authors
Where item_id = p_item_id;
Select 1
From jtf_amv_item_keywords
Where item_id = p_item_id;
Select 1
From amv_i_item_perspectives
Where item_id = p_item_id;
'Select ' ||
'c.channel_id, ' ||
'c.match_on_author_flag, ' ||
'c.match_on_keyword_flag, ' ||
'c.match_on_perspective_flag, ' ||
'c.match_on_content_type_flag, ' ||
'c.match_on_item_type_flag ' ||
'From amv_c_channels_b c ';
'select 1 ' ||
'from amv_c_chl_item_match match ' ||
'where match.channel_id = c.channel_id ' ||
'and match.item_id = :item_id ' ||
'and match.table_name_code = '''||G_MATCH_ITEM_TABLE || ''') ';
Select
c.match_on_all_criteria_flag,
c.match_on_author_flag,
c.match_on_keyword_flag,
c.match_on_perspective_flag,
c.match_on_content_type_flag,
c.match_on_item_type_flag,
c.application_id,
c.access_level_type,
c.channel_type,
c.status,
c.expiration_date
From amv_c_channels_b c
Where c.channel_id = p_channel_id;
'Select ' ||
'item.item_id ' ||
'From jtf_amv_items_b item, amv_c_channels_b chan ';
'select 1 ' ||
'from amv_c_chl_item_match match ' ||
'where match.channel_id = chan.channel_id ' ||
'and match.item_id = item.item_id ' ||
'and table_name_code = ''' || G_MATCH_ITEM_TABLE
|| ''' ) ';
'And exists (select 1 from amv_c_authors ca, jtf_amv_item_authors ia '||
'where ca.channel_id = chan.channel_id ' ||
'and ia.item_id = item.item_id ' ||
'and ca.author = ia.author) ';
'And exists (select 1 from amv_c_keywords ck, ' ||
' jtf_amv_item_keywords ik ' ||
'where ck.channel_id = chan.channel_id ' ||
'and ik.item_id = item.item_id ' ||
'and ck.keyword = ik.keyword) ';
'And exists (select 1 from amv_c_chl_perspectives cp, ' ||
'amv_i_item_perspectives ip ' ||
'where cp.channel_id = chan.channel_id ' ||
'and ip.item_id = item.item_id ' ||
'and cp.perspective_id = ip.perspective_id) ';
'And exists (select 1 from amv_c_content_types cc ' ||
'where cc.channel_id = chan.channel_id ' ||
'and cc.content_type_id = item.content_type_id) ';
'And exists (select 1 from amv_c_item_types ci ' ||
'where ci.channel_id = chan.channel_id ' ||
'and ci.item_type = item.item_type) ';
Select
approval_status_type
From amv_c_chl_item_match
Where item_id = p_item_id
And channel_id = p_channel_id
And table_name_code = G_MATCH_ITEM_TABLE;
Select
content_type_id,
item_type
From jtf_amv_items_b
where item_id = p_item_id;
Select object_version_number
From amv_c_content_types
Where channel_id = p_channel_id
And content_type_id = p_content_type_id;
Select object_version_number
From amv_c_item_types
Where channel_id = p_channel_id
And item_type = l_item_type;
Select c.object_version_number
From amv_c_authors c, jtf_amv_item_authors i
Where c.channel_id = p_channel_id
And i.item_id = p_item_id
And i.author = c.author;
Select c.object_version_number
From amv_c_keywords c, jtf_amv_item_keywords i
Where c.channel_id = p_channel_id
And i.item_id = p_item_id
And i.keyword = c.keyword;
Select c.object_version_number
From amv_c_chl_perspectives c, amv_i_item_perspectives i
Where c.channel_id = p_channel_id
And i.item_id = p_item_id
And i.perspective_id = c.perspective_id;
l_sql_statement := 'Select 1 ' ||
'From jtf_amv_items_b item, amv_c_channels_b chan ';
'And exists (select 1 from amv_c_authors ca, ' ||
' jtf_amv_item_authors ia ' ||
'where ca.channel_id = chan.channel_id ' ||
'and ia.item_id = item.item_id ' ||
'and ca.author = ia.author) ';
'And exists (select 1 from amv_c_keywords ck, ' ||
' jtf_amv_item_keywords ik ' ||
'where ck.channel_id = chan.channel_id ' ||
'and ik.item_id = item.item_id ' ||
'and ck.keyword = ik.keyword) ';
'And exists (select 1 from amv_c_chl_perspectives cp, ' ||
'amv_i_item_perspectives ip ' ||
'where cp.channel_id = chan.channel_id ' ||
'and ip.item_id = item.item_id ' ||
'and cp.perspective_id = ip.perspective_id) ';
'And exists (select 1 from amv_c_content_types cc ' ||
'where cc.channel_id = chan.channel_id ' ||
'and cc.content_type_id = item.content_type_id) ';
'And exists (select 1 from amv_c_item_types ci ' ||
'where ci.channel_id = chan.channel_id ' ||
'and ci.item_type = item.item_type) ';
Select CHANNEL_ITEM_ID
From AMV_C_CHL_ITEM_MATCH
Where TABLE_NAME_CODE = p_table_name_code
And ITEM_ID = p_item_id
And CHANNEL_ID = p_channel_id
;
select u.user_name,
r.resource_id
From amv_rs_all_res_extns_vl r
, fnd_user u
where r.resource_id = res_id
and u.user_id = r.user_id;
select
pub_need_approval_flag,
channel_category_id,
AMV_C_CHL_ITEM_MATCH_S.nextval,
sysdate
from amv_c_channels_b
Where channel_id = p_channel_id;
select
AMV_C_CHL_ITEM_MATCH_S.nextval,
sysdate
from dual;
select owner_id
from jtf_amv_items_b
where item_id = p_item_id;
Insert Into AMV_C_CHL_ITEM_MATCH
(
CHANNEL_ITEM_ID,
OBJECT_VERSION_NUMBER,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
CREATION_DATE,
CREATED_BY,
LAST_UPDATE_LOGIN,
CHANNEL_ID,
ITEM_ID,
TABLE_NAME_CODE,
CHANNEL_CATEGORY_ID,
APPLICATION_ID,
APPROVAL_STATUS_TYPE,
APPROVAL_DATE,
AVAILABLE_DUE_TO_TYPE,
AVAILABLE_FOR_CHANNEL_DATE
)
VALUES
(
l_match_id,
1,
l_current_date,
l_current_user_id,
l_current_date,
l_current_user_id,
l_current_login_id,
p_channel_id,
p_item_id,
p_table_name_code,
l_channel_category_id,
p_application_id,
l_approval_flag,
l_current_date,
p_match_type,
l_current_date
);
Insert Into AMV_C_CHL_ITEM_MATCH
(
CHANNEL_ITEM_ID,
OBJECT_VERSION_NUMBER,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
CREATION_DATE,
CREATED_BY,
LAST_UPDATE_LOGIN,
CHANNEL_ID,
ITEM_ID,
TABLE_NAME_CODE,
CHANNEL_CATEGORY_ID,
APPLICATION_ID,
APPROVAL_STATUS_TYPE,
AVAILABLE_DUE_TO_TYPE,
AVAILABLE_FOR_CHANNEL_DATE
)
VALUES
(
l_match_id,
1,
l_current_date,
l_current_user_id,
l_current_date,
l_current_user_id,
l_current_login_id,
null,
p_item_id,
p_table_name_code,
p_category_id,
p_application_id,
AMV_UTILITY_PVT.G_APPROVED,
p_match_type,
l_current_date
);
SELECT item_id
FROM amv_c_chl_item_match
WHERE table_name_code = cv_table_name_code
AND item_id = cv_item_id
AND territory_id = cv_territory_id
AND channel_id IS NULL
AND channel_category_id IS NULL;
SELECT item_id
FROM amv_c_chl_item_match
WHERE table_name_code = cv_table_name_code
AND item_id = cv_item_id
AND channel_category_id = cv_category_id
AND channel_id IS NULL;
Select CHANNEL_ITEM_ID
From AMV_C_CHL_ITEM_MATCH
Where TABLE_NAME_CODE = p_table_name_code
And ITEM_ID = p_item_id
And CHANNEL_ID = p_channel_id
;
select u.user_name,
r.resource_id
From amv_rs_all_res_extns_vl r
, fnd_user u
where r.resource_id = res_id
and u.user_id = r.user_id;
select
pub_need_approval_flag,
channel_category_id,
AMV_C_CHL_ITEM_MATCH_S.nextval,
sysdate
from amv_c_channels_b
Where channel_id = p_channel_id;
select
AMV_C_CHL_ITEM_MATCH_S.nextval,
sysdate
from dual;
INSERT INTO AMV_C_CHL_ITEM_MATCH
(CHANNEL_ITEM_ID
,OBJECT_VERSION_NUMBER
,LAST_UPDATE_DATE
,LAST_UPDATED_BY
,CREATION_DATE
,CREATED_BY
,LAST_UPDATE_LOGIN
,CHANNEL_ID
,ITEM_ID
,TABLE_NAME_CODE
,CHANNEL_CATEGORY_ID
,APPLICATION_ID
,APPROVAL_STATUS_TYPE
,AVAILABLE_DUE_TO_TYPE
,AVAILABLE_FOR_CHANNEL_DATE
,TERRITORY_ID
)
VALUES
(l_match_id -- CHANNEL_ITEM_ID
,1 -- OBJECT_VERSION_NUMBER
,l_current_date -- LAST_UPDATE_DATE
,l_current_user_id -- LAST_UPDATED_BY
,l_current_date -- CREATION_DATE
,l_current_user_id -- CREATION_BY
,l_current_login_id -- LAST_UPDATE_LOGIN
,NULL -- CHANNEL_ID
,p_item_id -- ITEM_ID
,p_table_name_code -- TABLE_NAME_CODE
,NULL -- CHANNEL_CATEGORY_ID
,p_application_id -- APPLICATION_ID
,AMV_UTILITY_PVT.G_APPROVED -- APPROVAL_STATUS_TYPE
,p_match_type -- AVAILABLE_DUE_TO_TYPE
,l_current_date -- AVAILABLE_FOR_CHANNEL_DATE
,p_territory_tbl(l_rec_count) -- TERRITORY_ID
);
Insert Into AMV_C_CHL_ITEM_MATCH
(
CHANNEL_ITEM_ID,
OBJECT_VERSION_NUMBER,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
CREATION_DATE,
CREATED_BY,
LAST_UPDATE_LOGIN,
CHANNEL_ID,
ITEM_ID,
TABLE_NAME_CODE,
CHANNEL_CATEGORY_ID,
APPLICATION_ID,
APPROVAL_STATUS_TYPE,
APPROVAL_DATE,
AVAILABLE_DUE_TO_TYPE,
AVAILABLE_FOR_CHANNEL_DATE
)
VALUES
(
l_match_id,
1,
l_current_date,
l_current_user_id,
l_current_date,
l_current_user_id,
l_current_login_id,
p_channel_id,
p_item_id,
p_table_name_code,
l_channel_category_id,
p_application_id,
l_approval_flag,
l_current_date,
p_match_type,
l_current_date
);
Insert Into AMV_C_CHL_ITEM_MATCH
(
CHANNEL_ITEM_ID,
OBJECT_VERSION_NUMBER,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
CREATION_DATE,
CREATED_BY,
LAST_UPDATE_LOGIN,
CHANNEL_ID,
ITEM_ID,
TABLE_NAME_CODE,
CHANNEL_CATEGORY_ID,
APPLICATION_ID,
APPROVAL_STATUS_TYPE,
AVAILABLE_DUE_TO_TYPE,
AVAILABLE_FOR_CHANNEL_DATE
)
VALUES
(
l_match_id,
1,
l_current_date,
l_current_user_id,
l_current_date,
l_current_user_id,
l_current_login_id,
null,
p_item_id,
p_table_name_code,
p_category_id,
p_application_id,
AMV_UTILITY_PVT.G_APPROVED,
p_match_type,
l_current_date
);
select
u.user_name,
c.owner_user_id
From fnd_user u, jtf_rs_resource_extns r, amv_c_channels_b c
Where c.channel_id = p_id
And r.resource_id = c.owner_user_id
And r.user_id = u.user_id
;
select
pub_need_approval_flag,
channel_category_id,
AMV_C_CHL_ITEM_MATCH_S.nextval,
sysdate
from amv_c_channels_b
Where channel_id = p_channel_id;
select
AMV_C_CHL_ITEM_MATCH_S.nextval,
sysdate
from dual;
DELETE FROM amv_c_chl_item_match
WHERE territory_id = p_territory_id
AND item_id = p_item_id
AND table_name_code = p_table_name_code
AND channel_id IS NULL
AND channel_category_id IS NULL;
-- delete from channel
DELETE FROM amv_c_chl_item_match
WHERE channel_id = p_channel_id
AND item_id = p_item_id
AND table_name_code = p_table_name_code;
ELSE -- delete the item to category match.
--check category id
IF (AMV_UTILITY_PVT.Is_CategoryIdValid(p_category_id) <> TRUE) THEN
IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
FND_MESSAGE.Set_name('AMV','AMV_INVALID_CATEGORY_ID');
DELETE FROM amv_c_chl_item_match
WHERE channel_category_id = p_category_id
AND item_id = p_item_id
AND table_name_code = p_table_name_code
AND channel_id is null;
SELECT DISTINCT
RSC.terr_id
,TERR.name
FROM jtf_terr_rsc_all RSC
,jtf_terr_srch_adv_gen_v TERR
WHERE RSC.terr_id = TERR.terr_id
AND RSC.resource_id = p_resource_id
AND RSC.resource_type = p_resource_type;
SELECT DISTINCT
item_id
FROM amv_c_chl_item_match
WHERE territory_id = p_terr_id
AND channel_id IS NULL
AND channel_category_id IS NULL
AND table_name_code = p_table_name_code;