The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT PV_ENTITY_ATTRS_s.NEXTVAL
FROM dual;
SELECT 1
FROM PV_ENTITY_ATTRS
WHERE ENTITY_ATTR_ID = l_id;
SELECT attribute_type, display_style
from pv_attributes_vl
where attribute_id=cv_attribute_id
;
FOR x IN (select meaning from pv_lookups
where lookup_type = 'PV_ATTRIBUTE_ENTITY_TYPE'
and lookup_code = p_entity_attr_rec.entity
) LOOP
l_meaning := x.meaning;
FOR x IN (select meaning from pv_lookups
where lookup_type = 'PV_ATTRIBUTE_TYPE'
and lookup_code = l_attribute_type
) LOOP
l_meaning := x.meaning;
FOR x IN (select meaning from pv_lookups
where lookup_type = 'PV_ATTR_DISPLAY_STYLE'
and lookup_code = l_display_style
) LOOP
l_meaning := x.meaning;
l_entity_attr_rec.last_update_date := SYSDATE;
l_entity_attr_rec.last_updated_by := G_USER_ID;
l_entity_attr_rec.last_update_login := G_LOGIN_ID;
Pv_Entity_Attrs_Pkg.Insert_Row(
px_entity_attr_id => l_entity_attr_rec.entity_attr_id
,px_object_version_number => l_object_version_number
,p_batch_sql_text => l_entity_attr_rec.batch_sql_text
,p_refresh_frequency => l_entity_attr_rec.refresh_frequency
,p_refresh_frequency_uom => l_entity_attr_rec.refresh_frequency_uom
,p_last_refresh_date => l_entity_attr_rec.last_refresh_date
,p_display_external_value_flag => l_entity_attr_rec.display_external_value_flag
,p_lov_string => l_lov_string --replace(l_lov_string,':1','?')
,p_enabled_flag => l_entity_attr_rec.enabled_flag
,p_display_flag => l_entity_attr_rec.display_flag
,p_locator_flag => l_entity_attr_rec.locator_flag
,p_entity_type => l_entity_attr_rec.entity_type
,p_require_validation_flag => l_entity_attr_rec.require_validation_flag
,p_external_update_text => l_entity_attr_rec.external_update_text
,p_attribute_id => l_entity_attr_rec.attribute_id
,p_entity => l_entity_attr_rec.entity
,p_sql_text => l_entity_attr_rec.sql_text
,p_attr_data_type => l_entity_attr_rec.attr_data_type
,p_creation_date => l_entity_attr_rec.creation_date
,p_created_by => l_entity_attr_rec.created_by
,p_last_updated_by => l_entity_attr_rec.last_updated_by
,p_last_update_date => l_entity_attr_rec.last_update_date
,p_last_update_login => l_entity_attr_rec.last_update_login);
PROCEDURE Update_Entity_Attr(
p_api_version_number 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_entity_attr_rec IN entity_attr_rec_type
,x_object_version_number OUT NOCOPY NUMBER
)
IS
CURSOR c_get_entity_attribute(cv_entity_attr_id NUMBER) IS
SELECT *
FROM PV_ENTITY_ATTRS
WHERE ENTITY_ATTR_ID = cv_entity_attr_id;
SELECT attribute_type,display_style
from pv_attributes_vl
where attribute_id=cv_attribute_id
;
l_api_name CONSTANT VARCHAR2(30) := 'Update_Entity_Attr';
SAVEPOINT Update_Entity_Attr_PVT;
Pvx_Utility_Pvt.debug_message('Private API: - Open Cursor to Select');
Fnd_Message.set_token('MODE','Update');
Fnd_Message.set_token('COLUMN','Last_Update_Date');
,p_validation_mode => Jtf_Plsql_Api.g_update
,p_entity_attr_rec => p_entity_attr_rec
,x_return_status => x_return_status
,x_msg_count => x_msg_count
,x_msg_data => x_msg_data);
Pvx_Utility_Pvt.debug_message('Private API: '||l_full_name||' - Calling update table handler');
Pv_Entity_Attrs_Pkg.Update_Row(
p_entity_attr_id => p_entity_attr_rec.entity_attr_id
,p_last_update_date => SYSDATE
,p_last_updated_by => G_USER_ID
,p_last_update_login => G_LOGIN_ID
,p_object_version_number => p_entity_attr_rec.object_version_number
,p_attribute_id => p_entity_attr_rec.attribute_id
,p_entity => p_entity_attr_rec.entity
,p_entity_type => p_entity_attr_rec.entity_type
,p_sql_text => p_entity_attr_rec.sql_text
,p_attr_data_type => p_entity_attr_rec.attr_data_type
,p_lov_string => l_lov_string --replace(l_lov_string,':1','?') --replacing :1 with ? as we are storing java bindings
,p_enabled_flag => p_entity_attr_rec.enabled_flag
,p_display_flag => p_entity_attr_rec.display_flag
,p_locator_flag => p_entity_attr_rec.locator_flag
,p_require_validation_flag=> p_entity_attr_rec.require_validation_flag
,p_external_update_text => p_entity_attr_rec.external_update_text
,p_refresh_frequency => p_entity_attr_rec.refresh_frequency
,p_refresh_frequency_uom => p_entity_attr_rec.refresh_frequency_uom
,p_batch_sql_text => p_entity_attr_rec.batch_sql_text
,p_last_refresh_date => p_entity_attr_rec.last_refresh_date
,p_display_external_value_flag => p_entity_attr_rec.display_external_value_flag
);
ROLLBACK TO Update_Entity_Attr_PVT;
ROLLBACK TO Update_Entity_Attr_PVT;
ROLLBACK TO Update_Entity_Attr_PVT;
END Update_Entity_Attr;
select meaning from pv_lookups
where lookup_type = 'PV_ATTRIBUTE_ENTITY_TYPE'
and lookup_code= cv_lookup_code
;
PROCEDURE Delete_Entity_Attr(
p_api_version_number 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_entity_attr_id IN NUMBER
,p_object_version_number IN NUMBER
)
IS
l_api_name CONSTANT VARCHAR2(30) := 'Delete_Entity_Attr';
l_delete_flag VARCHAR2(1):='Y';
select attr.name, enty.entity
from pv_attributes_vl attr, pv_entity_attrs enty
where enty.entity_attr_id=pc_entity_attr_id and
enty.attribute_id=attr.attribute_id
;
select prg.program_name
from pv_partner_program_vl prg, pv_ge_qsnr_elements_b qsnr
where qsnr.used_by_entity_id = prg.program_id and
entity_attr_id = pc_entity_attr_id
;
select distinct val.entity
from pv_enty_attr_values val, pv_entity_attrs enty
where enty.entity_attr_id =pc_entity_attr_id and
enty.attribute_id = val.attribute_id and
enty.entity = val.entity
;
SAVEPOINT Delete_Entity_Attr_PVT;
l_delete_flag := 'N' ;
if(l_delete_flag = 'N') then
IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
THEN
FND_MESSAGE.Set_Name('PV', 'PV_ENTITYATTR_REF_VALUE');
l_delete_flag := 'N' ;
if(l_delete_flag = 'N') then
IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
THEN
FND_MESSAGE.Set_Name('PV', 'PV_ENTITYATTR_REF_PROGRAM');
Pvx_Utility_Pvt.debug_message( 'Private API: Calling delete table handler');
Pv_Entity_Attrs_Pkg.Delete_Row(
p_ENTITY_ATTR_ID => p_ENTITY_ATTR_ID);
ROLLBACK TO Delete_Entity_Attr_PVT;
ROLLBACK TO Delete_Entity_Attr_PVT;
ROLLBACK TO Delete_Entity_Attr_PVT;
END Delete_Entity_Attr;
SELECT ENTITY_ATTR_ID
FROM PV_ENTITY_ATTRS
WHERE ENTITY_ATTR_ID = p_ENTITY_ATTR_ID
AND object_version_number = p_object_version
FOR UPDATE NOWAIT;
IF p_entity_attr_rec.last_update_date = Fnd_Api.g_miss_date OR p_entity_attr_rec.last_update_date IS NULL THEN
IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
Fnd_Message.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
Fnd_Message.set_token('COLUMN','last_update_date');
IF p_entity_attr_rec.last_updated_by = Fnd_Api.g_miss_num OR p_entity_attr_rec.last_updated_by IS NULL THEN
IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
Fnd_Message.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
Fnd_Message.set_token('COLUMN','last_updated_by');
IF p_entity_attr_rec.last_update_login = Fnd_Api.g_miss_num OR
p_entity_attr_rec.last_update_login IS NULL THEN
IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
Fnd_Message.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
Fnd_Message.set_token('COLUMN','last_update_login');
IF p_entity_attr_rec.last_update_date IS NULL THEN
IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
Fnd_Message.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
Fnd_Message.set_token('COLUMN','last_update_date');
IF p_entity_attr_rec.last_updated_by IS NULL THEN
IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
Fnd_Message.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
Fnd_Message.set_token('COLUMN','last_updated_by');
IF p_entity_attr_rec.last_update_login IS NULL THEN
IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
Fnd_Message.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
Fnd_Message.set_token('COLUMN','last_update_login');
SELECT *
FROM pv_entity_attrs
WHERE entity_attr_id = p_entity_attr_rec.entity_attr_id;
IF p_entity_attr_rec.last_update_date = Fnd_Api.g_miss_date THEN
x_complete_rec.last_update_date := l_entity_attr_rec.last_update_date;
IF p_entity_attr_rec.last_updated_by = Fnd_Api.g_miss_num THEN
x_complete_rec.last_updated_by := l_entity_attr_rec.last_updated_by;
IF p_entity_attr_rec.last_update_login = Fnd_Api.g_miss_num THEN
x_complete_rec.last_update_login := l_entity_attr_rec.last_update_login;
IF p_entity_attr_rec.selection_type = Fnd_Api.g_miss_char THEN
x_complete_rec.selection_type := l_entity_attr_rec.selection_type;
-- external_update_text
IF p_entity_attr_rec.external_update_text = Fnd_Api.g_miss_char THEN
x_complete_rec.external_update_text := l_entity_attr_rec.external_update_text;
,p_validation_mode IN VARCHAR2 := Jtf_Plsql_Api.G_UPDATE
,p_entity_attr_rec IN entity_attr_rec_type
,x_return_status OUT NOCOPY VARCHAR2
,x_msg_count OUT NOCOPY NUMBER
,x_msg_data OUT NOCOPY VARCHAR2
)
IS
l_api_name CONSTANT VARCHAR2(30) := 'Validate_Entity_Attr';
,p_validation_mode IN VARCHAR2 := Jtf_Plsql_Api.G_UPDATE
)
IS
BEGIN
-- Initialize message list if p_init_msg_list is set to TRUE.
IF Fnd_Api.to_Boolean( p_init_msg_list )
THEN
Fnd_Msg_Pub.initialize;