DBA Data[Home] [Help]

APPS.MSC_PEG_UTIL SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 12

select origination_type, disposition_id
from msc_demands
where demand_id = p_demand_id
and plan_id = p_plan_id
and organization_id = p_organization_id
and sr_instance_id  = p_sr_instance_id;
Line: 53

    select  mis.item_name ||'/'||
          msc_get_name.org_code(ms.organization_id,ms.sr_instance_id) item_org,
          ms.new_order_quantity supply_qty,
          ms.new_schedule_date  supply_date,
          msc_get_name.lookup_meaning( 'MRP_ORDER_TYPE',
                                     ms.order_type) order_name,
          null  pegging_id,
          null  prev_pegging_id,
          ms.transaction_id,
          p_demand_id demand_id,
          ms.new_order_quantity pegged_qty,
          ms.inventory_item_id,
          ms.order_type,
          null  disposition
  bulk collect into
       x_itemorg_pegnode_rec.Item_Org,
       x_itemorg_pegnode_rec.Qty,
       x_itemorg_pegnode_rec.Peg_Date,
       x_itemorg_pegnode_rec.Order_name,
       x_itemorg_pegnode_rec.Pegging_id,
       x_itemorg_pegnode_rec.Prev_pegging_id,
       x_itemorg_pegnode_rec.Transaction_id,
       x_itemorg_pegnode_rec.Demand_id,
       x_itemorg_pegnode_rec.Pegged_qty,
       x_itemorg_pegnode_rec.Item_id,
       x_itemorg_pegnode_rec.Order_type,
       x_itemorg_pegnode_rec.Disposition
  from    msc_items mis,
          msc_supplies ms
  where   mis.inventory_item_id = ms.inventory_item_id
  and     ms.transaction_id     = l_disposition_id
  and     ms.plan_id            = p_plan_id
  and     ms.organization_id    = p_organization_id
  and     ms.sr_instance_id     = p_sr_instance_id;
Line: 89

   select distinct
          item_org,
          supply_qty,
          supply_date,
          order_name,
          pegging_id,
          prev_pegging_id,
          transaction_id,
          demand_id,
          pegged_qty,
          inventory_item_id,
          order_type,
          disposition
  bulk collect into
       x_itemorg_pegnode_rec.Item_Org,
       x_itemorg_pegnode_rec.Qty,
       x_itemorg_pegnode_rec.Peg_Date,
       x_itemorg_pegnode_rec.Order_name,
       x_itemorg_pegnode_rec.Pegging_id,
       x_itemorg_pegnode_rec.Prev_pegging_id,
       x_itemorg_pegnode_rec.Transaction_id,
       x_itemorg_pegnode_rec.Demand_id,
       x_itemorg_pegnode_rec.Pegged_qty,
       x_itemorg_pegnode_rec.Item_id,
       x_itemorg_pegnode_rec.Order_type,
       x_itemorg_pegnode_rec.Disposition
  from msc_flp_demand_supply_v
  where plan_id = p_plan_id
  and pegging_id = p_prev_peg_id
  order by item_org, supply_date;
Line: 132

 select distinct item_org,
                 supply_qty,
                 supply_date,
                 order_name,
                 pegging_id,
                 prev_pegging_id,
                 transaction_id,
                 demand_id,
                 pegged_qty,
                 inventory_item_id,
                 order_type,
                 disposition
  bulk collect into
       x_itemorg_pegnode_rec.Item_Org,
       x_itemorg_pegnode_rec.Qty,
       x_itemorg_pegnode_rec.Peg_Date,
       x_itemorg_pegnode_rec.Order_name,
       x_itemorg_pegnode_rec.Pegging_id,
       x_itemorg_pegnode_rec.Prev_pegging_id,
       x_itemorg_pegnode_rec.Transaction_id,
       x_itemorg_pegnode_rec.Demand_id,
       x_itemorg_pegnode_rec.Pegged_qty,
       x_itemorg_pegnode_rec.Item_id,
       x_itemorg_pegnode_rec.Order_type,
       x_itemorg_pegnode_rec.Disposition
  from      msc_flp_demand_supply_v
  where     plan_id = p_plan_id
        and prev_pegging_id = l_prev_peg_id
        and demand_id = p_demand_id
        and order_type not in (15,16,28)
        order by item_org, supply_date;
Line: 182

select bom_item_type
from   msc_system_items
where  inventory_item_id = p_inventory_item_id
and    plan_id           = p_plan_id
and    sr_instance_id    = p_instance_id;
Line: 190

select inventory_item_id
from msc_supplies
where transaction_id = p_transaction_id
and   plan_id        = p_plan_id
and   sr_instance_id = p_instance_id
and   organization_id = p_organization_id;
Line: 220

 select  item_org,
         demand_qty,
         demand_date,
         origination_name,
         prev_pegging_id,
         demand_id,
         sum(pegged_qty) pegged_qty,
         item_id,
         order_type,
         end_disposition order_number,
         null pegging_id ,
         null transaction_id,
         null end_demand_class
bulk collect into
       x_itemorg_pegnode_rec.Item_Org,
       x_itemorg_pegnode_rec.Qty,
       x_itemorg_pegnode_rec.Peg_date,
       x_itemorg_pegnode_rec.Order_name,
       x_itemorg_pegnode_rec.Prev_pegging_id,
       x_itemorg_pegnode_rec.Demand_id,
       x_itemorg_pegnode_rec.Pegged_qty,
       x_itemorg_pegnode_rec.Item_id,
       x_itemorg_pegnode_rec.order_type,
       x_itemorg_pegnode_rec.order_number,
       x_itemorg_pegnode_rec.Pegging_id,
       x_itemorg_pegnode_rec.Transaction_id,
       x_itemorg_pegnode_rec.end_demand_class
from msc_flp_supply_demand_v
    where plan_id = p_plan_id
    and prev_pegging_id in ( select pegging_id
				  from msc_full_pegging
				  where plan_id       = p_plan_id
				  and transaction_id  = p_transaction_id
				  and sr_instance_id  = p_instance_id
				  and allocated_quantity > 0)  ------ = p_pegging_id
    and item_id not in (SELECT msi.inventory_item_id
                        FROM msc_resource_requirements req,
                        msc_routings rout,
                        msc_routing_operations op,
                        msc_operation_components moc,
                        msc_bom_components mbc,
                        msc_system_items msi
                        WHERE req.plan_id = rout.plan_id
                        AND req.sr_instance_id = rout.sr_instance_id
                        AND nvl(req.routing_sequence_id,-23453) = decode(nvl(req.routing_sequence_id,-23453), -23453,-23453, rout.routing_sequence_id)
                        AND req.plan_id = op.plan_id
                        AND req.sr_instance_id = op.sr_instance_id
                        AND nvl(req.routing_sequence_id,-23453) = decode(nvl(req.routing_sequence_id,-23453), -23453, -23453, op.routing_sequence_id)
                        AND req.operation_sequence_id = op.operation_sequence_id
                        AND nvl(req.parent_id,2) = 2
                        and moc.plan_id = req.plan_id
                        and moc.sr_instance_id = req.sr_instance_id
                        and moc.operation_sequence_id = req.operation_sequence_id
                        and nvl(req.routing_sequence_id,-23453) = decode(nvl(req.routing_sequence_id,-23453), -23453, -23453, moc.routing_sequence_id)
                        and moc.plan_id  = mbc.plan_id
                        and moc.sr_instance_id = mbc.sr_instance_id
                        and moc.organization_id = mbc.organization_id
                        and moc.component_sequence_id    = mbc.component_sequence_id
                        and moc.bill_sequence_id   = mbc.bill_sequence_id
                        and mbc.plan_id = msi.plan_id
                        and mbc.sr_instance_id = msi.sr_instance_id
                        and mbc.organization_id = msi.organization_id
                        and mbc.inventory_item_id = msi.inventory_item_id
                        and req.plan_id = p_plan_id
                        and req.sr_instance_id = p_instance_id
                        and req.organization_id = p_organization_id
                        and req.supply_id = p_transaction_id
                        and 0 = nvl(p_condense_supply_oper,0)
                        and 0 = nvl(p_hide_oper,0))
    group by demand_qty, demand_date,
        origination_name, prev_pegging_id, demand_id,
        item_id, item_org, order_type, end_disposition
  order by item_org, demand_date;
Line: 296

  select mis.item_name ||'/'||
         msc_get_name.org_code(dm.organization_id,dm.sr_instance_id) item_org,
         dm.using_requirement_quantity demand_qty,
         dm.using_assembly_demand_date demand_date,
         msc_get_name.lookup_meaning( 'MRP_DEMAND_ORIGINATION',
                                     dm.origination_type) origination_name,
         null prev_pegging_id,
         dm.demand_id  demand_id,
         dm.using_requirement_quantity pegged_qty,
         mis.inventory_item_id item_id,
         dm.origination_type,
         null order_number,
         null pegging_id,
         null transaction_id,
         null end_demand_class
bulk collect into
       x_itemorg_pegnode_rec.Item_Org,
       x_itemorg_pegnode_rec.Qty,
       x_itemorg_pegnode_rec.Peg_date,
       x_itemorg_pegnode_rec.Order_name,
       x_itemorg_pegnode_rec.Prev_pegging_id,
       x_itemorg_pegnode_rec.Demand_id,
       x_itemorg_pegnode_rec.Pegged_qty,
       x_itemorg_pegnode_rec.Item_id,
       x_itemorg_pegnode_rec.order_type,
       x_itemorg_pegnode_rec.order_number,
       x_itemorg_pegnode_rec.Pegging_id,
       x_itemorg_pegnode_rec.Transaction_id,
       x_itemorg_pegnode_rec.end_demand_class
  from  msc_items mis,
        msc_demands dm
  where mis.inventory_item_id = dm.inventory_item_id
  and   dm.disposition_id     = p_transaction_id
  and   plan_id               = p_plan_id
  and   organization_id       = p_organization_id
  and   sr_instance_id        = p_instance_id;
Line: 337

   select distinct
        item_org,
        pegging_id,
        prev_pegging_id,
        demand_qty,
        demand_date,
        origination_name,
        demand_id,
        transaction_id,
        item_id,
        pegged_qty,
        end_disposition order_number,
        order_type,
        end_demand_class
bulk collect into
       x_itemorg_pegnode_rec.Item_Org,
       x_itemorg_pegnode_rec.Pegging_id,
       x_itemorg_pegnode_rec.Prev_pegging_id,
       x_itemorg_pegnode_rec.Qty,
       x_itemorg_pegnode_rec.Peg_Date,
       x_itemorg_pegnode_rec.Order_name,
       x_itemorg_pegnode_rec.demand_id,
       x_itemorg_pegnode_rec.transaction_id,
       x_itemorg_pegnode_rec.item_id,
       x_itemorg_pegnode_rec.Pegged_qty,
       x_itemorg_pegnode_rec.order_number,
       x_itemorg_pegnode_rec.order_type,
       x_itemorg_pegnode_rec.end_demand_class
from msc_flp_supply_demand_v
where plan_id =      p_plan_id
and sr_instance_id = p_instance_id
and transaction_id = p_transaction_id
order by item_org, demand_date;
Line: 372

 select distinct
        item_org,
        pegging_id,
        prev_pegging_id,
        demand_qty,
        demand_date,
        origination_name,
        demand_id,
        transaction_id,
        item_id,
        pegged_qty,
        end_disposition order_number,
        order_type,
        end_demand_class
bulk collect into
       x_itemorg_pegnode_rec.Item_Org,
       x_itemorg_pegnode_rec.Pegging_id,
       x_itemorg_pegnode_rec.Prev_pegging_id,
       x_itemorg_pegnode_rec.Qty,
       x_itemorg_pegnode_rec.Peg_date,
       x_itemorg_pegnode_rec.Order_name,
       x_itemorg_pegnode_rec.Demand_id,
       x_itemorg_pegnode_rec.transaction_id,
       x_itemorg_pegnode_rec.item_id,
       x_itemorg_pegnode_rec.Pegged_qty,
       x_itemorg_pegnode_rec.order_number,
       x_itemorg_pegnode_rec.order_type,
       x_itemorg_pegnode_rec.end_demand_class
from msc_flp_supply_demand_v
where plan_id = p_plan_id
and  pegging_id  = p_pegging_id
order by item_org, demand_date;
Line: 422

  select mis.item_name ||'/'||
         msc_get_name.org_code(dm.organization_id,dm.sr_instance_id) item_org,
         dm.using_requirement_quantity demand_qty,
         dm.using_assembly_demand_date demand_date,
         msc_get_name.lookup_meaning( 'MRP_DEMAND_ORIGINATION',
                                     dm.origination_type) origination_name,
         null prev_pegging_id,
         dm.demand_id  demand_id,
         dm.using_requirement_quantity pegged_qty,
         mis.inventory_item_id item_id,
         dm.origination_type,
         null order_number,
         null pegging_id,
         null transaction_id,
         null end_demand_class
  bulk collect into
       x_itemorg_pegnode_rec.Item_Org,
       x_itemorg_pegnode_rec.Qty,
       x_itemorg_pegnode_rec.Peg_date,
       x_itemorg_pegnode_rec.Order_name,
       x_itemorg_pegnode_rec.Prev_pegging_id,
       x_itemorg_pegnode_rec.Demand_id,
       x_itemorg_pegnode_rec.Pegged_qty,
       x_itemorg_pegnode_rec.Item_id,
       x_itemorg_pegnode_rec.order_type,
       x_itemorg_pegnode_rec.order_number,
       x_itemorg_pegnode_rec.Pegging_id,
       x_itemorg_pegnode_rec.Transaction_id,
       x_itemorg_pegnode_rec.end_demand_class
  from  msc_items mis,
        msc_demands dm
  where mis.inventory_item_id = dm.inventory_item_id
  and   dm.disposition_id     = p_transaction_id
  and   plan_id               = p_plan_id
  and   organization_id       = p_organization_id
  and   sr_instance_id        = p_instance_id
  and   dm.origination_type   = 22;