The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT FND_GLOBAL.APPLICATION_NAME
INTO lv_application_name
FROM dual;
SELECT APPLICATION_ID
INTO lv_application_id
FROM FND_APPLICATION_VL
WHERE APPLICATION_NAME = lv_application_name;
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 ';
select apps_lrn
into lv_apps_lrn
from msc_apps_instances
where instance_id = p_instance_id;
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;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_SUPPLIER_CAPACITIES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
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;
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;
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;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_PO_PO_SUPPLY_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_PO_SHIP_SUPPLY_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_PO_REQ_SUPPLY_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_PO_SHIP_RCV_SUPPLY_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_PO_RCV_SUPPLY_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_INTRANSIT_SUPPLIES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AD_TRIPS_V'||p_dblink
||' where RN > :lv_trip_lrn ';
lv_sql_stmt:= 'select count(*) '
||' from MRP_AP_TRIPS_V'||p_dblink||' x '
||' where x.RN > :lv_trip_lrn ';
lv_sql_stmt:= 'select count(*) from MRP_AP_TRIPS_V'||p_dblink;
lv_sql_stmt:= 'select count(*) from MRP_AD_TRIP_STOPS_V'||p_dblink
||' where RN > :lv_trip_lrn ';
lv_sql_stmt:= 'select count(*) '
||' from MRP_AP_TRIP_STOPS_V'||p_dblink||' x '
||' where x.RN > :lv_trip_lrn ';
lv_sql_stmt:= 'select count(*) from MRP_AP_TRIP_STOPS_V'||p_dblink;
select apps_lrn
into lv_apps_lrn
from msc_apps_instances
where instance_id = p_instance_id;
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;
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;
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;
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;
lv_sql_stmt:= ' select count(*) from MRP_AP_BOM_COMPONENTS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AD_BOMS_V'||p_dblink
||' where RN > :lv_bom_lrn'
||' and organization_id '|| lv_in_org_str;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_BOMS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_COMPONENT_SUBSTITUTES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AD_ROUTINGS_V'||p_dblink
||' where RN > :lv_bom_lrn '
||' and organization_id '|| lv_in_org_str;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_ROUTINGS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
lv_sql_stmt:= ' select count(*) from MRP_AP_BOM_COMPONENTS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_ROUTING_OPERATIONS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_OP_RESOURCE_SEQS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_OP_RESOURCE_SEQS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_RESOURCE_REQUIREMENTS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_DJOB_SUB_OP_RESOURCES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_RES_INSTANCE_REQS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_OPERATION_COMPONENTS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_PROCESS_EFFECTIVITY_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_CRP_RESOURCE_HOURS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_ITEM_CATEGORIES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_SYSTEM_ITEMS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_ONHAND_SUPPLIES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_USER_SUPPLIES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_USER_DEMANDS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
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;
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;
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;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP1_SALES_ORDERS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP2_SALES_ORDERS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP3_SALES_ORDERS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP4_SALES_ORDERS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_FORECAST_DSGN_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
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;
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;
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;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_WIP_JOB_SUPPLIES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_WIP_COMP_SUPPLIES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_REPT_ITEM_SUPPLIES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
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;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_WIP_COMP_DEMANDS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_REPT_ITEM_DEMANDS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select LBJ_DETAILS '
|| ' from msc_apps_instances '
|| ' where instance_id = ' || p_instance_id ;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_JOB_OP_NETWORKS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_JOB_OPERATIONS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_JOB_REQUIREMENT_OPS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_JOB_OP_RESOURCES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_LJ_SUB_OP_RESOURCES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_JOB_RES_INSTANCES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_RESOURCE_REQUIREMENTS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_DJOB_SUB_OP_RESOURCES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_RES_INSTANCE_REQS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_LINE_RESOURCES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_SUPPLIER_CAPACITIES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
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;
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;
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;
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;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_PO_PO_SUPPLY_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_PO_SHIP_SUPPLY_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_PO_REQ_SUPPLY_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_PO_SHIP_RCV_SUPPLY_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_PO_RCV_SUPPLY_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
lv_sql_stmt:= 'select count(*) from MRP_AP_INTRANSIT_SUPPLIES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_MDS_DEMANDS_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
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;
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;
lv_sql_stmt:= 'select count(*) from MRP_AP_MPS_SUPPLIES_V'||p_dblink
||' where organization_id '|| lv_in_org_str;
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;
lv_sql_stmt:= 'select count(*) from MRP_AD_TRIPS_V'||p_dblink
||' where RN > :lv_trip_lrn ';
lv_sql_stmt:= 'select count(*) '
||' from MRP_AP_TRIPS_V'||p_dblink||' x '
||' where x.RN > :lv_trip_lrn ';
lv_sql_stmt:= 'select count(*) from MRP_AP_TRIPS_V'||p_dblink;
lv_sql_stmt:= 'select count(*) from MRP_AD_TRIP_STOPS_V'||p_dblink
||' where RN > :lv_trip_lrn ';
lv_sql_stmt:= 'select count(*) '
||' from MRP_AP_TRIP_STOPS_V'||p_dblink||' x '
||' where x.RN > :lv_trip_lrn ';
lv_sql_stmt:= 'select count(*) from MRP_AP_TRIP_STOPS_V'||p_dblink;