The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT ams_channels_b_s.NEXTVAL
FROM DUAL;
SELECT COUNT(*)
FROM ams_channels_vl
WHERE channel_id = chan_id;
AMS_Utility_PVT.debug_message(l_full_name ||': insert');
INSERT INTO ams_channels_b(
channel_id,
last_update_date,
last_updated_by,
creation_date,
created_by,
last_update_login,
object_version_number,
channel_type_code,
order_sequence,
managed_by_person_id,
outbound_flag,
inbound_flag,
active_from_date,
active_to_date,
rating,
preferred_vendor_id,
party_id,
attribute_category,
attribute1,
attribute2,
attribute3,
attribute4,
attribute5,
attribute6,
attribute7,
attribute8,
attribute9,
attribute10,
attribute11,
attribute12,
attribute13,
attribute14,
attribute15,
--rrajesh added on 12/07/00
country_id
-- Rahul Sharma removed on 01/18/2001
--internal_resource
--end 12/07/00
)
VALUES(
l_chan_rec.channel_id,
SYSDATE,
FND_GLOBAL.user_id,
SYSDATE,
FND_GLOBAL.user_id,
FND_GLOBAL.conc_login_id,
1, -- object_version_number
l_chan_rec.channel_type_code,
l_chan_rec.order_sequence,
-- no validation for order.This column is for upgrade purposes only
l_chan_rec.managed_by_person_id,
-- added by rrajesh on 12/07/00
--NVL(l_chan_rec.outbound_flag,'Y'),
--NVL(l_chan_rec.inbound_flag,'N'),
NVL(l_chan_rec.outbound_flag,'Y'),
NVL(l_chan_rec.inbound_flag,'Y'),
--end 12/07/00
NVL(l_chan_rec.active_from_date,SYSDATE),
-- no validation for active_for_date .This column is for upgrade purposes only
l_chan_rec.active_to_date,
-- no validation for active_to_date .This column is for upgrade purposes only
l_chan_rec.rating,
l_chan_rec.preferred_vendor_id,
l_chan_rec.party_id,
l_chan_rec.attribute_category,
l_chan_rec.attribute1,
l_chan_rec.attribute2,
l_chan_rec.attribute3,
l_chan_rec.attribute4,
l_chan_rec.attribute5,
l_chan_rec.attribute6,
l_chan_rec.attribute7,
l_chan_rec.attribute8,
l_chan_rec.attribute9,
l_chan_rec.attribute10,
l_chan_rec.attribute11,
l_chan_rec.attribute12,
l_chan_rec.attribute13,
l_chan_rec.attribute14,
l_chan_rec.attribute15,
--added by rrajesh 12/07/00
l_chan_rec.country_id
-- Rahul Sharma removed on 01/18/2001
--l_chan_rec.internal_resource
--end 12/07/00
);
INSERT INTO ams_channels_tl(
channel_id,
language,
last_update_date,
last_updated_by,
creation_date,
created_by,
last_update_login,
source_lang,
channel_name,
description
)
SELECT
l_chan_rec.channel_id,
l.language_code,
SYSDATE,
FND_GLOBAL.user_id,
SYSDATE,
FND_GLOBAL.user_id,
FND_GLOBAL.conc_login_id,
USERENV('LANG'),
l_chan_rec.channel_name,
l_chan_rec.description
FROM fnd_languages l
WHERE l.installed_flag in ('I', 'B')
AND NOT EXISTS(
SELECT NULL
FROM ams_channels_tl t
WHERE t.channel_id = l_chan_rec.channel_id
AND t.language = l.language_code );
PROCEDURE delete_channel(
p_api_version IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.g_false,
p_commit IN VARCHAR2 := FND_API.g_false,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_chan_id IN NUMBER,
p_object_version IN NUMBER
)
IS
l_api_version CONSTANT NUMBER := 1.0;
l_api_name CONSTANT VARCHAR2(30) := 'delete_channel';
SELECT media_id
FROM ams_media_channels
WHERE channel_id = p_chan_id
AND (active_to_date > SYSDATE OR active_to_date IS NULL);
SELECT marketing_medium_id
FROM ams_campaign_schedules_b
WHERE marketing_medium_id = p_chan_id;
SAVEPOINT delete_channel;
AMS_Utility_PVT.debug_message(l_full_name ||': check before delete');
FND_MESSAGE.set_name('AMS', 'AMS_CHAN_CANNOT_DELETE');
AMS_Utility_PVT.debug_message(l_full_name ||': delete');
DELETE FROM ams_channels_b
WHERE channel_id = p_chan_id
AND object_version_number = p_object_version;
DELETE FROM ams_channels_tl
WHERE channel_id = p_chan_id;
ROLLBACK TO delete_channel;
ROLLBACK TO delete_channel;
ROLLBACK TO delete_channel;
END delete_channel;
SELECT channel_id
FROM ams_channels_b
WHERE channel_id = p_chan_id
AND object_version_number = p_object_version
FOR UPDATE NOWAIT;
SELECT channel_id
FROM ams_channels_tl
WHERE channel_id = p_chan_id
AND USERENV('LANG') IN (language, source_lang)
FOR UPDATE NOWAIT;
PROCEDURE update_channel(
p_api_version IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.g_false,
p_commit IN VARCHAR2 := FND_API.g_false,
p_validation_level IN NUMBER := FND_API.g_valid_level_full,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_chan_rec IN chan_rec_type
)
IS
l_api_version CONSTANT NUMBER := 1.0;
l_api_name CONSTANT VARCHAR2(30) := 'update_channel';
SAVEPOINT update_channel;
p_validation_mode => JTF_PLSQL_API.g_update,
x_return_status => l_return_status
);
AMS_Utility_PVT.debug_message(l_full_name ||': update');
UPDATE ams_channels_b SET
last_update_date = SYSDATE,
last_updated_by = FND_GLOBAL.user_id,
last_update_login = FND_GLOBAL.conc_login_id,
object_version_number = l_chan_rec.object_version_number + 1,
channel_type_code = l_chan_rec.channel_type_code,
order_sequence = l_chan_rec.order_sequence,
managed_by_person_id = l_chan_rec.managed_by_person_id,
--rrajesh added 12/07/00
--outbound_flag = NVL(l_chan_rec.outbound_flag,'Y'),
--inbound_flag = NVL(l_chan_rec.inbound_flag,'N'),
outbound_flag = NVL(l_chan_rec.outbound_flag,'Y'),
inbound_flag = NVL(l_chan_rec.inbound_flag,'Y'),
--end 12/07/00
active_from_date = l_chan_rec.active_from_date,
active_to_date = l_chan_rec.active_to_date,
rating = l_chan_rec.rating,
preferred_vendor_id = l_chan_rec.preferred_vendor_id,
party_id = l_chan_rec.party_id,
attribute_category = l_chan_rec.attribute_category,
attribute1 = l_chan_rec.attribute1,
attribute2 = l_chan_rec.attribute2,
attribute3 = l_chan_rec.attribute3,
attribute4 = l_chan_rec.attribute4,
attribute5 = l_chan_rec.attribute5,
attribute6 = l_chan_rec.attribute6,
attribute7 = l_chan_rec.attribute7,
attribute8 = l_chan_rec.attribute8,
attribute9 = l_chan_rec.attribute9,
attribute10 = l_chan_rec.attribute10,
attribute11 = l_chan_rec.attribute11,
attribute12 = l_chan_rec.attribute12,
attribute13 = l_chan_rec.attribute13,
attribute14 = l_chan_rec.attribute14,
attribute15 = l_chan_rec.attribute15,
--rrajesh added 12/07/00
country_id = l_chan_rec.country_id
-- Rahul Sharma removed 01/18/2001
--internal_resource = l_chan_rec.internal_resource
-- end 01/18/2001
--end 12/07/00
WHERE channel_id = l_chan_rec.channel_id
AND object_version_number = l_chan_rec.object_version_number;
update ams_channels_tl set
channel_name = l_chan_rec.channel_name,
description = l_chan_rec.description,
last_update_date = SYSDATE,
last_updated_by = FND_GLOBAL.user_id,
last_update_login = FND_GLOBAL.conc_login_id,
source_lang = USERENV('LANG')
WHERE channel_id = l_chan_rec.channel_id
AND USERENV('LANG') IN (language, source_lang);
ROLLBACK TO update_channel;
ROLLBACK TO update_channel;
ROLLBACK TO update_channel;
END update_channel;
SELECT COUNT(1)
FROM ams_channels_vl
WHERE UPPER(channel_name) = UPPER(p_channel_name) ;*/
SELECT COUNT(1)
FROM ams_channels_vl
WHERE UPPER(channel_name) = UPPER(p_channel_name)
AND country_id = p_country_id;
SELECT COUNT(1)
FROM ams_channels_vl
WHERE UPPER(channel_name) = UPPER(p_channel_name)
AND channel_id <> p_channel_id ;*/
SELECT COUNT(1)
FROM ams_channels_vl
WHERE UPPER(channel_name) = UPPER(p_channel_name)
AND country_id = p_country_id
AND channel_id <> p_channel_id ;
x_chan_rec.last_update_date := FND_API.g_miss_date;
x_chan_rec.last_updated_by := FND_API.g_miss_num;
x_chan_rec.last_update_login := FND_API.g_miss_num;
SELECT *
FROM ams_channels_vl
WHERE channel_id = p_chan_rec.channel_id;
SELECT party_name
FROM hz_parties
WHERE party_id = p_party_id;
SELECT party_number
FROM hz_parties
WHERE party_id = p_party_id;
SELECT party_type
FROM hz_parties
WHERE party_id = p_party_id;
SELECT vendor_name
FROM po_vendors
WHERE vendor_id = p_vendor_id;
SELECT location_area_name
FROM jtf_loc_areas_vl
WHERE location_area_id = p_country_id
AND location_type_code = 'COUNTRY';