The following lines contain the word 'select', 'insert', 'update' or 'delete':
sqltxt VARCHAR2(9999); -- SQL select statement
JTF_DIAGNOSTIC_COREAPI.insert_style_sheet;
sqltxt := ' SELECT org "OrganizationCode (Id)"' ||
' ,item "Item (Id)",rev "Rev",' ||
' sub "Subinv",' ||
' loc "Locator id",' ||
' onhand "Onhand Qty",' ||
' qty_avail "Available Qty",' ||
' Adj_qty "Adj Qty"' ||
' from' ||
' (select mp.organization_code|| '' (''||mpa.organization_id ||'')'' org, msi.concatenated_segments || '' (''||mpa.inventory_item_id ||'')'' item, ' ||
' mpa.revision rev, mpa.subinventory_name sub, mpa.locator_id loc, mpa.lot_number lot,' ||
' INV_DIAG_GRP.CHECK_ONHAND(mpa.inventory_item_id, mpa.organization_id, mpa.revision, mpa.subinventory_name, mpa.locator_id) onhand, ' ||
' INV_DIAG_GRP.CHECK_AVAIL(mpa.inventory_item_id,mpa.organization_id,mpa.revision, mpa.subinventory_name,mpa.locator_id) qty_avail, ' ||
' sum(adjustment_quantity) adj_qty' ||
' from mtl_physical_adjustments mpa, mtl_system_items_kfv msi,mtl_parameters mp' ||
' where mpa.approval_status is null and mpa.adjustment_quantity < 0 ' ||
' and mpa.inventory_item_id = msi.inventory_item_id' ||
' and mpa.organization_id = msi.organization_id' ||
' and mp.organization_id = mpa.organization_id ' ;