DBA Data[Home] [Help]

APPS.MSC_CL_CONT_COLL_FW SQL Statements

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

Line: 336

				   SELECT FND_GLOBAL.APPLICATION_NAME
					 INTO   lv_application_name
					 FROM   dual;
Line: 340

				   SELECT APPLICATION_ID
				   INTO   lv_application_id
				   FROM   FND_APPLICATION_VL
				   WHERE  APPLICATION_NAME = lv_application_name;
Line: 362

						lv_sql_stmt:=' SELECT 1 '
							||' FROM mtl_parameters'||p_dblink||' mp,'
							||'      msc_instance_orgs mio'
							||' WHERE mio.sr_instance_id= :p_instance_id'
							||' AND ' || lv_cond_str_enabled_flag
							||' AND mio.organization_id=mp.organization_id'
							||' AND mp.process_enabled_flag='||'''Y'''
							||  lv_cond_str_org_grp
							||' AND ROWNUM <2 ';
Line: 449

      select apps_lrn
      into lv_apps_lrn
      from msc_apps_instances
      where instance_id = p_instance_id;
Line: 454

      select min(nvl(supplier_capacity_lrn,lv_apps_lrn)),
             min(nvl(bom_lrn,lv_apps_lrn)),
             min(nvl(bor_lrn,lv_apps_lrn)),
             min(nvl(forecast_lrn,lv_apps_lrn)),
             min(nvl(item_lrn,lv_apps_lrn)),
             min(nvl(mds_lrn,lv_apps_lrn)),
             min(nvl(mps_lrn,lv_apps_lrn)),
             min(nvl(oh_lrn,lv_apps_lrn)),
             min(nvl(reservations_lrn,lv_apps_lrn)),
             min(nvl(po_lrn,lv_apps_lrn)),
             min(nvl(so_lrn,lv_apps_lrn)),
             min(nvl(user_supply_demand_lrn,lv_apps_lrn)),
             min(nvl(wip_lrn,lv_apps_lrn)),
             min(nvl(nra_lrn,lv_apps_lrn)),
             min(nvl(saf_stock_lrn,lv_apps_lrn)),
             min(nvl(unit_no_lrn,lv_apps_lrn)),
             min(nvl(uom_lrn,lv_apps_lrn)),
             min(nvl(calendar_lrn,lv_apps_lrn)),
             min(nvl(trip_lrn,lv_apps_lrn))
      into
             lv_sup_cap_lrn,
             lv_bom_lrn,
             lv_bor_lrn,
             lv_forecast_lrn,
             lv_item_lrn,
             lv_mds_lrn,
             lv_mps_lrn,
             lv_oh_lrn,
             lv_rsv_lrn,
             lv_po_lrn,
             lv_so_lrn,
             lv_usd_lrn,
             lv_wip_lrn,
             lv_nra_lrn,
             lv_saf_stock_lrn,
             lv_unit_no_lrn,
             lv_uom_lrn,
             lv_calendar_lrn,
             lv_trip_lrn
       from   msc_instance_orgs
       WHERE ((p_org_group =MSC_UTIL.G_ALL_ORGANIZATIONS) or (org_group=p_org_group))
       AND   sr_instance_id = p_instance_id;
Line: 562

               lv_sql_stmt:= 'select count(*)  from MRP_AD_SUPPLIER_CAPACITIES_V'||p_dblink
                           ||'  where RN > :lv_sup_cap_lrn '
                           ||'  and organization_id '|| lv_in_org_str;
Line: 569

               lv_sql_stmt:= 'select count(*)  '
                           ||' from MRP_AP_SUPPLIER_CAPACITIES_V'||p_dblink||'  x '
                           ||' where (    x.RN1 > :lv_sup_cap_lrn '
                           ||'        OR x.RN2 > :lv_sup_cap_lrn ) '
                           ||' and x.organization_id '|| lv_in_org_str;
Line: 580

               lv_sql_stmt:= 'select count(*)  from MRP_AP_SUPPLIER_CAPACITIES_V'||p_dblink
                           ||' where organization_id '|| lv_in_org_str;
Line: 599

                    lv_sql_stmt:= 'select count(*)  from MRP_AD_PO_SUPPLIES_V'||p_dblink
                            ||' where RN > :lv_po_lrn'
                            ||' and organization_id '|| lv_in_org_str;
Line: 607

                   lv_sql_stmt:= 'select count(*)  '
                            ||' from MRP_AP_PO_PO_SUPPLY_V'||p_dblink||' x '
                            ||' where (    x.RN2 > :lv_po_lrn '
                            ||'        OR x.RN3 > :lv_po_lrn ) '
                            ||' and x.organization_id '|| lv_in_org_str;
Line: 617

                   lv_sql_stmt:= 'select count(*)  '
                            ||' from  MRP_AP_PO_SHIP_SUPPLY_V'||p_dblink||'  x '
                            ||' where (    x.RN2 > :lv_po_lrn '
                            ||'        OR x.RN3 > :lv_po_lrn )'
                            ||' and x.organization_id '|| lv_in_org_str;
Line: 627

                   lv_sql_stmt:= 'select count(*) '
                            ||' from  MRP_AP_PO_REQ_SUPPLY_V'||p_dblink||' x '
                            ||' where (    x.RN2 > :lv_po_lrn '
                            ||'        OR x.RN3 > :lv_po_lrn )'
                            ||' and x.organization_id '|| lv_in_org_str;
Line: 637

                    lv_sql_stmt:= 'select count(*) '
                            ||' from  MRP_AP_PO_SHIP_RCV_SUPPLY_V'||p_dblink||'  x '
                            ||' where (    x.RN2 > :lv_po_lrn  '
                            ||'        OR x.RN3 > :lv_po_lrn ) '
                            ||' and x.organization_id '|| lv_in_org_str;
Line: 647

                      lv_sql_stmt:= 'select count(*) '
                            ||' from   MRP_AP_PO_RCV_SUPPLY_V'||p_dblink||'  x '
                            ||' where (    x.RN2 > :lv_po_lrn  '
                            ||'        OR x.RN3 > :lv_po_lrn ) '
                            ||' and x.organization_id '|| lv_in_org_str;
Line: 658

                       lv_sql_stmt:= 'select count(*)  '
                            ||' from  MRP_AP_INTRANSIT_SUPPLIES_V'||p_dblink||'  x '
                            ||' where   x.RN2 > :lv_po_lrn '
                            ||' and x.organization_id '|| lv_in_org_str;
Line: 668

                       lv_sql_stmt:= 'select count(*)  from MRP_AP_PO_PO_SUPPLY_V'||p_dblink
                            ||' where organization_id '|| lv_in_org_str;
Line: 673

                       lv_sql_stmt:= 'select count(*)  from MRP_AP_PO_SHIP_SUPPLY_V'||p_dblink
                            ||' where organization_id  '|| lv_in_org_str;
Line: 678

                       lv_sql_stmt:= 'select count(*)  from MRP_AP_PO_REQ_SUPPLY_V'||p_dblink
                            ||' where organization_id '|| lv_in_org_str;
Line: 683

                       lv_sql_stmt:= 'select count(*)  from MRP_AP_PO_SHIP_RCV_SUPPLY_V'||p_dblink
                            ||' where organization_id '|| lv_in_org_str;
Line: 688

                       lv_sql_stmt:= 'select count(*)  from MRP_AP_PO_RCV_SUPPLY_V'||p_dblink
                            ||' where organization_id '|| lv_in_org_str;
Line: 693

                       lv_sql_stmt:= 'select count(*)  from MRP_AP_INTRANSIT_SUPPLIES_V'||p_dblink
                            ||' where organization_id '|| lv_in_org_str;
Line: 730

                     lv_sql_stmt:= 'select count(*)  from MRP_AD_TRIPS_V'||p_dblink
                            ||' where RN > :lv_trip_lrn ';
Line: 736

                    lv_sql_stmt:= 'select count(*)  '
                                ||' from MRP_AP_TRIPS_V'||p_dblink||'  x '
                                ||' where     x.RN > :lv_trip_lrn  ';
Line: 744

                    lv_sql_stmt:= 'select count(*)  from MRP_AP_TRIPS_V'||p_dblink;
Line: 760

                     lv_sql_stmt:= 'select count(*)  from MRP_AD_TRIP_STOPS_V'||p_dblink
                            ||' where RN > :lv_trip_lrn ';
Line: 766

                    lv_sql_stmt:= 'select count(*)  '
                                ||' from MRP_AP_TRIP_STOPS_V'||p_dblink||'  x '
                                ||' where     x.RN > :lv_trip_lrn  ';
Line: 774

                    lv_sql_stmt:= 'select count(*)  from MRP_AP_TRIP_STOPS_V'||p_dblink;
Line: 795

      select apps_lrn
      into lv_apps_lrn
      from msc_apps_instances
      where instance_id = p_instance_id;
Line: 800

      select min(nvl(supplier_capacity_lrn,lv_apps_lrn)),
             min(nvl(bom_lrn,lv_apps_lrn)),
             min(nvl(bor_lrn,lv_apps_lrn)),
             min(nvl(forecast_lrn,lv_apps_lrn)),
             min(nvl(item_lrn,lv_apps_lrn)),
             min(nvl(mds_lrn,lv_apps_lrn)),
             min(nvl(mps_lrn,lv_apps_lrn)),
             min(nvl(oh_lrn,lv_apps_lrn)),
             min(nvl(reservations_lrn,lv_apps_lrn)),
             min(nvl(po_lrn,lv_apps_lrn)),
             min(nvl(so_lrn,lv_apps_lrn)),
             min(nvl(user_supply_demand_lrn,lv_apps_lrn)),
             min(nvl(wip_lrn,lv_apps_lrn)),
             min(nvl(nra_lrn,lv_apps_lrn)),
             min(nvl(saf_stock_lrn,lv_apps_lrn)),
             min(nvl(unit_no_lrn,lv_apps_lrn)),
             min(nvl(uom_lrn,lv_apps_lrn)),
             min(nvl(calendar_lrn,lv_apps_lrn)),
             min(nvl(trip_lrn,lv_apps_lrn))
      into
             lv_sup_cap_lrn,
             lv_bom_lrn,
             lv_bor_lrn,
             lv_forecast_lrn,
             lv_item_lrn,
             lv_mds_lrn,
             lv_mps_lrn,
             lv_oh_lrn,
             lv_rsv_lrn,
             lv_po_lrn,
             lv_so_lrn,
             lv_usd_lrn,
             lv_wip_lrn,
             lv_nra_lrn,
             lv_saf_stock_lrn,
             lv_unit_no_lrn,
             lv_uom_lrn,
             lv_calendar_lrn,
             lv_trip_lrn
       from   msc_instance_orgs
       WHERE ((p_org_group =MSC_UTIL.G_ALL_ORGANIZATIONS) or (org_group=p_org_group))
       AND   sr_instance_id = p_instance_id;
Line: 848

        SELECT MSC_UTIL.SYS_YES
        INTO   lv_status_decided_bom
        FROM   fnd_lookup_values
        WHERE  lookup_type = 'MSC_COLL_SNAPSHOTS' AND
	   	             enabled_flag = 'Y' AND
	   	             view_application_id = 700 AND
	   	             language = userenv('lang') AND
	   	             attribute2 in
	   	                  ('BOM_BOMS_SN', 'BOM_INV_COMPS_SN', 'BOM_OPR_NETWORKS_SN',
	   	                   'BOM_OPR_RESS_SN', 'BOM_OPR_RTNS_SN', 'BOM_OPR_SEQS_SN',
                                   'BOM_RES_CHNGS_SN', 'BOM_RES_INST_CHNGS_SN', 'BOM_SUB_COMPS_SN',
                                   'BOM_SUB_OPR_RESS_SN', 'MTL_SYS_ITEMS_SN') AND
                             attribute13 = 'COMPLETE' AND
                             rownum = 1;
Line: 869

       lv_sql_stmt:= '  select count(*) from MRP_AD_BOM_COMPONENTS_V'||p_dblink
                   ||'  where RN > :lv_bom_lrn '
                   ||'  and organization_id '|| lv_in_org_str;
Line: 876

       lv_sql_stmt:= '  select count(*)  '
                   ||'  from MRP_AP_BOM_COMPONENTS_V'||p_dblink||'  x '
                   ||'  where (    x.RN1 > :lv_bom_lrn '
                   ||'        OR x.RN2 > :lv_bom_lrn '
                   ||'        OR x.RN3 > :lv_bom_lrn '
                   ||'        OR x.RN4 > :lv_bom_lrn )'
                   ||'  and x.organization_id '|| lv_in_org_str;
Line: 891

       lv_sql_stmt:= ' select count(*) from MRP_AP_BOM_COMPONENTS_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 908

       lv_sql_stmt:= 'select count(*) from MRP_AD_BOMS_V'||p_dblink
                   ||' where RN > :lv_bom_lrn'
                   ||' and organization_id '|| lv_in_org_str;
Line: 915

       lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AP_BOMS_V'||p_dblink||'  x '
                   ||' where (    x.RN1 > :lv_bom_lrn '
                   ||'        OR x.RN2 > :lv_bom_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 925

       lv_sql_stmt:= 'select count(*) from MRP_AP_BOMS_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 939

       lv_sql_stmt:= 'select count(*) from MRP_AD_SUB_COMPS_V'||p_dblink
                   ||' where RN > :lv_bom_lrn'
                   ||' and organization_id '|| lv_in_org_str;
Line: 945

       lv_sql_stmt:= ' select count(*)  '
                   ||' from MRP_AP_COMPONENT_SUBSTITUTES_V'||p_dblink||'  x '
                   ||' where (    x.RN1 > :lv_bom_lrn '
                   ||'        OR x.RN2 > :lv_bom_lrn '
                   ||'        OR x.RN3 > :lv_bom_lrn '
                   ||'        OR x.RN4 > :lv_bom_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 959

       lv_sql_stmt:= 'select count(*)  from MRP_AP_COMPONENT_SUBSTITUTES_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 973

       lv_sql_stmt:= 'select count(*) from MRP_AD_ROUTINGS_V'||p_dblink
                   ||' where RN > :lv_bom_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 980

       lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AP_ROUTINGS_V'||p_dblink||' x '
                   ||' where (    x.RN1 > :lv_bom_lrn '
                   ||'        OR x.RN2 > :lv_bom_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 990

       lv_sql_stmt:= 'select count(*) from MRP_AP_ROUTINGS_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1003

      lv_sql_stmt:= 'select count(*) from MRP_AD_OPER_NETWORKS_V'||p_dblink
                   ||' where RN > :lv_bom_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 1010

       lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AP_OPER_NETWORKS_V'||p_dblink||' x '
                   ||' where (    x.RN2 > :lv_bom_lrn '
                   ||'        OR x.RN3 > :lv_bom_lrn  '
                   ||'        OR x.RN4 > :lv_bom_lrn '
                   ||'        OR x.RN5 > :lv_bom_lrn '
                   ||'        OR x.RN6 > :lv_bom_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1026

       lv_sql_stmt:= ' select count(*) from MRP_AP_BOM_COMPONENTS_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1041

       lv_sql_stmt:= 'select count(*) from MRP_AD_ROUTING_OPERATIONS_V'||p_dblink
                   ||' where RN > :lv_bom_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 1048

       lv_sql_stmt:= 'select count(*)  '
                   ||'  from MRP_AP_ROUTING_OPERATIONS_V'||p_dblink||' x '
                   ||'  where (    x.RN1 > :lv_bom_lrn '
                   ||'        OR x.RN2 > :lv_bom_lrn '
                   ||'        OR x.RN3 > :lv_bom_lrn ) '
                   ||'  and x.organization_id '|| lv_in_org_str;
Line: 1061

       lv_sql_stmt:= 'select count(*) from MRP_AP_ROUTING_OPERATIONS_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1075

       lv_sql_stmt:= 'select count(*)  from MRP_AD_OP_RESOURCE_SEQS_V'||p_dblink
                   ||' where RN > :lv_bom_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 1082

       lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AP_OP_RESOURCE_SEQS_V'||p_dblink||'  x '
                   ||' where (    x.RN2 > :lv_bom_lrn '
                   ||'        OR x.RN3 > :lv_bom_lrn '
                   ||'        OR x.RN4 > :lv_bom_lrn '
                   ||'        OR x.RN5 > :lv_bom_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1097

       lv_sql_stmt:= 'select count(*)  from MRP_AP_OP_RESOURCE_SEQS_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1111

       lv_sql_stmt:= 'select count(*) from MRP_AD_OPERATION_RESOURCES_V'||p_dblink
                   ||' where RN > :lv_bom_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 1118

         lv_sql_stmt:= 'select count(*) from MRP_AD_SUB_OPER_RESS_V'||p_dblink
                   ||' where RN > :lv_bom_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 1126

       lv_sql_stmt:= 'select count(*) '
                   ||' from MRP_AP_OPERATION_RESOURCES_V'||p_dblink||'  x '
                   ||' where (    x.RN2 > :lv_bom_lrn '
                   ||'        OR x.RN3 > :lv_bom_lrn '
                   ||'        OR x.RN4 > :lv_bom_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1139

       lv_sql_stmt:= 'select count(*) from MRP_AP_OP_RESOURCE_SEQS_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1160

       lv_sql_stmt:= 'select count(*)  from MRP_AD_RESOURCE_REQUIREMENTS_V'||p_dblink
                   ||' where RN > :lv_wip_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 1167

       lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AP_RESOURCE_REQUIREMENTS_V'||p_dblink||' x '
                   ||' where (    x.RN1 > :lv_wip_lrn '
                   ||'        OR x.RN2 > :lv_wip_lrn '
                   ||'        OR x.RN3 > :lv_wip_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1180

       lv_sql_stmt:= 'select count(*)  from MRP_AP_RESOURCE_REQUIREMENTS_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1185

         lv_sql_stmt:= 'select count(*)  from MRP_AD_DJOB_SUB_OP_RESOURCES_V'||p_dblink
                   ||' where RN > :lv_wip_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 1192

       lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AP_DJOB_SUB_OP_RESOURCES_V'||p_dblink||' x '
                   ||' where (    x.RN1 > :lv_wip_lrn '
                   ||' OR x.RN2 > :lv_wip_lrn '
                   ||' OR x.RN3 > :lv_wip_lrn )'
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1205

       lv_sql_stmt:= 'select count(*)  from MRP_AP_DJOB_SUB_OP_RESOURCES_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1211

	      lv_sql_stmt:= 'select count(*)  from MRP_AD_RES_INSTANCE_REQS_V'||p_dblink
                   ||' where RN > :lv_wip_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 1219

              lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AP_RES_INSTANCE_REQS_V'||p_dblink||' x '
                   ||' where (    x.RN1 > :lv_wip_lrn '
                   ||'        OR x.RN2 > :lv_wip_lrn '
                   ||'        OR x.RN3 > :lv_wip_lrn '
                   ||'        OR x.RN4 > :lv_wip_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1234

               lv_sql_stmt:= 'select count(*)  from MRP_AP_RES_INSTANCE_REQS_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1257

       lv_sql_stmt:= 'select count(*)  from MRP_AD_OPERATION_COMPONENTS_V'||p_dblink
                   ||' where RN > :lv_bom_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 1264

       lv_sql_stmt:= ' select count(*)  '
                   ||' from MRP_AP_OPERATION_COMPONENTS_V'||p_dblink||' x '
                   ||' where (    x.RN1 > :lv_bom_lrn '
                   ||'        OR x.RN2 > :lv_bom_lrn '
                   ||'        OR x.RN3 > :lv_bom_lrn '
                   ||'        OR x.RN4 > :lv_bom_lrn '
                   ||'        OR x.RN5 > :lv_bom_lrn '
                   ||'        OR x.RN6 > :lv_bom_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1281

       lv_sql_stmt:= 'select count(*)  from MRP_AP_OPERATION_COMPONENTS_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1295

       lv_sql_stmt:= 'select count(*)  from MRP_AD_PROCESS_EFFECTIVITY_V'||p_dblink
                   ||' where RN > :lv_bom_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 1302

       lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AP_PROCESS_EFFECTIVITY_V'||p_dblink||'  x '
                   ||' where (    x.RN2 > :lv_bom_lrn '
                   ||'        OR x.RN3 > :lv_bom_lrn '
                   ||'        OR x.RN4 > :lv_bom_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1314

       lv_sql_stmt:= 'select count(*)  from MRP_AP_PROCESS_EFFECTIVITY_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1332

          SELECT MSC_UTIL.SYS_YES
          INTO   lv_status_decided_bor
          FROM   fnd_lookup_values
          WHERE  lookup_type = 'MSC_COLL_SNAPSHOTS' AND
                    enabled_flag = 'Y' AND
                    view_application_id = 700 AND
                    language = userenv('lang') AND
                    attribute2 = 'MTL_SYS_ITEMS_SN' AND
                    attribute13 = 'COMPLETE' AND
                    rownum = 1;
Line: 1348

          lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AP_CRP_RESOURCE_HOURS_V'||p_dblink||'  x '
                   ||' where x.RN2 > :lv_bor_lrn '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1357

          lv_sql_stmt:= 'select count(*)  from MRP_AP_CRP_RESOURCE_HOURS_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1376

        SELECT MSC_UTIL.SYS_YES
        INTO   lv_status_decided_item
        FROM   fnd_lookup_values
        WHERE  lookup_type = 'MSC_COLL_SNAPSHOTS' AND
                  enabled_flag = 'Y' AND
                  view_application_id = 700 AND
                  language = userenv('lang') AND
                  attribute2 IN( 'MTL_SYS_ITEMS_SN','MTL_ITEM_CATS_SN') AND
                  attribute13 = 'COMPLETE' AND
                  rownum = 1;
Line: 1394

         lv_sql_stmt:= 'select count(*)  from MRP_AD_ITEM_CATEGORIES_V'||p_dblink
                   ||' where RN > :lv_item_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 1401

          lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AP_ITEM_CATEGORIES_V'||p_dblink||'  x '
                   ||' where (    x.RN1 > :lv_item_lrn '
                   ||'        OR x.RN2 > :lv_item_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1411

        lv_sql_stmt:= 'select count(*)  from MRP_AP_ITEM_CATEGORIES_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1429

        lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AP_SYSTEM_ITEMS_V'||p_dblink||'  x '
                   ||' where x.RN1 > :lv_item_lrn '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1438

        lv_sql_stmt:= 'select count(*)  from MRP_AP_SYSTEM_ITEMS_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1454

        SELECT MSC_UTIL.SYS_YES
        INTO   lv_status_decided_oh
        FROM   fnd_lookup_values
        WHERE  lookup_type = 'MSC_COLL_SNAPSHOTS' AND
                  enabled_flag = 'Y' AND
                  view_application_id = 700 AND
                  language = userenv('lang') AND
                  attribute2 IN('MTL_OH_QTYS_SN', 'MTL_SYS_ITEMS_SN') AND
                  attribute13 = 'COMPLETE' AND
                  rownum = 1;
Line: 1470

        lv_sql_stmt:= 'select count(*)  from MRP_AD_ONHAND_SUPPLIES_V'||p_dblink
                   ||' where RN > :lv_oh_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 1477

        lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AP_ONHAND_SUPPLIES_V'||p_dblink||'  x '
                   ||' where (    x.RN1 > :lv_oh_lrn '
                   ||'        OR x.RN2 > :lv_oh_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1488

        lv_sql_stmt:= 'select count(*)  from MRP_AP_ONHAND_SUPPLIES_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1506

        SELECT MSC_UTIL.SYS_YES
        INTO   lv_status_decided_usup
        FROM   fnd_lookup_values
        WHERE  lookup_type = 'MSC_COLL_SNAPSHOTS' AND
                  enabled_flag = 'Y' AND
                  view_application_id = 700 AND
                  language = userenv('lang') AND
                  attribute2 IN ('MTL_U_SUPPLY_SN', 'MTL_SYS_ITEMS_SN') AND
                  attribute13 = 'COMPLETE' AND
                  rownum = 1;
Line: 1523

           lv_sql_stmt:= 'select count(*)  from MRP_AD_USER_SUPPLIES_V'||p_dblink
                   ||' where RN > :lv_usd_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 1530

       lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AP_USER_SUPPLIES_V'||p_dblink||' x '
                   ||' where (    x.RN1 > :lv_usd_lrn '
                   ||'        OR x.RN2 > :lv_usd_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1541

       lv_sql_stmt:= 'select count(*)  from MRP_AP_USER_SUPPLIES_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1553

        SELECT MSC_UTIL.SYS_YES
        INTO   lv_status_decided_udem
        FROM   fnd_lookup_values
        WHERE  lookup_type = 'MSC_COLL_SNAPSHOTS' AND
                  enabled_flag = 'Y' AND
                  view_application_id = 700 AND
                  language = userenv('lang') AND
                  attribute2 IN ('MTL_U_DEMAND_SN', 'MTL_SYS_ITEMS_SN') AND
                  attribute13 = 'COMPLETE' AND
                  rownum = 1;
Line: 1570

           lv_sql_stmt:= 'select count(*)  from MRP_AD_USER_DEMANDS_V'||p_dblink
                   ||' where RN > :lv_usd_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 1577

       lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AP_USER_DEMANDS_V'||p_dblink||'  x '
                   ||' where (    x.RN1 > :lv_usd_lrn '
                   ||'        OR x.RN2 > :lv_usd_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1588

       lv_sql_stmt:= 'select count(*)  from MRP_AP_USER_DEMANDS_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1605

        SELECT MSC_UTIL.SYS_YES
        INTO   lv_status_decided_so
        FROM   fnd_lookup_values
        WHERE  lookup_type = 'MSC_COLL_SNAPSHOTS' AND
                  enabled_flag = 'Y' AND
                  view_application_id = 700 AND
                  language = userenv('lang') AND
                  attribute2 IN ('MTL_DEMAND_SN', 'OE_ODR_LINES_SN', 'MTL_SYS_ITEMS_SN') AND
                  attribute13 = 'COMPLETE' AND
                  rownum = 1;
Line: 1621

          lv_sql_stmt:= 'select count(*)  from MRP_AD_HARD_RESERVATIONS_V'||p_dblink
                   ||' where RN > :lv_rsv_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 1629

          lv_sql_stmt:= 'select count(*)  from MRP_AD_SALES_ORDERS_V'||p_dblink
                   ||' where RN > :lv_so_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 1639

          lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AN1_SALES_ORDERS_V'||p_dblink||'  x '
                   ||' where (    x.RN1 > :lv_so_lrn '
                   ||'        OR x.RN2 > :lv_so_lrn '
                   ||'        OR x.RN3 > :lv_so_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1651

          lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AN2_SALES_ORDERS_V'||p_dblink||'  x '
                   ||' where (    x.RN1 > :lv_so_lrn '
                   ||'        OR x.RN2 > :lv_so_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1661

            lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AN3_SALES_ORDERS_V'||p_dblink||'  x '
                   ||' where (    x.RN1 > :lv_so_lrn '
                   ||'        OR x.RN2 > :lv_so_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1671

             lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AN4_SALES_ORDERS_V'||p_dblink||'  x '
                   ||' where (    x.RN1 > :lv_so_lrn '
                   ||'        OR x.RN2 > :lv_so_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1684

              lv_sql_stmt:= 'select count(*)  from MRP_AP1_SALES_ORDERS_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1689

              lv_sql_stmt:= 'select count(*)  from MRP_AP2_SALES_ORDERS_V'||p_dblink
                   ||'  where organization_id '|| lv_in_org_str;
Line: 1694

              lv_sql_stmt:= 'select count(*)  from MRP_AP3_SALES_ORDERS_V'||p_dblink
                   ||'  where organization_id '|| lv_in_org_str;
Line: 1699

              lv_sql_stmt:= 'select count(*)  from MRP_AP4_SALES_ORDERS_V'||p_dblink
                   ||'  where organization_id '|| lv_in_org_str;
Line: 1717

        SELECT MSC_UTIL.SYS_YES
        INTO   lv_status_decided_fcst
        FROM   fnd_lookup_values
        WHERE  lookup_type = 'MSC_COLL_SNAPSHOTS' AND
                  enabled_flag = 'Y' AND
                  view_application_id = 700 AND
                  language = userenv('lang') AND
                  attribute2 = 'MRP_FORECAST_DSGN_SN' AND
                  attribute13 = 'COMPLETE' AND
                  rownum = 1;
Line: 1735

       lv_sql_stmt:= 'select count(*)  from MRP_AD_FORECAST_DSGN_V'||p_dblink
                   ||'  where RN > :lv_forecast_lrn '
                   ||'  and organization_id '|| lv_in_org_str;
Line: 1742

       lv_sql_stmt:= 'select count(*) '
                   ||' from MRP_AP_FORECAST_DSGN_V'||p_dblink||'  x'
                   ||' where x.RN1 > :lv_forecast_lrn '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 1750

       lv_sql_stmt:= 'select count(*)  from MRP_AP_FORECAST_DSGN_V'||p_dblink
                   ||'  where organization_id '|| lv_in_org_str;
Line: 1759

       lv_sql_stmt:= 'select count(*)  from MRP_AD_FORECAST_DEMAND_V'||p_dblink
                ||'  where RN > :lv_forecast_lrn '
                ||'  and organization_id '|| lv_in_org_str;
Line: 1766

    lv_sql_stmt:= 'select count(*) '
                ||' from MRP_AP_FORECAST_DEMAND_V'||p_dblink||'  x'
                ||' where x.RN1 > :lv_forecast_lrn '
                ||' and x.organization_id '|| lv_in_org_str;
Line: 1774

    lv_sql_stmt:= 'select count(*)  from MRP_AP_FORECAST_DEMAND_V'||p_dblink
                ||'  where organization_id '|| lv_in_org_str;
Line: 1792

       SELECT MSC_UTIL.SYS_YES
       INTO   lv_status_decided_wip
       FROM   fnd_lookup_values
       WHERE  lookup_type = 'MSC_COLL_SNAPSHOTS' AND
                 enabled_flag = 'Y' AND
                 view_application_id = 700 AND
                 language = userenv('lang') AND
                 attribute2 IN
                         ('WIP_DSCR_JOBS_SN', 'WIP_FLOW_SCHDS_SN', 'WIP_OPR_RES_INSTS_SN', 'MTL_SYS_ITEMS_SN',
                         'WIP_REPT_ITEMS_SN', 'WIP_REPT_SCHDS_SN', 'WIP_WLINES_SN', 'WIP_WOPR_NETWORKS_SN',
                         'WIP_WOPR_RESS_SN', 'WIP_WOPR_SUB_RESS_SN', 'WIP_WOPRS_SN', 'WIP_WREQ_OPRS_SN') AND
                 attribute13 = 'COMPLETE' AND
                 rownum = 1;
Line: 1813

         lv_sql_stmt:= 'select count(*)  from MRP_AD_WIP_JOB_SUPPLIES_V'||p_dblink
                ||'  where RN > :lv_wip_lrn '
                ||'  and organization_id '|| lv_in_org_str;
Line: 1820

         lv_sql_stmt:= 'select count(*)  from MRP_AD_WIP_COMP_SUPPLIES_V'||p_dblink
                ||'  where RN > :lv_wip_lrn '
                ||'  and organization_id '|| lv_in_org_str;
Line: 1827

         lv_sql_stmt:= 'select count(*)  from  MRP_AD_REPT_ITEM_SUPPLIES_V'||p_dblink
                ||' where RN > :lv_wip_lrn '
                ||' and organization_id '|| lv_in_org_str;
Line: 1836

         lv_sql_stmt:= 'select count(*) '
                    ||' from MRP_AP_WIP_JOB_SUPPLIES_V'||p_dblink||'  x '
                    ||' where (    x.RN1 > :lv_wip_lrn '
                    ||'        OR x.RN2 > :lv_wip_lrn )'
                    ||' and x.organization_id '|| lv_in_org_str;
Line: 1846

         lv_sql_stmt:= 'select count(*) '
                    ||' from MRP_AP_WIP_COMP_SUPPLIES_V'||p_dblink||'  x '
                    ||' where (    x.RN1 > :lv_wip_lrn '
                    ||'        OR x.RN2 > :lv_wip_lrn'
                    ||'        OR x.RN3 > :lv_wip_lrn )'
                    ||' and x.organization_id '|| lv_in_org_str;
Line: 1858

        lv_sql_stmt:= 'select count(*) '
                    ||' from MRP_AP_REPT_ITEM_SUPPLIES_V'||p_dblink||' x '
                    ||' where (    x.RN1 > :lv_wip_lrn '
                    ||'        OR x.RN2 > :lv_wip_lrn '
                    ||'        OR x.RN3 > :lv_wip_lrn '
                    ||'        OR x.RN4 > :lv_wip_lrn ) '
                    ||' and x.organization_id '|| lv_in_org_str;
Line: 1875

        lv_sql_stmt:= 'select count(*)  from MRP_AP_WIP_JOB_SUPPLIES_V'||p_dblink
                ||'  where organization_id '|| lv_in_org_str;
Line: 1880

        lv_sql_stmt:= 'select count(*)  from MRP_AP_WIP_COMP_SUPPLIES_V'||p_dblink
                ||'  where organization_id '|| lv_in_org_str;
Line: 1885

        lv_sql_stmt:= 'select count(*)  from MRP_AP_REPT_ITEM_SUPPLIES_V'||p_dblink
                ||'  where organization_id '|| lv_in_org_str;
Line: 1904

         lv_sql_stmt:= 'select count(*)  from MRP_AD_WIP_COMP_DEMANDS_V'||p_dblink
                ||' where RN > :lv_wip_lrn '
                ||' and organization_id '|| lv_in_org_str;
Line: 1911

         lv_sql_stmt:= 'select count(*)  from  MRP_AD_WIP_FLOW_DEMANDS_V'||p_dblink
                ||'  where RN > :lv_wip_lrn '
                ||'  and organization_id '|| lv_in_org_str;
Line: 1918

         lv_sql_stmt:= 'select count(*)  from  MRP_AD_REPT_ITEM_DEMANDS_V'||p_dblink
                ||' where RN > :lv_wip_lrn '
                ||' and organization_id '|| lv_in_org_str;
Line: 1929

           lv_sql_stmt:= ' select count(*)  '
                      ||' from MRP_AP_WIP_COMP_DEMANDS_V'||p_dblink||'  x '
                      ||' where (    x.RN1 > :lv_wip_lrn '
                      ||'        OR x.RN2 > :lv_wip_lrn '
                      ||'        OR x.RN3 > :lv_wip_lrn ) '
                      ||' and x.organization_id '|| lv_in_org_str;
Line: 1941

          lv_sql_stmt:= 'select count(*)  '
                      ||' from MRP_AP_REPT_ITEM_DEMANDS_V'||p_dblink||'  x '
                      ||' where (    x.RN1 > :lv_wip_lrn '
                      ||'        OR x.RN2 > :lv_wip_lrn '
                      ||'        OR x.RN3 > :lv_wip_lrn '
                      ||'        OR x.RN4 > :lv_wip_lrn '
                      ||'        OR x.RN5 > :lv_wip_lrn ) '
                      ||' and x.organization_id '|| lv_in_org_str;
Line: 1958

        lv_sql_stmt:= 'select count(*)  from MRP_AP_WIP_COMP_DEMANDS_V'||p_dblink
                   ||'  where organization_id '|| lv_in_org_str;
Line: 1963

        lv_sql_stmt:= 'select count(*)  from MRP_AP_REPT_ITEM_DEMANDS_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 1980

     lv_sql_stmt:= 'select LBJ_DETAILS '
                   || ' from msc_apps_instances '
                   || ' where instance_id = ' || p_instance_id ;
Line: 1986

        lv_sql_stmt:= 'select count(*)  from MRP_AD_JOB_OP_NETWORKS_V'||p_dblink
                      ||'  where RN > :lv_wip_lrn '
                      ||'  and organization_id '|| lv_in_org_str;
Line: 1993

        lv_sql_stmt:= 'select count(*)  from MRP_AD_JOB_OPERATIONS_V'||p_dblink
                      ||'  where RN > :lv_wip_lrn '
                      ||'  and organization_id '|| lv_in_org_str;
Line: 2000

        lv_sql_stmt:= 'select count(*)  from MRP_AD_REQUIREMENT_OPS_V'||p_dblink
                      ||'  where RN > :lv_wip_lrn '
                      ||'  and organization_id '|| lv_in_org_str;
Line: 2007

       lv_sql_stmt:= 'select count(*)  from MRP_AD_JOB_OP_RESOURCES_V'||p_dblink
                      ||'  where RN > :lv_wip_lrn '
                      ||'  and organization_id '|| lv_in_org_str;
Line: 2014

       lv_sql_stmt:= 'select count(*)  from MRP_AD_LJ_SUB_OP_RESOURCES_V'||p_dblink
                      ||'  where RN > :lv_wip_lrn '
                      ||'  and organization_id '|| lv_in_org_str;
Line: 2022

       lv_sql_stmt:= 'select count(*)  from MRP_AD_LJ_OPR_RES_INSTS_V'||p_dblink
                      ||' where RN > :lv_wip_lrn '
                      ||' and organization_id '|| lv_in_org_str;
Line: 2032

       lv_sql_stmt:= 'select count(*)  '
                      ||' from MRP_AP_JOB_OP_NETWORKS_V'||p_dblink||'  x '
                      ||' where (    x.RN > :lv_wip_lrn '
                      ||' OR x.RN1 > :lv_wip_lrn '
                      ||' OR x.RN2 > :lv_wip_lrn ) '
                      ||' and x.organization_id '|| lv_in_org_str;
Line: 2044

        lv_sql_stmt:= 'select count(*)  '
                      ||' from MRP_AP_JOB_OPERATIONS_V'||p_dblink||'  x '
                      ||' where (    x.RN > :lv_wip_lrn '
                      ||' OR x.RN1 > :lv_wip_lrn '
                      ||' OR x.RN2 > :lv_wip_lrn ) '
                      ||' and x.organization_id '|| lv_in_org_str;
Line: 2056

        lv_sql_stmt:= 'select count(*)  '
                      ||' from MRP_AP_JOB_REQUIREMENT_OPS_V'||p_dblink||'  x '
                      ||' where (    x.RN > :lv_wip_lrn '
                      ||' OR x.RN1 > :lv_wip_lrn '
                      ||' OR x.RN2 > :lv_wip_lrn ) '
                      ||' and x.organization_id '|| lv_in_org_str;
Line: 2068

         lv_sql_stmt:= 'select count(*)  '
                      ||' from MRP_AP_JOB_OP_RESOURCES_V'||p_dblink||'  x '
                      ||' where (    x.RN > :lv_wip_lrn '
                      ||' OR x.RN1 > :lv_wip_lrn '
                      ||' OR x.RN2 > :lv_wip_lrn ) '
                      ||' and x.organization_id '|| lv_in_org_str;
Line: 2080

         lv_sql_stmt:= 'select count(*)  '
                      ||' from MRP_AP_LJ_SUB_OP_RESOURCES_V'||p_dblink||'  x '
                      ||' where (    x.RN1 > :lv_wip_lrn '
                      ||' OR x.RN2 > :lv_wip_lrn '
                      ||' OR x.RN3 > :lv_wip_lrn )'
                      ||' and x.organization_id '|| lv_in_org_str;
Line: 2092

         lv_sql_stmt:= 'select count(*)  '
                      ||' from MRP_AP_JOB_RES_INSTANCES_V'||p_dblink||' x '
                      ||' where (    x.RN1 > :lv_wip_lrn '
                      ||'        OR x.RN2 > :lv_wip_lrn '
                      ||'        OR x.RN3 > :lv_wip_lrn ) '
                      ||' and x.organization_id '|| lv_in_org_str;
Line: 2107

         lv_sql_stmt:= 'select count(*)  from MRP_AP_JOB_OP_NETWORKS_V'||p_dblink
                      ||' where organization_id '|| lv_in_org_str;
Line: 2112

         lv_sql_stmt:= 'select count(*)  from MRP_AP_JOB_OPERATIONS_V'||p_dblink
                      ||' where organization_id '|| lv_in_org_str;
Line: 2117

         lv_sql_stmt:= 'select count(*)  from MRP_AP_JOB_REQUIREMENT_OPS_V'||p_dblink
                      ||' where organization_id '|| lv_in_org_str;
Line: 2122

         lv_sql_stmt:= 'select count(*)  from MRP_AP_JOB_OP_RESOURCES_V'||p_dblink
                      ||' where organization_id '|| lv_in_org_str;
Line: 2127

        lv_sql_stmt:= 'select count(*)  from MRP_AP_LJ_SUB_OP_RESOURCES_V'||p_dblink
                      ||' where organization_id '|| lv_in_org_str;
Line: 2133

        lv_sql_stmt:= 'select count(*)  from MRP_AP_JOB_RES_INSTANCES_V'||p_dblink
                      ||' where organization_id '|| lv_in_org_str;
Line: 2152

      lv_sql_stmt:= 'select count(*)  from MRP_AD_RESOURCE_REQUIREMENTS_V'||p_dblink
                  ||' where RN > :lv_wip_lrn '
                  ||' and organization_id '|| lv_in_org_str;
Line: 2159

      lv_sql_stmt:= 'select count(*)  '
                  ||' from MRP_AP_RESOURCE_REQUIREMENTS_V'||p_dblink||' x '
                  ||' where (    x.RN1 > :lv_wip_lrn '
                  ||'        OR x.RN2 > :lv_wip_lrn '
                  ||'        OR x.RN3 > :lv_wip_lrn ) '
                  ||' and x.organization_id '|| lv_in_org_str;
Line: 2172

      lv_sql_stmt:= 'select count(*)  from MRP_AP_RESOURCE_REQUIREMENTS_V'||p_dblink
                  ||' where organization_id '|| lv_in_org_str;
Line: 2177

        lv_sql_stmt:= 'select count(*)  from MRP_AD_DJOB_SUB_OP_RESOURCES_V'||p_dblink
                  ||' where RN > :lv_wip_lrn '
                  ||' and organization_id '|| lv_in_org_str;
Line: 2184

      lv_sql_stmt:= 'select count(*)  '
                  ||' from MRP_AP_DJOB_SUB_OP_RESOURCES_V'||p_dblink||' x '
                  ||' where (    x.RN1 > :lv_wip_lrn '
                  ||' OR x.RN2 > :lv_wip_lrn '
                  ||' OR x.RN3 > :lv_wip_lrn )'
                  ||' and x.organization_id '|| lv_in_org_str;
Line: 2197

      lv_sql_stmt:= 'select count(*)  from MRP_AP_DJOB_SUB_OP_RESOURCES_V'||p_dblink
                  ||' where organization_id '|| lv_in_org_str;
Line: 2204

      lv_sql_stmt:= 'select count(*)  from MRP_AD_RES_INSTANCE_REQS_V'||p_dblink
                  ||' where RN > :lv_wip_lrn '
                  ||' and organization_id '|| lv_in_org_str;
Line: 2212

             lv_sql_stmt:= 'select count(*)  '
                  ||' from MRP_AP_RES_INSTANCE_REQS_V'||p_dblink||' x '
                  ||' where (    x.RN1 > :lv_wip_lrn '
                  ||'        OR x.RN2 > :lv_wip_lrn '
                  ||'        OR x.RN3 > :lv_wip_lrn '
                  ||'        OR x.RN4 > :lv_wip_lrn ) '
                  ||' and x.organization_id '|| lv_in_org_str;
Line: 2227

              lv_sql_stmt:= 'select count(*)  from MRP_AP_RES_INSTANCE_REQS_V'||p_dblink
                  ||' where organization_id '|| lv_in_org_str;
Line: 2250

         lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AP_LINE_RESOURCES_V'||p_dblink||' x '
                   ||' where  x.RN1 > :lv_bom_lrn '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 2258

          lv_sql_stmt:= 'select count(*)  from MRP_AP_LINE_RESOURCES_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 2276

      SELECT MSC_UTIL.SYS_YES
      INTO   lv_status_decided_app_supp_cap
      FROM   fnd_lookup_values
      WHERE  lookup_type = 'MSC_COLL_SNAPSHOTS' AND
                enabled_flag = 'Y' AND
                view_application_id = 700 AND
                language = userenv('lang') AND
                attribute2 IN
                        ('PO_SI_CAPA_SN', 'MTL_SYS_ITEMS_SN') AND
                attribute13 = 'COMPLETE' AND
                rownum = 1;
Line: 2293

       lv_sql_stmt:= 'select count(*)  from MRP_AD_SUPPLIER_CAPACITIES_V'||p_dblink
                   ||'  where RN > :lv_sup_cap_lrn '
                   ||'  and organization_id '|| lv_in_org_str;
Line: 2300

       lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AP_SUPPLIER_CAPACITIES_V'||p_dblink||'  x '
                   ||' where (    x.RN1 > :lv_sup_cap_lrn '
                   ||'        OR x.RN2 > :lv_sup_cap_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 2311

       lv_sql_stmt:= 'select count(*)  from MRP_AP_SUPPLIER_CAPACITIES_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 2327

      SELECT MSC_UTIL.SYS_YES
      INTO   lv_status_decided_po
      FROM   fnd_lookup_values
      WHERE  lookup_type = 'MSC_COLL_SNAPSHOTS' AND
                enabled_flag = 'Y' AND
                view_application_id = 700 AND
                language = userenv('lang') AND
                attribute2 IN
                        ('MTL_SUPPLY_SN', 'MTL_SYS_ITEMS_SN') AND
                attribute13 = 'COMPLETE' AND
                rownum = 1;
Line: 2344

        lv_sql_stmt:= 'select count(*)  from MRP_AD_PO_SUPPLIES_V'||p_dblink
                ||' where RN > :lv_po_lrn'
                ||' and organization_id '|| lv_in_org_str;
Line: 2352

       lv_sql_stmt:= 'select count(*)  '
                ||' from MRP_AP_PO_PO_SUPPLY_V'||p_dblink||' x '
                ||' where (    x.RN2 > :lv_po_lrn '
                ||'        OR x.RN3 > :lv_po_lrn ) '
                ||' and x.organization_id '|| lv_in_org_str;
Line: 2362

       lv_sql_stmt:= 'select count(*)  '
                ||' from  MRP_AP_PO_SHIP_SUPPLY_V'||p_dblink||'  x '
                ||' where (    x.RN2 > :lv_po_lrn '
                ||'        OR x.RN3 > :lv_po_lrn )'
                ||' and x.organization_id '|| lv_in_org_str;
Line: 2372

       lv_sql_stmt:= 'select count(*) '
                ||' from  MRP_AP_PO_REQ_SUPPLY_V'||p_dblink||' x '
                ||' where (    x.RN2 > :lv_po_lrn '
                ||'        OR x.RN3 > :lv_po_lrn )'
                ||' and x.organization_id '|| lv_in_org_str;
Line: 2382

        lv_sql_stmt:= 'select count(*) '
                ||' from  MRP_AP_PO_SHIP_RCV_SUPPLY_V'||p_dblink||'  x '
                ||' where (    x.RN2 > :lv_po_lrn  '
                ||'        OR x.RN3 > :lv_po_lrn ) '
                ||' and x.organization_id '|| lv_in_org_str;
Line: 2392

          lv_sql_stmt:= 'select count(*) '
                ||' from   MRP_AP_PO_RCV_SUPPLY_V'||p_dblink||'  x '
                ||' where (    x.RN2 > :lv_po_lrn  '
                ||'        OR x.RN3 > :lv_po_lrn ) '
                ||' and x.organization_id '|| lv_in_org_str;
Line: 2403

           lv_sql_stmt:= 'select count(*)  '
                ||' from  MRP_AP_INTRANSIT_SUPPLIES_V'||p_dblink||'  x '
                ||' where   x.RN2 > :lv_po_lrn '
                ||' and x.organization_id '|| lv_in_org_str;
Line: 2413

           lv_sql_stmt:= 'select count(*)  from MRP_AP_PO_PO_SUPPLY_V'||p_dblink
                ||' where organization_id '|| lv_in_org_str;
Line: 2418

           lv_sql_stmt:= 'select count(*)  from MRP_AP_PO_SHIP_SUPPLY_V'||p_dblink
                ||' where organization_id  '|| lv_in_org_str;
Line: 2423

           lv_sql_stmt:= 'select count(*)  from MRP_AP_PO_REQ_SUPPLY_V'||p_dblink
                ||' where organization_id '|| lv_in_org_str;
Line: 2428

           lv_sql_stmt:= 'select count(*)  from MRP_AP_PO_SHIP_RCV_SUPPLY_V'||p_dblink
                ||' where organization_id '|| lv_in_org_str;
Line: 2433

           lv_sql_stmt:= 'select count(*)  from MRP_AP_PO_RCV_SUPPLY_V'||p_dblink
                ||' where organization_id '|| lv_in_org_str;
Line: 2438

           lv_sql_stmt:= 'select count(*)  from MRP_AP_INTRANSIT_SUPPLIES_V'||p_dblink
                ||' where organization_id '|| lv_in_org_str;
Line: 2456

        SELECT MSC_UTIL.SYS_YES
        INTO   lv_status_decided_mds
        FROM   fnd_lookup_values
        WHERE  lookup_type = 'MSC_COLL_SNAPSHOTS' AND
                  enabled_flag = 'Y' AND
                  view_application_id = 700 AND
                  language = userenv('lang') AND
                  attribute2 IN
                          ('MRP_SCHD_DATES_SN', 'MTL_SYS_ITEMS_SN') AND
                  attribute13 = 'COMPLETE' AND
                  rownum = 1;
Line: 2474

            lv_sql_stmt:= 'select count(*)  from MRP_AD_MDS_DEMANDS_V'||p_dblink
                   ||' where RN > :lv_mds_lrn '
                   ||' and organization_id '|| lv_in_org_str;
Line: 2481

       lv_sql_stmt:= 'select count(*)  '
                   ||' from MRP_AP_MDS_DEMANDS_V'||p_dblink||'  x '
                   ||' where (    x.RN2 > :lv_mds_lrn  '
                   ||'        OR x.RN3 > :lv_mds_lrn ) '
                   ||' and x.organization_id '|| lv_in_org_str;
Line: 2492

       lv_sql_stmt:= 'select count(*)  from MRP_AP_MDS_DEMANDS_V'||p_dblink
                   ||' where organization_id '|| lv_in_org_str;
Line: 2508

         SELECT MSC_UTIL.SYS_YES
         INTO   lv_status_decided_mps
         FROM   fnd_lookup_values
         WHERE  lookup_type = 'MSC_COLL_SNAPSHOTS' AND
                   enabled_flag = 'Y' AND
                   view_application_id = 700 AND
                   language = userenv('lang') AND
                   attribute2 IN
                           ('MRP_SCHD_DATES_SN', 'MTL_SYS_ITEMS_SN') AND
                   attribute13 = 'COMPLETE' AND
                   rownum = 1;
Line: 2527

              lv_sql_stmt:= 'select count(*)  from MRP_AD_MPS_SUPPLIES_V'||p_dblink
                     ||' where RN > :lv_mps_lrn '
                     ||' and organization_id '|| lv_in_org_str;
Line: 2534

         lv_sql_stmt:= 'select count(*)  '
                     ||' from MRP_AP_MPS_SUPPLIES_V'||p_dblink||'  x '
                     ||' where (    x.RN2 > :lv_mps_lrn '
                     ||'        OR x.RN3 > :lv_mps_lrn ) '
                     ||' and x.organization_id '|| lv_in_org_str;
Line: 2545

         lv_sql_stmt:= 'select count(*)  from MRP_AP_MPS_SUPPLIES_V'||p_dblink
                     ||'  where organization_id '|| lv_in_org_str;
Line: 2560

        SELECT MSC_UTIL.SYS_YES
        INTO   lv_status_decided_trip
        FROM   fnd_lookup_values
        WHERE  lookup_type = 'MSC_COLL_SNAPSHOTS' AND
                  enabled_flag = 'Y' AND
                  view_application_id = 700 AND
                  language = userenv('lang') AND
                  attribute2 IN
                          ('WSH_TRIP_SN', 'WSH_TRIP_STOP_SN') AND
                  attribute13 = 'COMPLETE' AND
                  rownum = 1;
Line: 2579

         lv_sql_stmt:= 'select count(*)  from MRP_AD_TRIPS_V'||p_dblink
                ||' where RN > :lv_trip_lrn ';
Line: 2585

        lv_sql_stmt:= 'select count(*)  '
                    ||' from MRP_AP_TRIPS_V'||p_dblink||'  x '
                    ||' where     x.RN > :lv_trip_lrn  ';
Line: 2593

        lv_sql_stmt:= 'select count(*)  from MRP_AP_TRIPS_V'||p_dblink;
Line: 2609

         lv_sql_stmt:= 'select count(*)  from MRP_AD_TRIP_STOPS_V'||p_dblink
                ||' where RN > :lv_trip_lrn ';
Line: 2615

        lv_sql_stmt:= 'select count(*)  '
                    ||' from MRP_AP_TRIP_STOPS_V'||p_dblink||'  x '
                    ||' where     x.RN > :lv_trip_lrn  ';
Line: 2623

        lv_sql_stmt:= 'select count(*)  from MRP_AP_TRIP_STOPS_V'||p_dblink;