The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT id1 line_id
,header_id
,ship_from_org_id organization_id -- Bug 2225305
,line_number line_number
,order_quantity_uom uom
,ordered_quantity quantity
,inventory_item_id
,unit_list_price
,price_list_id
,unit_selling_price
,config_header_id
,config_rev_nbr
,to_number(NULL) config_item_id
,'Y' config_valid_yn
,'Y' config_complete_yn
,nvl(to_number(sort_order),0) seq -- Bug 2087912
FROM OKX_ORDER_LINES_V
WHERE b_o_flag = OKC_API.G_TRUE
AND link_to_line_id = b_line_id
AND item_type_code in ('OPTION','CLASS')
UNION ALL
SELECT a.id1 line_id
,a.quote_header_id header_id
,a.organization_id organization_id -- Bug 2225305
,a.line_number line_number
,uom_code uom
,quantity quantity
,inventory_item_id
,a.line_list_price/decode(quantity,0,1,quantity) unit_list_price
,a.price_list_id price_list_id
,a.line_quote_price/decode(quantity,0,1,quantity) unit_selling_price
,c.config_header_id config_header_id
,c.config_revision_num config_rev_nbr
,c.config_item_id config_item_id
,c.valid_configuration_flag config_valid_yn
,c.complete_configuration_flag config_complete_yn
,a.line_number seq -- for sorting Bug 2087912
-- Changed refrence to ASO tables to OKX views
FROM OKX_QUOTE_LINES_V a,OKX_QTE_LINE_RLSHPS_V b,OKX_QUOTE_LINE_DETAIL_V c
WHERE b_q_flag = OKC_API.G_TRUE
AND a.id1 = b.related_quote_line_id
AND a.id1 = c.quote_line_id
AND b.quote_line_id= b_line_id
AND b.relationship_type_code ='CONFIG'
AND a.item_type_code = 'CFG'
order by 16;
l_child_clev_rec.last_update_login:=UID;
okc_util.print_trace(1, '>START - ******* OKC_CONTRACT_PUB.UPDATE_CONTRACT_LINE -');
okc_contract_pub.update_contract_line(p_api_version => 1
,p_init_msg_list => OKC_API.G_FALSE
,x_return_status => l_return_status
,x_msg_count => l_msg_count
,x_msg_data => l_msg_data
,p_clev_rec => xmodel_clev_rec
,x_clev_rec => x_clev_rec
);
okc_util.print_trace(1, '
SELECT
quote_line_id,
line_relationship_id
FROM
okx_qte_line_rlshps_v
-- aso_line_relationships
WHERE
related_quote_line_id = b_rlted_qle_id
AND relationship_type_code = 'CONFIG';
x_line_rltship_tab.DELETE;
l_line_rltship_tab.DELETE;
okc_util.print_trace(2,'Oper code of parent line is UPDATE - q_line_id found');
ELSE -- px_qte_line_tbl(px_k2q_line_tbl(i).q_line_idx).operation_code ( UPDATE )
IF (l_debug = 'Y') THEN
okc_util.print_trace(2,'Oper code of config item UPDATE');
-- The operation code is not required here as it's been identified as an update
--
-- l_line_rltship_tab(p).operation_code := g_aso_op_code_create;
okc_util.print_trace(2,'Oper code of parent line is UPDATE - q_line_id found');
okc_util.print_trace(2,' Values in the l_line_rltship_tab for the item type code CFG and operation code update is ');
-- Delete the constructed record,because the entry has been found in the table
-- and doesnot require any processing.
--
IF (l_debug = 'Y') THEN
okc_util.print_trace(2,'Validated the existing relationship and deleting the ');
l_line_rltship_tab.DELETE(p);
-- and since it is an update,it is not valid and so raise an exception
--
IF (l_debug = 'Y') THEN
okc_util.print_trace(2,'Rltn exists for a diff quote id, raising an exception');
-- This is the case of an update and the record is not found
-- Set an error message and raise an exception
--
IF (l_debug = 'Y') THEN
okc_util.print_trace(2,'No rec found while trying to validate the rltnshp, raising an exception');
END IF; -- px_qte_line_tbl(px_k2q_line_tbl(i).q_line_idx).operation_code ( create or update )
ELSE -- ( update )need to use the id of the covered line
IF (l_debug = 'Y') THEN
okc_util.print_trace(2,'Create the relationship for the cov line using id');
ELSE -- px_qte_line_tbl(px_k2q_line_tbl(i).q_line_idx).operation_code = g (update)
--
-- Need to check the quote detail line to ensure that there is a covered line
--
-- Loop through the px_qte_line_dtl_tbl to retrieve the attached index k
-- using px_qte_line_tbl(px_k2q_line_tbl(i).q_line_idx)
--
IF px_qte_line_dtl_tbl.FIRST IS NOT NULL THEN
FOR k IN px_qte_line_dtl_tbl.FIRST..px_qte_line_dtl_tbl.LAST LOOP
IF px_qte_line_dtl_tbl(k).qte_line_index = px_qte_line_tbl(px_k2q_line_tbl(i).q_line_idx).line_number THEN
--
-- Need to ensure that qdl(k) has a covered line
--
IF px_qte_line_dtl_tbl(k).service_ref_type_code = okc_oc_int_ktq_pvt.g_qte_ref_quote THEN
-- Need to use the id of the related quote line (service line).
IF NVL(px_qte_line_dtl_tbl(k).service_ref_qte_line_index,OKC_API.G_MISS_NUM) <>
OKC_API.G_MISS_NUM THEN
p := p + 1;
okc_util.print_trace(2,'Update the relationship for the cov line using index');
okc_util.print_trace(2,'Update the relationship for the cov line using id');
l_line_rltship_tab(p).operation_code := g_aso_op_code_update;
ELSE -- delete
--
-- Need to check the existance of any relationship for the service line id
--
OPEN c_qte_line_rlt(px_qte_line_tbl(px_k2q_line_tbl(i).q_line_idx).quote_line_id);
l_line_rltship_tab(p).operation_code := g_aso_op_code_delete;
END IF; -- ELSE -- px_qte_line_tbl(px_k2q_line_tbl(i).q_line_idx).operation_code = g (update)