DBA Data[Home] [Help]

APPS.MSC_CL_CONT_COLL_FW SQL Statements

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

Line: 335

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

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

						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: 561

               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: 568

               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: 579

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

                    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: 606

                   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: 616

                   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: 626

                   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: 636

                    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: 646

                      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: 657

                       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: 667

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

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

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

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

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

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

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

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

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

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

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

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

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

      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: 841

        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: 862

       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: 869

       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: 884

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

       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: 908

       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: 918

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

       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: 938

       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: 952

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

       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: 973

       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: 983

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

      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: 1003

       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: 1019

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

       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: 1041

       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: 1054

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

       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: 1075

       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: 1090

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

       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: 1111

         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: 1119

       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: 1132

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

       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: 1160

       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: 1173

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

         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: 1185

       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: 1198

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

	      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: 1212

              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: 1227

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

       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: 1257

       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: 1274

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

       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: 1295

       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: 1307

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

          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: 1341

          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: 1350

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

        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: 1387

         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: 1394

          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: 1404

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

        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: 1431

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

        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: 1463

        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: 1470

        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: 1481

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

        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: 1516

           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: 1523

       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: 1534

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

        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: 1563

           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: 1570

       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: 1581

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

        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: 1614

          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: 1622

          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: 1632

          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: 1644

          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: 1654

            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: 1664

             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: 1677

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

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

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

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

        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: 1728

          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: 1735

       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: 1743

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

       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: 1780

         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: 1787

         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: 1794

         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: 1803

         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: 1813

         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: 1825

        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: 1842

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

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

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

         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: 1878

         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: 1885

         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: 1896

           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: 1908

          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: 1925

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

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

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

        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: 1960

        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: 1967

        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: 1974

       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: 1981

       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: 1989

       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: 1999

       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: 2011

        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: 2023

        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: 2035

         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: 2047

         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: 2059

         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: 2074

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

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

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

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

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

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

      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: 2126

      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: 2139

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

        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: 2151

      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: 2164

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

      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: 2179

             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: 2194

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

         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: 2225

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

      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: 2260

       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: 2267

       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: 2278

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

      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: 2311

        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: 2319

       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: 2329

       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: 2339

       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: 2349

        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: 2359

          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: 2370

           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: 2380

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

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

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

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

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

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

        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: 2441

            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: 2448

       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: 2459

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

         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: 2494

              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: 2501

         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: 2512

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

        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: 2546

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

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

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

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

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

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