The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT DISTINCT application_set_id, time_recipient_id
FROM hxc_application_set_comps_v
ORDER BY application_set_id;
SELECT DISTINCT (application_set_id) a
FROM hxc_application_set_comps_v
WHERE time_recipient_id IN
(SELECT DISTINCT (time_recipient_id)
FROM hxc_application_set_comps_v
WHERE application_set_id =
p_app_set_id)
AND application_set_id NOT IN
(SELECT application_set_id a
FROM hxc_application_set_comps_v
WHERE time_recipient_id NOT IN
(SELECT DISTINCT (time_recipient_id)
FROM hxc_application_set_comps_v
WHERE application_set_id =
p_app_set_id));
SELECT application_set_id a, COUNT (*) cnt
FROM hxc_application_set_comps_v
GROUP BY application_set_id;
SELECT 'Y' status
FROM sys.DUAL
WHERE EXISTS ( SELECT htd.time_building_block_id, htd.time_building_block_ovn
FROM hxc_transaction_details htd,
hxc_transactions ht,
hxc_retrieval_processes hrp
WHERE ht.transaction_id = htd.transaction_id
AND ht.TYPE = 'RETRIEVAL'
AND ht.status = 'SUCCESS'
AND htd.status = 'SUCCESS'
AND ht.transaction_process_id = hrp.retrieval_process_id
AND hrp.time_recipient_id = p_time_rec_id
AND htd.time_building_block_id = p_tbb_id
AND htd.time_building_block_ovn = p_tbb_ovn);
SELECT hta.attribute_category attribute_category, hta.attribute1 attribute1,
hta.attribute2 attribute2, hta.attribute3 attribute3,
hta.attribute4 attribute4, hta.attribute5 attribute5,
hta.attribute6 attribute6, hta.attribute7 attribute7,
hta.attribute8 attribute8, hta.attribute9 attribute9,
hta.attribute10 attribute10, hta.attribute11 attribute11,
hta.attribute12 attribute12, hta.attribute13 attribute13,
hta.attribute14 attribute14, hta.attribute15 attribute15,
hta.attribute16 attribute16, hta.attribute17 attribute17,
hta.attribute18 attribute18, hta.attribute19 attribute19,
hta.attribute20 attribute20, hta.attribute21 attribute21,
hta.attribute22 attribute22, hta.attribute23 attribute23,
hta.attribute24 attribute24, hta.attribute25 attribute25,
hta.attribute26 attribute26, hta.attribute27 attribute27,
hta.attribute28 attribute28, hta.attribute29 attribute29,
hta.attribute30 attribute30,
hta.bld_blk_info_type_id bld_blk_info_type_id,
hbbi.bld_blk_info_type bld_blk_info_type, hta.time_attribute_id
FROM hxc_time_attributes hta,
hxc_time_attribute_usages htau,
hxc_bld_blk_info_types hbbi
WHERE hta.time_attribute_id IN (SELECT hau.time_attribute_id
FROM hxc_time_attribute_usages hau
WHERE hau.time_building_block_id = p_tbb_id
AND hau.time_building_block_ovn =
p_tbb_ovn)
AND htau.time_attribute_id = hta.time_attribute_id
AND hbbi.bld_blk_info_type_id = hta.bld_blk_info_type_id
AND hta.attribute_category NOT LIKE ('SECURITY')
ORDER BY hta.time_attribute_id ;
list_tim_rec_tc.DELETE;
list_tim_rec_day.DELETE;
list_tim_rec_det.DELETE;
list_tim_rec_drops.DELETE;
-- to insert
l_ind_tim_rec_det :=
list_tim_rec_det.LAST
+ 1;
-- to insert
l_ind_tim_rec_day :=
list_tim_rec_day.LAST
+ 1;
-- to insert
l_ind_tim_rec_tc :=
list_tim_rec_tc.LAST
+ 1;
temp_app_set.DELETE;
-- Check flag to delete or not to delete
IF (app_set_ok = 'N')
THEN
temp_app_set.DELETE (l_index_tmp_app);
-- then only update
-- here check that this falls in the temp appl set ids table
app_set_ok := 'N';
ELSE -- update the application set id on the TBB
-- here one more check has to be made for checkin if
-- already some application set id is present or not
-- in which case all time transfer etc needs to be
-- checked, postponing that check for now, will add laterz
-- adding check...
IF(P_TIME_BUILDING_BLOCKS (l_index_det).application_set_id is not null
AND P_TIME_BUILDING_BLOCKS (l_index_det).application_set_id <>
temp_app_set (l_index).application_set_id)
Then
-- Initialize the Temp Time Recipient drops table
-- for SCOPE = 'DETAIL' to null.
--
IF (list_tim_rec_drops.COUNT > 0)
THEN
list_tim_rec_drops.DELETE;
temp_app_set_drops.DELETE;
--Check flag to delete or not to delete
IF (app_set_ok = 'N')
THEN
temp_app_set_drops.DELETE (l_index_tmp_app);
-- and now finally update the Appl SET id in the DETAIL SCOPE... :-)
if(l_null_application_set_id = 'N')
then
P_TIME_BUILDING_BLOCKS (l_index_det).application_set_id :=
temp_app_set (l_index).application_set_id;
list_tim_rec_day.DELETE;
list_tim_rec_tc.DELETE;
temp_app_set.DELETE;
--Check flag to delete or not to delete
IF (app_set_ok = 'N')
THEN
temp_app_set.DELETE (l_index_tmp_app);
ELSE -- update the application set id on the TBB
-- here one more check has to be made for checkin if
-- already some application set id is present or not
-- in which case all time transfer etc needs to be
-- checked, postponing that check for now, will add laterz
-- and now finally update the Appl SET id in the DAY SCOPE... :-)
P_TIME_BUILDING_BLOCKS (l_index_day).application_set_id :=
temp_app_set (l_index).application_set_id;
list_tim_rec_tc.DELETE;
temp_app_set.DELETE;
temp_app_set.DELETE (l_index_tmp_app);
ELSE -- update the application set id on the TBB
-- here one more check has to be made for checkin if
-- already some application set id is present or not
-- in which case all time transfer etc needs to be
-- checked, postponing that check for now, will add laterz
--- and now finally update the Appl SET id in the DAY TIMECARD... :-)
P_TIME_BUILDING_BLOCKS (l_index_tc).application_set_id :=
temp_app_set (l_index).application_set_id;
SELECT DISTINCT (application_set_id) A
FROM hxc_application_set_comps_v
WHERE time_recipient_id = p_tim_rec_id;
l_elp_time_builidng_block.DELETE(l_index_det);
l_elp_time_builidng_block.DELETE(l_index_day);