The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT NVL(MAX(line_no), 0)+1
INTO l_line_no
FROM gl_aloc_bas
WHERE alloc_id = p_allocation_definition_rec.alloc_id ;
log_msg('Inserting record for alloc_id : ' ||
p_allocation_definition_rec.alloc_id || ' line_no : ' || l_line_no);
INSERT INTO gl_aloc_bas
(
alloc_id
, line_no
, alloc_method
, inventory_item_id
, basis_account_id
, balance_type
, bas_ytd_ptd
, basis_type
, fixed_percent
, cmpntcls_id
, analysis_code
, organization_id
, creation_date
, created_by
, last_update_date
, last_updated_by
, last_update_login
, trans_cnt
, text_code
, delete_mark
)
VALUES
(
p_allocation_definition_rec.alloc_id
, l_line_no
, p_allocation_definition_rec.alloc_method
, p_allocation_definition_rec.item_id
, p_allocation_definition_rec.basis_account_id
, p_allocation_definition_rec.balance_type
, p_allocation_definition_rec.bas_ytd_ptd
, p_allocation_definition_rec.basis_type
, p_allocation_definition_rec.fixed_percent
, p_allocation_definition_rec.cmpntcls_id
, p_allocation_definition_rec.analysis_code
, p_allocation_definition_rec.organization_id
, sysdate
, p_user_id
, sysdate
, p_user_id
, FND_GLOBAL.LOGIN_ID
, '' -- transaction count (not in use)
, '' -- text code
, 0 -- p_allocation_definition_rec.delete_mark
)
;
log_msg('1 row inserted');
PROCEDURE Update_Allocation_Definition
(
p_api_version IN NUMBER ,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE ,
p_commit IN VARCHAR2 := FND_API.G_FALSE ,
x_return_status OUT NOCOPY VARCHAR2 ,
x_msg_count OUT NOCOPY NUMBER ,
x_msg_data OUT NOCOPY VARCHAR2 ,
p_allocation_definition_rec IN GMF_ALLOCATIONDEFINITION_PUB.Allocation_Definition_Rec_Type,
p_user_id IN NUMBER -- Bug 2659435 Removed defaults
)
IS
l_api_name CONSTANT VARCHAR2(30) := 'Create_Allocation_Definition' ;
SAVEPOINT Update_Alloc_Definition_PVT;
update gl_aloc_bas
SET
inventory_item_id = decode(p_allocation_definition_rec.item_id,
FND_API.G_MISS_NUM, NULL,
NULL, inventory_item_id,
p_allocation_definition_rec.item_id)
,basis_account_id = decode(p_allocation_definition_rec.basis_account_id,
FND_API.G_MISS_NUM, NULL,
NULL, basis_account_id,
p_allocation_definition_rec.basis_account_id)
,balance_type = decode(p_allocation_definition_rec.balance_type,
FND_API.G_MISS_NUM, NULL,
NULL, balance_type,
p_allocation_definition_rec.balance_type)
,bas_ytd_ptd = decode(p_allocation_definition_rec.bas_ytd_ptd,
FND_API.G_MISS_NUM, NULL,
NULL, bas_ytd_ptd,
p_allocation_definition_rec.bas_ytd_ptd)
,basis_type = decode(p_allocation_definition_rec.basis_type,
FND_API.G_MISS_NUM, NULL,
NULL, basis_type,
p_allocation_definition_rec.basis_type)
,fixed_percent = decode(p_allocation_definition_rec.fixed_percent,
FND_API.G_MISS_NUM, NULL,
NULL, fixed_percent,
p_allocation_definition_rec.fixed_percent)
,cmpntcls_id = decode(p_allocation_definition_rec.cmpntcls_id,
FND_API.G_MISS_NUM, NULL,
NULL, cmpntcls_id,
p_allocation_definition_rec.cmpntcls_id)
,analysis_code = decode(p_allocation_definition_rec.analysis_code,
FND_API.G_MISS_CHAR, NULL,
NULL, analysis_code,
p_allocation_definition_rec.analysis_code)
,organization_id = decode(p_allocation_definition_rec.organization_id,
FND_API.G_MISS_NUM, NULL,
NULL, organization_id,
p_allocation_definition_rec.organization_id)
-- ,creation_date = sysdate -- Bug 2722404
-- ,created_by = p_user_id
,last_update_date = sysdate
,last_updated_by = p_user_id
,last_update_login = FND_GLOBAL.LOGIN_ID
,delete_mark = decode(p_allocation_definition_rec.delete_mark,
FND_API.G_MISS_NUM, NULL,
NULL, delete_mark,
p_allocation_definition_rec.delete_mark)
WHERE
alloc_id = p_allocation_definition_rec.alloc_id
AND line_no = p_allocation_definition_rec.line_no
;
ROLLBACK TO Update_Alloc_Definition_PVT;
ROLLBACK TO Update_Alloc_Definition_PVT;
ROLLBACK TO Update_Alloc_Definition_PVT;
END Update_Allocation_Definition ;