The following lines contain the word 'select', 'insert', 'update' or 'delete':
G_LAST_UPDATE_DATE DATE := SYSDATE;
G_LAST_UPDATED_BY NUMBER(15) := FND_GLOBAL.user_id;
G_LAST_UPDATE_LOGIN NUMBER(15) := FND_GLOBAL.login_id;
p_x_rt_oper_resource_rec.last_update_date := SYSDATE;
p_x_rt_oper_resource_rec.last_updated_by := FND_GLOBAL.user_id;
p_x_rt_oper_resource_rec.last_update_login := FND_GLOBAL.login_id;
SELECT aso_resource_id,
quantity,
duration,
attribute_category,
attribute1,
attribute2,
attribute3,
attribute4,
attribute5,
attribute6,
attribute7,
attribute8,
attribute9,
attribute10,
attribute11,
attribute12,
attribute13,
attribute14,
attribute15,
scheduled_type_id, -- added for bug fix 6512803.
-- Bug # 7644260 (FP for ER # 6998882) -- start
schedule_seq
-- Bug # 7644260 (FP for ER # 6998882) -- end
FROM AHL_RT_OPER_RESOURCES
WHERE rt_oper_resource_id = c_rt_oper_resource_id;
SELECT resource_type_id
FROM AHL_RESOURCES
WHERE resource_id = c_resource_id;
SELECT 'X'
FROM ahl_alternate_resources
WHERE rt_oper_resource_id = c_rt_oper_resource_id
AND aso_resource_id = c_aso_resource_id;
SELECT resource_type_id,
resource_type,
aso_resource_name
FROM AHL_RT_OPER_RESOURCES_V
WHERE rt_oper_resource_id = c_rt_oper_resource_id;
SELECT alternate_resource_id FROM AHL_ALTERNATE_RESOURCES
WHERE rt_oper_resource_id = c_rt_oper_resource_id;
SELECT 'X'
FROM AHL_RESOURCES
WHERE resource_id = c_aso_resource_id
AND resource_type_id = c_resource_type_id;
SELECT resource_type_id,
resource_type,
aso_resource_id,
aso_resource_name
FROM AHL_RT_OPER_RESOURCES_V
WHERE object_id = c_object_id
AND association_type_code = c_association_type_code
GROUP BY resource_type_id,
resource_type,
aso_resource_id,
aso_resource_name
HAVING count(*) > 1;
SELECT 'X'
FROM ahl_resource_mappings
WHERE DEPARTMENT_ID IS NOT NULL
AND aso_resource_id in
(SELECT ASO_RESOURCE_ID
FROM ahl_rt_oper_resources
WHERE object_id = c_object_id
AND ASSOCIATION_TYPE_CODE = c_association_type_code
)
GROUP BY bom_org_id
HAVING count(DISTINCT DEPARTMENT_ID) > 1;
SELECT 'X'
FROM ahl_resource_mappings
WHERE DEPARTMENT_ID IS NOT NULL
AND aso_resource_id in
(SELECT ALTR.ASO_RESOURCE_ID
FROM ahl_alternate_resources ALTR,
(SELECT RT_OPER_RESOURCE_ID
FROM ahl_rt_oper_resources
WHERE RT_OPER_RESOURCE_ID <> c_rt_oper_res_id
AND ASSOCIATION_TYPE_CODE = c_association_type_code
AND OBJECT_ID = c_object_id
)
ROR
WHERE ROR.RT_OPER_RESOURCE_ID = ALTR.rt_oper_resource_id
)
OR aso_resource_id =
(SELECT aso_resource_id
FROM ahl_rt_oper_resources
WHERE RT_OPER_RESOURCE_ID = c_rt_oper_res_id
)
GROUP BY bom_org_id
HAVING count(DISTINCT DEPARTMENT_ID) > 1;
SELECT RT_OPER_RESOURCE_ID
FROM AHL_RT_OPER_RESOURCES
WHERE ASSOCIATION_TYPE_CODE = c_association_type_code
AND OBJECT_ID = c_object_id;
select revision_status_code
from ahl_routes_app_v
where route_id = p_route_id;
select revision_status_code
from ahl_operations_b
where operation_id = p_operation_id;
select min(schedule_seq)
from ahl_rt_oper_resources
where object_id = c_object_id
and association_type_code = c_association_type_code
and schedule_seq IS NOT NULL ;
UPDATE ahl_operations_b
SET revision_status_code = 'DRAFT'
WHERE operation_id = p_object_id;
UPDATE ahl_routes_b
SET revision_status_code = 'DRAFT'
WHERE route_id = p_object_id;
INSERT INTO AHL_RT_OPER_RESOURCES
(
rt_oper_resource_ID,
OBJECT_VERSION_NUMBER,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
CREATION_DATE,
CREATED_BY,
LAST_UPDATE_LOGIN,
association_type_code,
object_ID,
aso_resource_id,
quantity,
duration,
ATTRIBUTE_CATEGORY,
ATTRIBUTE1,
ATTRIBUTE2,
ATTRIBUTE3,
ATTRIBUTE4,
ATTRIBUTE5,
ATTRIBUTE6,
ATTRIBUTE7,
ATTRIBUTE8,
ATTRIBUTE9,
ATTRIBUTE10,
ATTRIBUTE11,
ATTRIBUTE12,
ATTRIBUTE13,
ATTRIBUTE14,
ATTRIBUTE15,
scheduled_type_id, -- added for bug fix 6512803.
-- Bug # 7644260 (FP for ER # 6998882) -- start
schedule_seq
-- Bug # 7644260 (FP for ER # 6998882) -- end
) VALUES
(
AHL_RT_OPER_RESOURCES_S.NEXTVAL,
1,
G_LAST_UPDATE_DATE,
G_LAST_UPDATED_BY,
G_CREATION_DATE,
G_CREATED_BY,
G_LAST_UPDATE_LOGIN,
p_association_type_code,
p_object_id,
p_x_rt_oper_resource_tbl(i).aso_resource_id,
p_x_rt_oper_resource_tbl(i).quantity,
p_x_rt_oper_resource_tbl(i).duration,
p_x_rt_oper_resource_tbl(i).attribute_category,
p_x_rt_oper_resource_tbl(i).attribute1,
p_x_rt_oper_resource_tbl(i).attribute2,
p_x_rt_oper_resource_tbl(i).attribute3,
p_x_rt_oper_resource_tbl(i).attribute4,
p_x_rt_oper_resource_tbl(i).attribute5,
p_x_rt_oper_resource_tbl(i).attribute6,
p_x_rt_oper_resource_tbl(i).attribute7,
p_x_rt_oper_resource_tbl(i).attribute8,
p_x_rt_oper_resource_tbl(i).attribute9,
p_x_rt_oper_resource_tbl(i).attribute10,
p_x_rt_oper_resource_tbl(i).attribute11,
p_x_rt_oper_resource_tbl(i).attribute12,
p_x_rt_oper_resource_tbl(i).attribute13,
p_x_rt_oper_resource_tbl(i).attribute14,
p_x_rt_oper_resource_tbl(i).attribute15,
p_x_rt_oper_resource_tbl(i).scheduled_type_id,
-- Bug # 7644260 (FP for ER # 6998882) -- start
p_x_rt_oper_resource_tbl(i).schedule_seq
-- Bug # 7644260 (FP for ER # 6998882) -- end
) RETURNING rt_oper_resource_id INTO l_rt_oper_resource_id;
'AHL_RT_OPER_RESOURCES insert error = ['||SQLERRM||']'
);
UPDATE AHL_RT_OPER_RESOURCES SET
object_version_number = object_version_number + 1,
last_update_date = G_LAST_UPDATE_DATE,
last_updated_by = G_LAST_UPDATED_BY,
last_update_login = G_LAST_UPDATE_LOGIN,
aso_resource_id = p_x_rt_oper_resource_tbl(i).aso_resource_id,
quantity = p_x_rt_oper_resource_tbl(i).quantity,
duration = p_x_rt_oper_resource_tbl(i).duration,
attribute_category = p_x_rt_oper_resource_tbl(i).attribute_category,
attribute1 = p_x_rt_oper_resource_tbl(i).attribute1,
attribute2 = p_x_rt_oper_resource_tbl(i).attribute2,
attribute3 = p_x_rt_oper_resource_tbl(i).attribute3,
attribute4 = p_x_rt_oper_resource_tbl(i).attribute4,
attribute5 = p_x_rt_oper_resource_tbl(i).attribute5,
attribute6 = p_x_rt_oper_resource_tbl(i).attribute6,
attribute7 = p_x_rt_oper_resource_tbl(i).attribute7,
attribute8 = p_x_rt_oper_resource_tbl(i).attribute8,
attribute9 = p_x_rt_oper_resource_tbl(i).attribute9,
attribute10 = p_x_rt_oper_resource_tbl(i).attribute10,
attribute11 = p_x_rt_oper_resource_tbl(i).attribute11,
attribute12 = p_x_rt_oper_resource_tbl(i).attribute12,
attribute13 = p_x_rt_oper_resource_tbl(i).attribute13,
attribute14 = p_x_rt_oper_resource_tbl(i).attribute14,
attribute15 = p_x_rt_oper_resource_tbl(i).attribute15,
-- added for bug fix# 6512803.
scheduled_type_id = p_x_rt_oper_resource_tbl(i).scheduled_type_id,
-- Bug # 7644260 (FP for ER # 6998882) -- start
schedule_seq = p_x_rt_oper_resource_tbl(i).schedule_seq
-- Bug # 7644260 (FP for ER # 6998882) -- end
WHERE rt_oper_resource_id = p_x_rt_oper_resource_tbl(i).rt_oper_resource_id
AND object_version_number = p_x_rt_oper_resource_tbl(i).object_version_number;
'AHL_RT_OPER_RESOURCES update error = ['||SQLERRM||']'
);
DELETE FROM ahl_alternate_resources
WHERE rt_oper_resource_id = p_x_rt_oper_resource_tbl(i).rt_oper_resource_id;
DELETE FROM AHL_RT_OPER_RESOURCES
WHERE rt_oper_resource_id = p_x_rt_oper_resource_tbl(i).rt_oper_resource_id
AND object_version_number = p_x_rt_oper_resource_tbl(i).object_version_number;
UPDATE ahl_rt_oper_resources
SET schedule_seq = l_min_sch_seq
WHERE object_id = p_object_id
AND association_type_code = p_association_type_code
AND schedule_seq IS NULL ;
SELECT activity_id,
activity,
cost_basis_id,
cost_basis,
scheduled_type_id,
scheduled_type,
autocharge_type_id,
autocharge_type,
standard_rate_flag,
standard_rate
FROM AHL_RT_OPER_RESOURCES_V
WHERE rt_oper_resource_id = c_rt_oper_resource_id;
SELECT --DISTINCT
RES.OBJECT_ID,
RES.ASSOCIATION_TYPE_CODE,
AR.resource_type_id,
RES.duration,
AR.NAME
FROM AHL_RT_OPER_RESOURCES RES, AHL_RESOURCES AR
WHERE RES.aso_resource_id = AR.resource_id
AND RES.RT_OPER_RESOURCE_ID = C_RT_OPER_RESOURCE_ID;
select revision_status_code
from ahl_routes_app_v
where route_id = p_route_id;
select revision_status_code
from ahl_operations_b
where operation_id = p_operation_id;
SELECT meaning
INTO p_x_rt_oper_cost_rec.scheduled_type
FROM fnd_lookup_values_vl
WHERE lookup_type = 'BOM_RESOURCE_SCHEDULE_TYPE'
AND lookup_code = p_x_rt_oper_cost_rec.scheduled_type_id;
UPDATE ahl_operations_b
SET revision_status_code = 'DRAFT'
WHERE operation_id = l_object_id;
UPDATE ahl_routes_b
SET revision_status_code = 'DRAFT'
WHERE route_id = l_object_id;
UPDATE AHL_RT_OPER_RESOURCES SET
object_version_number = object_version_number + 1,
activity_id = p_x_rt_oper_cost_rec.activity_id,
cost_basis_id = p_x_rt_oper_cost_rec.cost_basis_id,
scheduled_type_id = p_x_rt_oper_cost_rec.scheduled_type_id,
autocharge_type_id = p_x_rt_oper_cost_rec.autocharge_type_id,
standard_rate_flag = p_x_rt_oper_cost_rec.standard_rate_flag,
last_update_date = SYSDATE,
last_updated_by = FND_GLOBAL.user_id,
last_update_login = FND_GLOBAL.login_id
WHERE rt_oper_resource_id = p_x_rt_oper_cost_rec.rt_oper_resource_id
AND object_version_number = p_x_rt_oper_cost_rec.object_version_number;
p_x_alt_resource_rec.last_update_date := SYSDATE;
p_x_alt_resource_rec.last_updated_by := FND_GLOBAL.user_id;
p_x_alt_resource_rec.last_update_login := FND_GLOBAL.login_id;
SELECT alternate_resource_id,
aso_resource_id,
priority,
attribute_category,
attribute1,
attribute2,
attribute3,
attribute4,
attribute5,
attribute6,
attribute7,
attribute8,
attribute9,
attribute10,
attribute11,
attribute12,
attribute13,
attribute14,
attribute15
FROM AHL_ALTERNATE_RESOURCES
WHERE alternate_resource_id = c_alt_resource_id;
SELECT resource_type_id
FROM AHL_RT_OPER_RESOURCES_V
WHERE rt_oper_resource_id = c_rt_oper_resource_id;
SELECT resource_type_id
FROM AHL_RESOURCES
WHERE resource_id = c_aso_resource_id;
SELECT name
FROM AHL_ALTERNATE_RESOURCES_V
WHERE rt_oper_resource_id = c_rt_oper_resource_id
GROUP BY NAME
HAVING count(*) > 1;
SELECT priority
FROM AHL_ALTERNATE_RESOURCES
WHERE rt_oper_resource_id = c_rt_oper_resource_id
GROUP BY priority
HAVING count(*) > 1;
SELECT aso_resource_name
from ahl_rt_oper_resources_v
where rt_oper_resource_id = c_rt_oper_resource_id;
select name
from AHL_alternate_resources_v
where rt_oper_resource_id = c_rt_oper_resource_id
and name = c_aso_resource_name;
SELECT 'X'
FROM ahl_resource_mappings
WHERE DEPARTMENT_ID IS NOT NULL
AND aso_resource_id in
(
SELECT ASO_RESOURCE_ID
FROM ahl_rt_oper_resources
WHERE object_id = c_object_id
AND ASSOCIATION_TYPE_CODE = c_association_type_code
AND ASO_RESOURCE_ID <> c_aso_res_id
)
OR aso_resource_id = c_alt_res_id
GROUP BY bom_org_id
HAVING count(DISTINCT DEPARTMENT_ID) > 1;
SELECT OBJECT_ID,ASSOCIATION_TYPE_CODE, ASO_RESOURCE_ID
FROM AHL_RT_OPER_RESOURCES
WHERE RT_OPER_RESOURCE_ID= c_rt_oper_resource_id;
SELECT ASO_RESOURCE_ID
FROM AHL_ALTERNATE_RESOURCES
WHERE RT_OPER_RESOURCE_ID= c_rt_oper_resource_id;
INSERT INTO AHL_ALTERNATE_RESOURCES
(
ALTERNATE_RESOURCE_ID,
OBJECT_VERSION_NUMBER,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
CREATION_DATE,
CREATED_BY,
LAST_UPDATE_LOGIN,
RT_OPER_RESOURCE_ID,
ASO_RESOURCE_ID,
PRIORITY,
ATTRIBUTE_CATEGORY,
ATTRIBUTE1,
ATTRIBUTE2,
ATTRIBUTE3,
ATTRIBUTE4,
ATTRIBUTE5,
ATTRIBUTE6,
ATTRIBUTE7,
ATTRIBUTE8,
ATTRIBUTE9,
ATTRIBUTE10,
ATTRIBUTE11,
ATTRIBUTE12,
ATTRIBUTE13,
ATTRIBUTE14,
ATTRIBUTE15
) VALUES
(
AHL_ALTERNATE_RESOURCES_S.NEXTVAL,
1,
G_LAST_UPDATE_DATE,
G_LAST_UPDATED_BY,
G_CREATION_DATE,
G_CREATED_BY,
G_LAST_UPDATE_LOGIN,
p_rt_oper_resource_id,
p_x_alt_resource_tbl(i).aso_resource_id,
p_x_alt_resource_tbl(i).priority,
p_x_alt_resource_tbl(i).attribute_category,
p_x_alt_resource_tbl(i).attribute1,
p_x_alt_resource_tbl(i).attribute2,
p_x_alt_resource_tbl(i).attribute3,
p_x_alt_resource_tbl(i).attribute4,
p_x_alt_resource_tbl(i).attribute5,
p_x_alt_resource_tbl(i).attribute6,
p_x_alt_resource_tbl(i).attribute7,
p_x_alt_resource_tbl(i).attribute8,
p_x_alt_resource_tbl(i).attribute9,
p_x_alt_resource_tbl(i).attribute10,
p_x_alt_resource_tbl(i).attribute11,
p_x_alt_resource_tbl(i).attribute12,
p_x_alt_resource_tbl(i).attribute13,
p_x_alt_resource_tbl(i).attribute14,
p_x_alt_resource_tbl(i).attribute15
) RETURNING alternate_resource_id INTO l_alt_resource_id ;
'AHL_ALTERNATE_RESOURCES insert error = ['||SQLERRM||']'
);
UPDATE AHL_ALTERNATE_RESOURCES SET
object_version_number = object_version_number + 1,
last_update_date = G_LAST_UPDATE_DATE,
last_updated_by = G_LAST_UPDATED_BY,
last_update_login = G_LAST_UPDATE_LOGIN,
aso_resource_id = p_x_alt_resource_tbl(i).aso_resource_id,
priority = p_x_alt_resource_tbl(i).priority,
attribute_category = p_x_alt_resource_tbl(i).attribute_category,
attribute1 = p_x_alt_resource_tbl(i).attribute1,
attribute2 = p_x_alt_resource_tbl(i).attribute2,
attribute3 = p_x_alt_resource_tbl(i).attribute3,
attribute4 = p_x_alt_resource_tbl(i).attribute4,
attribute5 = p_x_alt_resource_tbl(i).attribute5,
attribute6 = p_x_alt_resource_tbl(i).attribute6,
attribute7 = p_x_alt_resource_tbl(i).attribute7,
attribute8 = p_x_alt_resource_tbl(i).attribute8,
attribute9 = p_x_alt_resource_tbl(i).attribute9,
attribute10 = p_x_alt_resource_tbl(i).attribute10,
attribute11 = p_x_alt_resource_tbl(i).attribute11,
attribute12 = p_x_alt_resource_tbl(i).attribute12,
attribute13 = p_x_alt_resource_tbl(i).attribute13,
attribute14 = p_x_alt_resource_tbl(i).attribute14,
attribute15 = p_x_alt_resource_tbl(i).attribute15
WHERE alternate_resource_id = p_x_alt_resource_tbl(i).alternate_resource_id
AND object_version_number = p_x_alt_resource_tbl(i).object_version_number;
'AHL_ALTERNATE_RESOURCES update error = ['||SQLERRM||']'
);
DELETE FROM AHL_ALTERNATE_RESOURCES
WHERE alternate_resource_id = p_x_alt_resource_tbl(i).alternate_resource_id
AND object_version_number = p_x_alt_resource_tbl(i).object_version_number;