The following lines contain the word 'select', 'insert', 'update' or 'delete':
| PROCEDURE Insert_Row |
+=========================================================================*/
PROCEDURE Insert_Row
(
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,
p_return_status OUT NOCOPY VARCHAR2,
p_msg_count OUT NOCOPY NUMBER,
p_msg_data OUT NOCOPY VARCHAR2,
--
p_row_id IN OUT NOCOPY VARCHAR2,
p_set_relation_id IN OUT NOCOPY NUMBER,
p_account_position_set_id IN NUMBER,
p_allocation_Rule_id IN NUMBER,
p_budget_group_id IN NUMBER,
p_budget_workflow_rule_id IN NUMBER,
p_constraint_id IN NUMBER,
p_default_Rule_id IN NUMBER,
p_Parameter_Id IN NUMBER,
p_position_set_group_id IN NUMBER,
p_gl_budget_id IN NUMBER := FND_API.G_MISS_NUM,
/* Budget Revision Rules Enhancement Start */
p_rule_id IN VARCHAR2,
p_apply_balance_flag IN VARCHAR2,
/* Budget Revision Rules Enhancement End */
p_effective_start_date IN DATE,
p_effective_end_date IN DATE,
p_last_update_date IN DATE,
p_last_updated_by IN NUMBER,
p_last_update_login IN NUMBER,
p_created_by IN NUMBER,
p_creation_date IN DATE
)
IS
--
l_api_name CONSTANT VARCHAR2(30) := 'Insert_Row';
SELECT rowid
FROM psb_set_relations
WHERE set_relation_id = p_set_relation_id;
SELECT psb_set_relations_s.nextval
FROM dual;
l_last_update_date DATE ;
l_last_Updated_by NUMBER ;
l_last_update_login NUMBER ;
SAVEPOINT Insert_Row_Pvt ;
l_last_update_date := SYSDATE ;
l_last_Updated_by := FND_GLOBAL.User_Id;
IF l_last_Updated_by IS NULL THEN
l_last_Updated_by := -1;
l_last_update_login := FND_GLOBAL.Login_Id ;
IF l_last_update_login IS NULL THEN
l_last_update_login := -1;
l_created_by := l_last_Updated_by ;
l_creation_date := l_last_update_date ;
INSERT INTO psb_set_relations(
set_relation_id,
account_position_set_id,
allocation_rule_id,
budget_group_id,
budget_workflow_rule_id,
constraint_id,
default_rule_id,
parameter_id,
position_set_group_id,
gl_budget_id,
/* Budget Revision Rules Enhancement Start */
rule_id,
apply_balance_flag,
/* Budget Revision Rules Enhancement End */
effective_start_date,
effective_end_date,
last_update_date,
last_updated_by,
last_update_login,
created_by,
creation_date)
VALUES (
p_set_relation_id,
p_account_position_set_id,
p_allocation_Rule_id,
p_budget_group_id,
p_budget_workflow_rule_id,
p_constraint_id,
p_default_Rule_id,
p_Parameter_Id,
p_position_set_group_id,
l_gl_budget_id,
/* Budget Revision Rules Enhancement Start */
p_rule_id,
p_apply_balance_flag,
/* Budget Revision Rules Enhancement End */
p_effective_start_date,
p_effective_end_date,
l_last_update_date,
l_last_Updated_by,
l_last_update_login,
l_created_by,
l_creation_date
) ;
ROLLBACK TO Insert_Row_Pvt ;
ROLLBACK TO Insert_Row_Pvt ;
ROLLBACK TO Insert_Row_Pvt ;
END Insert_Row;
SELECT *
FROM psb_set_relations
WHERE rowid = p_row_id
FOR UPDATE of set_relation_id NOWAIT;
FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
| PROCEDURE Update_Row |
+=========================================================================*/
PROCEDURE Update_Row
(
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,
p_return_status OUT NOCOPY VARCHAR2,
p_msg_count OUT NOCOPY NUMBER,
p_msg_data OUT NOCOPY VARCHAR2,
--
p_row_id IN VARCHAR2,
p_set_relation_id IN NUMBER,
p_account_position_set_id IN NUMBER,
p_allocation_Rule_id IN NUMBER,
p_budget_group_id IN NUMBER,
p_budget_workflow_rule_id IN NUMBER,
p_constraint_id IN NUMBER,
p_default_Rule_id IN NUMBER,
p_Parameter_Id IN NUMBER,
p_position_set_group_id IN NUMBER,
p_gl_budget_id IN NUMBER := FND_API.G_MISS_NUM,
/* Budget Revision Rules Enhancement Start */
p_rule_id IN VARCHAR2,
p_apply_balance_flag IN VARCHAR2,
/* Budget Revision Rules Enhancement End */
p_effective_start_date IN DATE,
p_effective_end_date IN DATE,
p_last_update_date IN DATE,
p_last_updated_by IN NUMBER,
p_last_update_login IN NUMBER
)
IS
--
l_api_name CONSTANT VARCHAR2(30) := 'Update_Row';
l_last_update_date DATE ;
l_last_Updated_by NUMBER ;
l_last_update_login NUMBER ;
SAVEPOINT Update_Row_Pvt ;
l_last_update_date := SYSDATE ;
l_last_Updated_by := FND_GLOBAL.User_Id;
IF l_last_Updated_by IS NULL THEN
l_last_Updated_by := -1;
l_last_update_login := FND_GLOBAL.Login_Id ;
IF l_last_update_login IS NULL THEN
l_last_update_login := -1;
UPDATE psb_set_relations
SET
set_relation_id = p_set_relation_id,
account_position_set_id = p_account_position_set_id,
allocation_rule_id = p_allocation_Rule_id,
budget_group_id = p_budget_group_id,
budget_workflow_rule_id = p_budget_workflow_rule_id,
constraint_id = p_constraint_id,
default_rule_id = p_default_Rule_id,
parameter_id = p_Parameter_Id,
position_set_group_id = p_position_set_group_id,
gl_budget_id = l_gl_budget_id,
/* Budget Revision Rules Enhancement Start */
rule_id = p_rule_id,
apply_balance_flag = p_apply_balance_flag,
/* Budget Revision Rules Enhancement End */
effective_start_date = p_effective_start_date,
effective_end_date = p_effective_end_date,
last_update_date = l_last_update_date,
last_updated_by = l_last_Updated_by,
last_update_login = l_last_update_login
WHERE rowid = p_row_id;
ROLLBACK TO Update_Row_Pvt ;
ROLLBACK TO Update_Row_Pvt ;
ROLLBACK TO Update_Row_Pvt ;
END Update_Row;
| PROCEDURE Delete_Row |
+=========================================================================*/
PROCEDURE Delete_Row
( 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,
p_return_status OUT NOCOPY VARCHAR2,
p_msg_count OUT NOCOPY NUMBER,
p_msg_data OUT NOCOPY VARCHAR2,
--
p_row_id IN VARCHAR2
)
IS
--
l_api_name CONSTANT VARCHAR2(30) := 'Delete_Row';
SAVEPOINT Delete_Row_Pvt ;
DELETE psb_set_relations
WHERE rowid = p_row_id;
ROLLBACK TO Delete_Row_Pvt ;
ROLLBACK TO Delete_Row_Pvt ;
ROLLBACK TO Delete_Row_Pvt ;
END Delete_Row;
| PROCEDURE Delete_Entity_Relation |
+=========================================================================*/
PROCEDURE Delete_Entity_Relation
(
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,
p_return_status OUT NOCOPY VARCHAR2,
p_msg_count OUT NOCOPY NUMBER,
p_msg_data OUT NOCOPY VARCHAR2,
--
p_entity_type IN VARCHAR2,
p_entity_id IN NUMBER
)
IS
--
l_api_name CONSTANT VARCHAR2(30) := 'Delete_Entity_Relation';
SAVEPOINT Delete_Entity_Relation_Pvt ;
SELECT account_position_set_id ,
account_or_position_type ,
global_or_local_type ,
set_relation_id
FROM psb_set_relations_v
WHERE DECODE( p_entity_type,
'AR', allocation_rule_id,
'BG', budget_group_id,
'BWR', budget_workflow_rule_id,
'C', constraint_id,
'DR', default_rule_id,
'P', parameter_id,
'PSG', position_set_group_id,
'GBS', gl_budget_id,
/* Budget Revision Rules Enhancement Start */
'BRR', rule_id
/* Budget Revision Rules Enhancement End */
) = p_entity_id
)
LOOP
IF l_relations_rec.global_or_local_type = 'L' OR p_entity_type = 'BG' THEN
--
-- Delete all the set line values for position set related set lines.
--
IF l_relations_rec.account_or_position_type = 'P' THEN
DELETE psb_position_set_line_values
WHERE line_sequence_id IN
(
SELECT line_sequence_id
FROM psb_account_position_set_lines
WHERE account_position_set_id =
l_relations_rec.account_position_set_id
) ;
DELETE psb_account_position_set_lines
WHERE account_position_set_id =
l_relations_rec.account_position_set_id ;
DELETE psb_account_position_sets
WHERE account_position_set_id = l_relations_rec.account_position_set_id ;
DELETE psb_set_relations
WHERE set_relation_id = l_relations_rec.set_relation_id;
ROLLBACK TO Delete_Entity_Relation_Pvt ;
ROLLBACK TO Delete_Entity_Relation_Pvt ;
ROLLBACK TO Delete_Entity_Relation_Pvt ;
END Delete_Entity_Relation;
SELECT '1'
FROM psb_set_relations_v
WHERE account_or_position_type = p_account_or_position_type
AND DECODE( p_entity_type,
'AR', allocation_rule_id,
'BG', budget_group_id,
'BWR', budget_workflow_rule_id,
'C', constraint_id,
'DR', default_rule_id,
'P', parameter_id,
'PSG', position_set_group_id,
'GBS', gl_budget_id,
/* Budget Revision Rules Enhancement Start */
'BRR', rule_id
/* Budget Revision Rules Enhancement End */
) = p_entity_id
AND account_position_set_id = p_account_position_set_id
AND ( (p_row_id IS NULL)
OR (Row_Id <> p_row_id) );
SELECT '1'
FROM psb_set_relations_v
WHERE account_or_position_type = p_account_or_position_type
AND DECODE( p_entity_type,
'AR', allocation_rule_id,
'BG', budget_group_id,
'BWR', budget_workflow_rule_id,
'C', constraint_id,
'DR', default_rule_id,
'P', parameter_id,
'PSG', position_set_group_id,
'GBS', gl_budget_id,
'BRR', rule_id
) = p_entity_id
AND account_position_set_id = p_account_position_set_id
AND ( (p_row_id IS NULL)
OR (Row_Id <> p_row_id) )
AND apply_balance_flag = p_apply_balance_flag;