The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT po_id
FROM JAI_OPM_OSP_HDRS
WHERE osp_header_id = pr_new.batch_id ;
SELECT batch_no, batch_status --, wip_whse_code
from gme_batch_header
WHERE batch_id =pr_new.batch_id;
Cursor C_Rec_Exist IS SELECT rowid, unit_price FROM JAI_OPM_OSP_DTLS
WHERE osp_header_id = pr_new.batch_id
AND organization_id = pr_new.organization_id
AND inventory_item_id = pr_new.inventory_item_id;
select organization_id
from mtl_secondary_inventories
where secondary_inventory_name = l_whse_code;
SELECT rate
FROM JAI_OPM_OSP_EXC_RATES
WHERE form_name = P_Form_Name;
SELECT form_name FROM JAI_OPM_OSP_HDRS
WHERE osp_header_id = pr_new.batch_id;
select decode(inventory_item_flag, 'Y', 0, 1) noninv_ind
from mtl_system_items
where organization_id = cp_organization_id
and inventory_item_id = cp_inventory_item_id;
SELECT ship_to_location_id location_id
FROM po_headers_all
WHERE po_header_id = cpn_po_id;
l_updated_by NUMBER;
6 . 3-Dec-2008 Changes by nprashar for bug 7540543, During insert into table JAI_OPM_OSP_DETAILS,
for columns UOM_CODE,PLAN_QUANTITY dtl_num, wip_plan_quantity are now being used.
------------------------------------------------------------------------------------------------------------- */
OPEN C_chk_hdr;
l_updated_by := pr_new.last_updated_by;
UPDATE JAI_OPM_OSP_DTLS
SET act_quantity = pr_new.actual_qty,
excise_payable = l_excise_payable,
last_updated_by = l_updated_by,
last_update_date = sysdate
WHERE rowid = l_rowid;
INSERT INTO JAI_OPM_OSP_DTLS (OSP_DETAIL_ID,
OSP_HEADER_ID,
TRANS_DATE,
UOM_CODE,
PLAN_QUANTITY ,
ACT_QUANTITY,
UNIT_PRICE,
MODVAT_CLAIMED,
EXCISE_PAYABLE,
ISSUE_RECPT_FLAG,
CREATION_DATE,
CREATED_BY,
LAST_UPDATED_BY ,
LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN,
PROCESSING_CHARGE,
MAIN_RCPT_FLAG,
inventory_item_id,
organization_id)
VALUES ( JAI_OPM_OSP_DTLS_S1.NEXTVAL,
pr_new.batch_id,
sysdate,
/* Commented by nprashar for bug 7540543
pr_new.item_um,
pr_new.plan_qty,
*/
pr_new.dtl_um, /*Added by nprashar for bug 7540543*/
pr_new.wip_plan_qty, /*Added by nprashar for bug 7540543*/
l_rcpt_qty ,
null,
null,
null,
'R',
SYSDATE,
l_updated_by,
l_updated_by,
SYSDATE,
null,
null,
'N',
pr_new.inventory_item_id,
pr_new.organization_id
) returning OSP_HEADER_ID into l_osp_dtl_id;
l_updated_by,
pr_new.organization_id,
pr_new.inventory_item_id
);