DBA Data[Home] [Help]

APPS.BOM_ATO_NEW_ATP_PK SQL Statements

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

Line: 36

  select inventory_item_id,
         organization_id,
         demand_id,
         primary_uom_quantity,
         uom_code,
         requirement_date,
         demand_class,
         temp,      -- calling module
         temp,      -- customer_id
         temp,      -- customer_site_id
         temp,      -- destination_time_zone
         temp1,     -- requested arrival_date
         temp1,     -- latest acceptable_date
         temp,      -- delivery lead time
         temp,      -- Freight_Carrier
         temp,      -- Ship_Method
         temp,      --Ship_Set_Name
         temp,      -- Arrival_Set_Name
         temp,      -- Override_Flag
         temp,      -- Action
         temp1,     -- Ship_date
         temp,      -- available_quantity
         temp,      -- requested_date_quantity
         temp1,     -- group_ship_date
         temp1,     -- group_arrival_date
         temp,      -- vendor_id
         temp,      -- vendor_site_id
         temp,      -- insert_flag
         temp,      -- error_code
         temp       -- Message
  bulk collect into
         p_atp_table.Inventory_Item_Id       ,
         p_atp_table.Source_Organization_Id  ,
         p_atp_table.Identifier              ,
         p_atp_table.Quantity_Ordered        ,
         p_atp_table.Quantity_UOM            ,
         p_atp_table.Requested_Ship_Date     ,
         p_atp_table.Demand_Class            ,
         p_atp_table.Calling_Module          ,
         p_atp_table.Customer_Id             ,
         p_atp_table.Customer_Site_Id        ,
         p_atp_table.Destination_Time_Zone   ,
         p_atp_table.Requested_Arrival_Date  ,
         p_atp_table.Latest_Acceptable_Date  ,
         p_atp_table.Delivery_Lead_Time      ,
         p_atp_table.Freight_Carrier         ,
         p_atp_table.Ship_Method             ,
         p_atp_table.Ship_Set_Name           ,
         p_atp_table.Arrival_Set_Name        ,
         p_atp_table.Override_Flag           ,
         p_atp_table.Action                  ,
         p_atp_table.Ship_Date               ,
         p_atp_table.Available_Quantity      ,
         p_atp_table.Requested_Date_Quantity ,
         p_atp_table.Group_Ship_Date         ,
         p_atp_table.Group_Arrival_Date      ,
         p_atp_table.Vendor_Id               ,
         p_atp_table.Vendor_Site_Id          ,
         p_atp_table.Insert_Flag             ,
         p_atp_table.Error_Code              ,
         p_atp_table.Message
    from mtl_demand md
    where md.RTO_MODEL_SOURCE_LINE   = RTOMLine
    and md.demand_source_header_id = dSrcHdrId
    and md.demand_source_type      = dSrcType
    and md.organization_id         = OrgId
    and md.primary_uom_quantity    > 0
    and md.config_status           = 80
    and md.row_status_flag         = 2
    and md.demand_type not in (1,2);
Line: 109

  the mandatory components that have been inserted (derived demand)
  in mtl_demand by the Schedule function, as part of
  'link Config' action
+----------------------------------------------------------------*/

        select inventory_item_id,
               organization_id,
               demand_id,
               primary_uom_quantity,
               uom_code,
               requirement_date,
               demand_class,
               temp,      -- calling module
               temp,      -- customer_id
               temp,      -- customer_site_id
               temp,      -- destination_time_zone
               temp1,     -- requested arrival_date
               temp1,     -- latest acceptable_date
               temp,      -- delivery lead time
               temp,      -- Freight_Carrier
               temp,      -- Ship_Method
               temp,      --Ship_Set_Name
               temp,      -- Arrival_Set_Name
               temp,      -- Override_Flag
               temp,      -- Action
               temp1,     -- Ship_date
               temp,      -- available_quantity
               temp,      -- requested_date_quantity
               temp1,     -- group_ship_date
               temp1,     -- group_arrival_date
               temp,      -- vendor_id
               temp,      -- vendor_site_id
               temp,      -- insert_flag
               temp,      -- error_code
               temp       -- Message
        bulk collect into
               p_atp_table.Inventory_Item_Id       ,
               p_atp_table.Source_Organization_Id  ,
               p_atp_table.Identifier              ,
               p_atp_table.Quantity_Ordered        ,
               p_atp_table.Quantity_UOM            ,
               p_atp_table.Requested_Ship_Date     ,
               p_atp_table.Demand_Class            ,
               p_atp_table.Calling_Module          ,
               p_atp_table.Customer_Id             ,
               p_atp_table.Customer_Site_Id        ,
               p_atp_table.Destination_Time_Zone   ,
               p_atp_table.Requested_Arrival_Date  ,
               p_atp_table.Latest_Acceptable_Date  ,
               p_atp_table.Delivery_Lead_Time      ,
               p_atp_table.Freight_Carrier         ,
               p_atp_table.Ship_Method             ,
               p_atp_table.Ship_Set_Name           ,
               p_atp_table.Arrival_Set_Name        ,
               p_atp_table.Override_Flag           ,
               p_atp_table.Action                  ,
               p_atp_table.Ship_Date               ,
               p_atp_table.Available_Quantity      ,
               p_atp_table.Requested_Date_Quantity ,
               p_atp_table.Group_Ship_Date         ,
               p_atp_table.Group_Arrival_Date      ,
               p_atp_table.Vendor_Id               ,
               p_atp_table.Vendor_Site_Id          ,
               p_atp_table.Insert_Flag             ,
               p_atp_table.Error_Code              ,
               p_atp_table.Message
        from mtl_demand md
        where md.RTO_MODEL_SOURCE_LINE = RTOMLine
        and   md.DEMAND_SOURCE_HEADER_ID = dSrcHdrId
        and   md.DEMAND_SOURCE_TYPE = dSrcType
        and   md.ORGANIZATION_ID = OrgId
        and   md.PRIMARY_UOM_QUANTITY > 0
        and   md.config_status =20
        and   md.demand_type in (4,5)
        and   md.row_status_flag = 1
        and   md.parent_demand_id is null;
Line: 251

     that will be deleted by the Schedule function, as part of
     'delink Config' action
   +----------------------------------------------------------------*/
   stmt := 10;
Line: 255

   select inventory_item_id,
       organization_id,
       demand_id,
       primary_uom_quantity,
       uom_code,
       requirement_date,
       demand_class,
       temp,      -- calling module
       temp,      -- customer_id
       temp,      -- customer_site_id
       temp,      -- destination_time_zone
       temp1,     -- requested arrival_date
       temp1,     -- latest acceptable_date
       temp,      -- delivery lead time
       temp,      -- Freight_Carrier
       temp,      -- Ship_Method
       temp,      --Ship_Set_Name
       temp,      -- Arrival_Set_Name
       temp,      -- Override_Flag
       temp,      -- Action
       temp1,     -- Ship_date
       temp,      -- available_quantity
       temp,      -- requested_date_quantity
       temp1,     -- group_ship_date
       temp1,     -- group_arrival_date
       temp,      -- vendor_id
       temp,      -- vendor_site_id
       temp,      -- insert_flag
       temp,      -- error_code
       temp       -- Message
   bulk collect into
       p_atp_table.Inventory_Item_Id       ,
       p_atp_table.Source_Organization_Id  ,
       p_atp_table.Identifier              ,
       p_atp_table.Quantity_Ordered        ,
       p_atp_table.Quantity_UOM            ,
       p_atp_table.Requested_Ship_Date     ,
       p_atp_table.Demand_Class            ,
       p_atp_table.Calling_Module          ,
       p_atp_table.Customer_Id             ,
       p_atp_table.Customer_Site_Id        ,
       p_atp_table.Destination_Time_Zone   ,
       p_atp_table.Requested_Arrival_Date  ,
       p_atp_table.Latest_Acceptable_Date  ,
       p_atp_table.Delivery_Lead_Time      ,
       p_atp_table.Freight_Carrier         ,
       p_atp_table.Ship_Method             ,
       p_atp_table.Ship_Set_Name           ,
       p_atp_table.Arrival_Set_Name        ,
       p_atp_table.Override_Flag           ,
       p_atp_table.Action                  ,
       p_atp_table.Ship_Date               ,
       p_atp_table.Available_Quantity      ,
       p_atp_table.Requested_Date_Quantity ,
       p_atp_table.Group_Ship_Date         ,
       p_atp_table.Group_Arrival_Date      ,
       p_atp_table.Vendor_Id               ,
       p_atp_table.Vendor_Site_Id          ,
       p_atp_table.Insert_Flag             ,
       p_atp_table.Error_Code              ,
       p_atp_table.Message
   from mtl_demand md
   where md.RTO_MODEL_SOURCE_LINE = RTOMLine
   and md.demand_source_header_id = dSrcHdrId
   and md.demand_source_type = dSrcType
   and md.organization_id = OrgId
   and md.config_status = 20
   and md.row_status_flag = 1
   and md.parent_demand_id is null
   and md.primary_uom_quantity > 0
   and md.demand_type  in (4,5);
Line: 333

   select inventory_item_id,
       organization_id,
       demand_id,
       primary_uom_quantity,
       uom_code,
       requirement_date,
       demand_class,
       temp,      -- calling module
       temp,      -- customer_id
       temp,      -- customer_site_id
       temp,      -- destination_time_zone
       temp1,     -- requested arrival_date
       temp1,     -- latest acceptable_date
       temp,      -- delivery lead time
       temp,      -- Freight_Carrier
       temp,      -- Ship_Method
       temp,      --Ship_Set_Name
       temp,      -- Arrival_Set_Name
       temp,      -- Override_Flag
       temp,      -- Action
       temp1,     -- Ship_date
       temp,      -- available_quantity
       temp,      -- requested_date_quantity
       temp1,     -- group_ship_date
       temp1,     -- group_arrival_date
       temp,      -- vendor_id
       temp,      -- vendor_site_id
       temp,      -- insert_flag
       temp,      -- error_code
       temp       -- Message
   bulk collect into
       p_atp_table.Inventory_Item_Id       ,
       p_atp_table.Source_Organization_Id  ,
       p_atp_table.Identifier              ,
       p_atp_table.Quantity_Ordered        ,
       p_atp_table.Quantity_UOM            ,
       p_atp_table.Requested_Ship_Date     ,
       p_atp_table.Demand_Class            ,
       p_atp_table.Calling_Module          ,
       p_atp_table.Customer_Id             ,
       p_atp_table.Customer_Site_Id        ,
       p_atp_table.Destination_Time_Zone   ,
       p_atp_table.Requested_Arrival_Date  ,
       p_atp_table.Latest_Acceptable_Date  ,
       p_atp_table.Delivery_Lead_Time      ,
       p_atp_table.Freight_Carrier         ,
       p_atp_table.Ship_Method             ,
       p_atp_table.Ship_Set_Name           ,
       p_atp_table.Arrival_Set_Name        ,
       p_atp_table.Override_Flag           ,
       p_atp_table.Action                  ,
       p_atp_table.Ship_Date               ,
       p_atp_table.Available_Quantity      ,
       p_atp_table.Requested_Date_Quantity ,
       p_atp_table.Group_Ship_Date         ,
       p_atp_table.Group_Arrival_Date      ,
       p_atp_table.Vendor_Id               ,
       p_atp_table.Vendor_Site_Id          ,
       p_atp_table.Insert_Flag             ,
       p_atp_table.Error_Code              ,
       p_atp_table.Message
   from mtl_demand md
   where md.rto_model_source_line = RTOMLine
   and   md.demand_source_header_id = dSrcHdrId
   and   md.demand_source_type = dSrcType
   and   md.organization_id = orgId
   and   md.primary_uom_quantity > 0
   and   md.config_status =80
   and   md.row_status_flag = 2;