The following lines contain the word 'select', 'insert', 'update' or 'delete':
Select distinct ic.item_id ,
ic.noninv_ind,
ic.lot_ctl,
ic.loct_ctl
From ic_item_mst ic,
mtl_system_items mtl
Where mtl.inventory_item_id = l_mo_line_rec.inventory_item_id
And mtl.segment1= ic.item_no;
Select sum(abs(trans_qty)), sum(abs(trans_qty2))
From ic_tran_pnd
Where line_id = l_mo_line_rec.txn_source_line_id
-- And item_id = l_opm_item_id (commenting this line so that index on line_id gets used)
And lot_id <> 0
And doc_type = 'OMSO'
And delete_mark = 0
And completed_ind = 0;
Select sum(abs(trans_qty)), sum(abs(trans_qty2))
From ic_tran_pnd
Where line_id = l_mo_line_rec.txn_source_line_id
-- And item_id = l_opm_item_id (commenting this line so that index on line_id gets used)
And lot_id = 0
And doc_type = 'OMSO'
And delete_mark = 0
And completed_ind = 0;
Select line_id
From ic_txn_request_lines
Where txn_source_line_id = l_mo_line_rec.txn_source_line_id;
SELECT count(*)
FROM ic_tran_pnd
WHERE line_id = p_line_id
AND doc_type = 'OMSO'
-- AND item_id = p_item_id (commenting this line so that index on line_id gets used)
AND staged_ind = 0
AND completed_ind = 0
AND delete_mark = 0
AND lot_id = 0
AND location = ic$default_loct
AND line_detail_id IS NULL;
SELECT whse_code
FROM IC_WHSE_MST
WHERE mtl_organization_id = p_organization_id;
IF l_mo_line_rec.operation = INV_GLOBALS.G_OPR_DELETE THEN
/* physically delete this row */
/* This first Queries To see If Any Reservations Exist */
/* ( GMI Transcations) Then deletes or Updates. */
/* Else it will just delete this line. */
gmi_reservation_util.println('Operation delete');
GMI_Move_Order_LINE_Util.delete_Row( l_mo_line_rec.LINE_id);
IF l_mo_line_rec.operation = INV_GLOBALS.G_OPR_UPDATE THEN
gmi_reservation_util.println('Operation update');
l_mo_line_rec.last_update_date := SYSDATE;
l_mo_line_rec.last_updated_by := FND_GLOBAL.USER_ID;
l_mo_line_rec.last_update_login := FND_GLOBAL.USER_ID;
IF l_mo_line_rec.operation = INV_GLOBALS.G_OPR_UPDATE THEN
/* This will first check if old_line quantity or line_status */
/* or quantity_detailed is different from New Then Call */
/* query to get reservations and do update logic. */
/* Else it will just update this row. */
gmi_reservation_util.println('Going to update row');
GMI_Move_Order_LINE_Util.update_Row( l_mo_line_rec);
select MTL_TXN_REQUEST_LINES_S.nextval
-- END Bug 2628244
INTO l_mo_line_rec.LINE_id
FROM DUAL;
WSH_Util_Core.PrintLn('Insert For Row > '|| I);
GMI_Move_Order_LINE_Util.Insert_Row( l_mo_line_rec);
FND_MESSAGE.Set_Token('BY_PROC', 'GMI_TRANS_ENGINE_PUB.UPDATE_PENDING_TRANSACTION');
FND_MESSAGE.Set_Token('WHERE', 'Delete_Reservation');
ELSIF ( p_mo_line_rec.operation = INV_GLOBALS.G_OPR_UPDATE) THEN
IF p_mo_line_rec.header_id is NULL OR
p_mo_line_rec.line_id is NULL OR
p_mo_line_rec.line_number is NULL OR
p_mo_line_rec.organization_id is NULL OR
p_mo_line_rec.inventory_item_id is NULL OR
p_mo_line_rec.uom_code is NULL OR
p_mo_line_rec.quantity is NULL OR
p_mo_line_rec.line_status is NULL OR
p_mo_line_rec.transaction_type_id is NULL THEN
RETURN TRUE;
/* This should Catch DELETE, LOCK_ROW and QUERY */
/* Which all need a LINES ID. */
ELSE
IF p_mo_line_rec.header_id is NULL OR
p_mo_line_rec.LINE_id is NULL THEN
RETURN TRUE;