The following lines contain the word 'select', 'insert', 'update' or 'delete':
WSH_DEBUG_SV.log(l_module_name,'P_ROLE_DEF_RECORD.LAST_UPDATED_BY',p_role_def_record.LAST_UPDATED_BY);
WSH_DEBUG_SV.log(l_module_name,'P_ROLE_DEF_RECORD.LAST_UPDATE_DATE',p_role_def_record.LAST_UPDATE_DATE);
WSH_DEBUG_SV.log(l_module_name,'P_ROLE_DEF_RECORD.LAST_UPDATE_LOGIN',p_role_def_record.LAST_UPDATE_LOGIN);
l_role.LAST_UPDATED_BY := p_role_def_record.LAST_UPDATED_BY;
l_role.LAST_UPDATE_DATE := p_role_def_record.LAST_UPDATE_DATE;
l_role.LAST_UPDATE_LOGIN := p_role_def_record.LAST_UPDATE_LOGIN;
WSH_DEBUG_SV.logmsg(l_module_name,'Calling program unit WSH_RU_ROLES_PVT.INSERT_ROW',WSH_DEBUG_SV.C_PROC_LEVEL);
WSH_RU_ROLES_PVT.Insert_Row(
p_role_record => l_role,
x_rowid => x_rowid,
x_role_id => l_role_id,
x_return_status => l_rs);
l_privilege.PRIVILEGE_CODE := NULL; -- this will be updated
l_privilege.LAST_UPDATED_BY := p_role_def_record.LAST_UPDATED_BY;
l_privilege.LAST_UPDATE_DATE := p_role_def_record.LAST_UPDATE_DATE;
l_privilege.LAST_UPDATE_LOGIN := p_role_def_record.LAST_UPDATE_LOGIN;
WSH_DEBUG_SV.logmsg(l_module_name,'Calling program unit WSH_RU_ROLE_PRIVILEGES_PVT.INSERT_ROW',WSH_DEBUG_SV.C_PROC_LEVEL);
WSH_RU_ROLE_PRIVILEGES_PVT.Insert_Row(
p_role_privilege_record => l_privilege,
x_rowid => l_dummy_rowid,
x_role_privilege_id => l_dummy_id,
x_return_status => l_rs);
l_role.LAST_UPDATED_BY := p_role_def_record.LAST_UPDATED_BY;
l_role.LAST_UPDATE_DATE := p_role_def_record.LAST_UPDATE_DATE;
l_role.LAST_UPDATE_LOGIN := p_role_def_record.LAST_UPDATE_LOGIN;
PROCEDURE Update_Role_Definition(
p_role_def_record IN OUT NOCOPY Role_Definition_Type,
x_return_status OUT NOCOPY VARCHAR2) IS
--
l_rs VARCHAR2(1);
l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'UPDATE_ROLE_DEFINITION';
l_role.LAST_UPDATED_BY := p_role_def_record.LAST_UPDATED_BY;
l_role.LAST_UPDATE_DATE := SYSDATE;
l_role.LAST_UPDATE_LOGIN := p_role_def_record.LAST_UPDATE_LOGIN;
WSH_DEBUG_SV.logmsg(l_module_name,'Calling program unit WSH_RU_ROLES_PVT.INSERT_ROW',WSH_DEBUG_SV.C_PROC_LEVEL);
WSH_RU_ROLES_PVT.Update_Row(
p_role_record => l_role,
p_rowid => NULL,
x_return_status => l_rs);
WSH_RU_ROLE_PRIVILEGES_PVT.Delete_Role_Privileges(
p_role_id => p_role_def_record.ROLE_ID,
x_return_status => l_rs);
l_privilege.PRIVILEGE_CODE := NULL; -- this will be updated
l_privilege.LAST_UPDATED_BY := p_role_def_record.LAST_UPDATED_BY;
l_privilege.LAST_UPDATE_DATE := p_role_def_record.LAST_UPDATE_DATE;
l_privilege.LAST_UPDATE_LOGIN := p_role_def_record.LAST_UPDATE_LOGIN;
WSH_DEBUG_SV.logmsg(l_module_name,'Calling program unit WSH_RU_ROLE_PRIVILEGES_PVT.INSERT_ROW',WSH_DEBUG_SV.C_PROC_LEVEL);
WSH_RU_ROLE_PRIVILEGES_PVT.Insert_Row(
p_role_privilege_record => l_privilege,
x_rowid => l_dummy_rowid,
x_role_privilege_id => l_dummy_id,
x_return_status => l_rs);
p_role_def_record.LAST_UPDATE_DATE := l_role.LAST_UPDATE_DATE;
END Update_Role_Definition;
PROCEDURE Delete_Role_Definition(
p_role_def_record IN Role_Definition_Type,
x_return_status OUT NOCOPY VARCHAR2) IS
--
l_debug_on BOOLEAN;
l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'DELETE_ROLE_DEFINITION';
END Delete_Role_Definition;
SELECT DISTINCT rp.privilege_code
FROM wsh_grants g,
wsh_role_privileges rp
WHERE g.user_id = x_user_id
AND sysdate BETWEEN g.start_date AND NVL(g.end_date, sysdate)
AND NVL(g.organization_id, NVL(x_org_id, -1))
= NVL(x_org_id, NVL(g.organization_id, -1))
AND rp.role_id = g.role_id
ORDER BY privilege_code;
SELECT 'Y'
FROM wsh_grants g,
wsh_role_privileges rp
WHERE g.user_id = x_user_id
AND sysdate BETWEEN g.start_date AND NVL(g.end_date, sysdate)
AND rp.role_id = g.role_id
AND NVL(g.organization_id, NVL(x_org_id, -1))
= NVL(x_org_id, NVL(g.organization_id, -1))
AND rp.privilege_code = x_priv
ORDER BY privilege_code;
* Table Handler to insert records into wsh_customized_activity_msgs table
* This API is designed to be called from ROLE_DEFINITIONS form only.
****************************************************************************************/
Procedure insert_customized_msgs (
p_custom_message_rec IN OUT NOCOPY custom_message_rec
,x_error_message OUT NOCOPY VARCHAR2
,x_return_status OUT NOCOPY VARCHAR2 ) is
l_user_id number := fnd_global.user_id;
l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'INSERT_CUSTOMIZED_MSGS';
insert into wsh_customized_activity_msgs
(customized_activity_mesg_id
,role_id
,activity_code
,validation_code
,return_status
,creation_date
,created_by
,last_update_date
,last_updated_by
,last_update_login)
values
(wsh_customized_activity_msgs_s.nextval
,p_custom_message_rec.role_id
,p_custom_message_rec.activity_code
,p_custom_message_rec.validation_code
,p_custom_message_rec.return_status
,l_sysdate
,l_user_id
,l_sysdate
,l_user_id
,l_login_id)
returning customized_activity_mesg_id into l_id;
End insert_customized_msgs ;
* Table Handler to update records into wsh_customized_activity_msgs table
* This API is designed to be called from ROLE_DEFINITIONS form only.
* ***************************************************************************************/
Procedure update_customized_msgs (
p_custom_message_rec IN OUT NOCOPY custom_message_rec
,x_error_message OUT NOCOPY VARCHAR2
,x_return_status OUT NOCOPY VARCHAR2 ) is
l_user_id number := fnd_global.user_id;
l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'UPDATE_CUSTOMIZED_MSGS';
update wsh_customized_activity_msgs msg
set return_status = nvl(p_custom_message_rec.return_status,'W')
,creation_date = l_sysdate
,created_by = l_user_id
,last_update_date = l_sysdate
,last_updated_by = l_user_id
,last_update_login = l_login_id
where msg.customized_activity_mesg_id = p_custom_message_rec.customized_activity_mesg_id
and msg.role_id = p_custom_message_rec.role_id
and msg.activity_code = p_custom_message_rec.activity_code
and msg.validation_code = p_custom_message_rec.validation_code;
End update_customized_msgs ;
* Table Handler to delete records into wsh_customized_activity_msgs table
* This API is designed to be called from ROLE_DEFINITIONS form only.
****************************************************************************************/
Procedure delete_customized_msgs (
p_custom_message_rec IN OUT NOCOPY custom_message_rec
,x_error_message OUT NOCOPY VARCHAR2
,x_return_status OUT NOCOPY VARCHAR2 ) is
l_debug_on boolean ;
l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'DELETE_CUSTOMIZED_MSGS';
delete from wsh_customized_activity_msgs
where customized_activity_mesg_id = p_custom_message_rec.customized_activity_mesg_id;
End delete_customized_msgs ;
select msgs.activity_code , msgs.validation_code , msgs.return_status
from wsh_customized_activity_msgs msgs
,wsh_grants grants
,wsh_lookups activity
,wsh_lookups message
where grants.user_id = p_user_id
and sysdate between nvl(grants.start_date,sysdate) and nvl(grants.end_date,sysdate )
and msgs.activity_code = p_activity_code
and msgs.validation_code = p_validation_code
and grants.role_id = msgs.role_id
and msgs.activity_code = activity.lookup_code
and sysdate between nvl(activity.start_date_active,sysdate) and nvl(activity.end_date_active,sysdate)
and activity.lookup_type = p_lookup_type
and msgs.validation_code = message.lookup_code
and sysdate between nvl(message.start_date_active,sysdate) and nvl(message.end_date_active,sysdate)
and message.lookup_type = activity.lookup_code
and msgs.return_status = 'E';