The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT mp.organization_id
FROM hr_organization_units hou,
mtl_parameters mp
WHERE hou.organization_id = mp.organization_id
AND mp.organization_id = p_org_id
AND trunc(sysdate) <= nvl( hou.date_to, trunc(sysdate));
SELECT mp.organization_id
FROM hr_organization_units hou, mtl_parameters mp
WHERE hou.organization_id = mp.organization_id
and mp.organization_code = p_org_code
AND trunc(sysdate) <= nvl( hou.date_to, trunc(sysdate));
SELECT hrtl.location_id
FROM hr_locations_all_tl hrtl,
hr_locations_all hr
WHERE hrtl.location_code = p_location_code
AND hrtl.language = USERENV('LANG')
AND hrtl.location_id = hr.location_id
AND trunc(sysdate) <= nvl( hr.inactive_date, trunc(sysdate) ) ;
SELECT wsh_location_id
INTO l_location_id
FROM wsh_locations
WHERE location_code = p_location_code
AND TRUNC(l_sysdate)
<= NVL(inactive_date ,TRUNC(l_sysdate));
SELECT lookup_code
FROM fnd_lookup_values_vl
WHERE lookup_code = p_lookup_code AND
lookup_type = p_lookup_type AND
nvl(start_date_active,sysdate)<=sysdate AND nvl(end_date_active,sysdate)>=sysdate AND
enabled_flag = 'Y';
SELECT lookup_code
FROM fnd_lookup_values_vl
WHERE meaning = p_meaning AND
lookup_type = p_lookup_type AND
nvl(start_date_active,sysdate)<=sysdate AND nvl(end_date_active,sysdate)>=sysdate AND
enabled_flag = 'Y';
SELECT cust_account_id /*customer_id */
FROM hz_cust_accounts
WHERE cust_account_id = p_customer_id AND
status = 'A' AND
NVL(p_customer_id, FND_API.G_MISS_NUM) <> FND_API.G_MISS_NUM
UNION
SELECT Cust_account_id/*customer_id */
FROM hz_cust_accounts
WHERE account_number /* customer number */ = p_customer_number AND
status = 'A' AND
NVL(p_customer_id, FND_API.G_MISS_NUM) = FND_API.G_MISS_NUM;
SELECT Cust_account_role_id /*contact id*/
FROM hz_cust_account_roles
WHERE cust_account_role_id = p_contact_id AND
p_contact_id IS NOT NULL; --TCA View removal Ends
SELECT currency_code,
NVL(precision,0),
DECODE(INSTR(TO_CHAR(NVL(p_amount,0)),'.'),0,0,
LENGTH(TO_CHAR(NVL(p_amount,0)))-
INSTR(TO_CHAR(NVL(p_amount,0)),'.'))
FROM fnd_currencies_vl
WHERE enabled_flag = 'Y'
AND name = decode( c_currency_code, null, c_currency_name, name)
AND currency_code = nvl( c_currency_code, currency_code)
AND trunc(sysdate) between nvl( start_date_active, trunc(sysdate) )
and nvl( end_date_active, trunc(sysdate) );
SELECT weight_uom_class, volume_uom_class
FROM wsh_shipping_parameters
WHERE organization_id = p_organization_id;
SELECT uom_code
FROM mtl_units_of_measure
WHERE uom_code = p_uom_code AND
uom_class = NVL(l_class, uom_class) AND
nvl(disable_date, sysdate) >= sysdate;
SELECT uom_code
FROM mtl_units_of_measure
WHERE unit_of_measure = p_uom_desc AND
uom_class = NVL(l_class, uom_class) AND
nvl(disable_date, sysdate) >= sysdate;
SELECT user_id
FROM fnd_user
WHERE p_user_id IS NOT NULL AND
user_id = p_user_id AND
trunc(sysdate) between nvl( start_date, trunc(sysdate) )
and nvl( end_date, trunc(sysdate) )
UNION ALL
SELECT user_id
FROM fnd_user
WHERE p_user_id IS NULL AND
user_name = p_user_name AND
trunc(sysdate) between nvl( start_date, trunc(sysdate) )
and nvl( end_date, trunc(sysdate) );
SELECT lookup_code, meaning
FROM fnd_lookup_values_vl
WHERE lookup_code = p_ship_method_code AND
lookup_type = 'SHIP_METHOD' AND
view_application_id = 3;
SELECT lookup_code, meaning
FROM fnd_lookup_values_vl
WHERE meaning = p_ship_method_name AND
lookup_type = 'SHIP_METHOD' AND
view_application_id = 3;
SELECT uom_code
FROM mtl_item_uoms_view
WHERE organization_id = p_organization_id AND
inventory_item_id = p_inventory_item_id AND
uom_code = x_uom_code
UNION ALL
SELECT uom_code
FROM mtl_item_uoms_view
WHERE organization_id = p_organization_id AND
inventory_item_id = p_inventory_item_id AND
unit_of_measure = p_unit_of_measure;
SELECT delivery_id
FROM wsh_new_deliveries
WHERE NVL(p_delivery_id, FND_API.G_MISS_NUM) <> FND_API.G_MISS_NUM AND
delivery_id = p_delivery_id
UNION ALL
SELECT delivery_id
FROM wsh_new_deliveries
WHERE NVL(p_delivery_id, FND_API.G_MISS_NUM) = FND_API.G_MISS_NUM AND
name = p_delivery_name;
SELECT report_set_id
FROM wsh_report_sets
WHERE p_report_set_id IS NOT NULL AND
report_set_id = p_report_set_id AND
start_date_active <= sysdate AND
nvl(end_date_active,sysdate) >= sysdate
UNION ALL
SELECT report_set_id
FROM wsh_report_sets
WHERE p_report_set_id IS NULL AND
name = p_report_set_name AND
start_date_active <= sysdate AND
nvl(end_date_active,sysdate) >= sysdate;
SELECT stop_id
FROM wsh_trip_stops
WHERE NVL(p_stop_id, FND_API.G_MISS_NUM) <> FND_API.G_MISS_NUM AND
stop_id = p_stop_id
UNION ALL
SELECT stop_id
FROM wsh_trip_stops
WHERE NVL(p_stop_id, FND_API.G_MISS_NUM) = FND_API.G_MISS_NUM AND
trip_id = p_trip_id AND
stop_location_id = p_stop_location_id AND
planned_departure_date = nvl(p_planned_dep_date, planned_departure_date)
;
SELECT trip_id
FROM wsh_trips
WHERE NVL(p_trip_id, FND_API.G_MISS_NUM) <> FND_API.G_MISS_NUM AND
trip_id = p_trip_id
UNION ALL
SELECT trip_id
FROM wsh_trips
WHERE NVL(p_trip_id, FND_API.G_MISS_NUM) = FND_API.G_MISS_NUM AND
name = p_trip_name;
select count(*)
from wsh_trip_stops s
where s.trip_id = p_trip_id
and s.physical_stop_id is null
and rownum < 4;
select 'X', name
from wsh_trips
where trip_id = p_trip_id
and
(
( status_code IN ( 'OP','IT' )
and nvl(shipments_type_flag,'O') = 'O' -- J-IB-NPARIKH
)
OR nvl(shipments_type_flag,'O') <> 'O' -- J-IB-NPARIKH
)
and nvl(planned_flag,'N') ='N'
and rownum = 1;
select 'X', name
from wsh_trips
where trip_id = p_trip_id
and
(
( status_code IN ( 'OP' )
and nvl(shipments_type_flag,'O') = 'O' -- J-IB-NPARIKH
)
OR nvl(shipments_type_flag,'O') <> 'O' -- J-IB-NPARIKH
)
and nvl(planned_flag,'N') IN ('N', 'Y')
and rownum = 1;
select carrier_id
from wsh_carriers_v
where nvl(x_carrier_id,fnd_api.g_miss_num) <> fnd_api.g_miss_num
and carrier_id = x_carrier_id
and nvl(generic_flag, 'N') = 'N'
and active = 'A'
union all
select carrier_id
from wsh_carriers_v
where nvl(x_carrier_id,fnd_api.g_miss_num) = fnd_api.g_miss_num
and carrier_name = p_carrier_name
and nvl(generic_flag, 'N') = 'N'
and active = 'A';
select wcs.carrier_id,
wcs.service_level,
wcs.mode_of_transport
from wsh_carrier_services wcs,
wsh_org_carrier_services wocs,
wsh_carriers_v wcv
where wcs.carrier_service_id = wocs.carrier_service_id
and wcs.carrier_id = wcv.carrier_id
and wcv.active = 'A'
and NVL(wcv.generic_flag, 'N') = 'N'
and nvl(wcs.enabled_flag, 'N') = 'Y'
and nvl(wocs.enabled_flag, 'N')= 'Y'
and wcs.ship_method_code = x_ship_method_code
and wocs.organization_id = p_organization_id;
select wcs.carrier_id,
wcs.service_level,
wcs.mode_of_transport
from wsh_carrier_services wcs,
wsh_org_carrier_services wocs,
wsh_carriers_v wcv
where wcs.carrier_service_id = wocs.carrier_service_id
and wcs.carrier_id = wcv.carrier_id
and wcv.active = 'A'
and NVL(wcv.generic_flag, 'N') = 'N'
and nvl(wcs.enabled_flag, 'N') = 'Y'
and nvl(wocs.enabled_flag, 'N')= 'Y'
and wcs.ship_method_code = x_ship_method_code
and rownum=1;
select wcs.ship_method_code
from wsh_carrier_services wcs,
wsh_org_carrier_services wocs,
wsh_carriers_v wcv
where wcs.carrier_service_id = wocs.carrier_service_id
and wcs.carrier_id = wcv.carrier_id
and wcv.active = 'A'
and NVL(wcv.generic_flag, 'N') = 'N'
and nvl(wcs.enabled_flag, 'N') = 'Y'
and nvl(wocs.enabled_flag, 'N')= 'Y'
and wcs.carrier_id = x_carrier_id
and ( (wcs.service_level is null
and x_service_level is null )
or
( wcs.service_level is not null
and wcs.service_level = x_service_level )
)
and ( (wcs.mode_of_transport is null
and x_mode_of_transport is null )
or
( wcs.mode_of_transport is not null
and wcs.mode_of_transport = x_mode_of_transport )
)
and wocs.organization_id = p_organization_id;
select wcs.ship_method_code
from wsh_carrier_services wcs,
wsh_org_carrier_services wocs,
wsh_carriers_v wcv
where wcs.carrier_service_id = wocs.carrier_service_id
and wcs.carrier_id = wcv.carrier_id
and wcv.active = 'A'
and NVL(wcv.generic_flag, 'N') = 'N'
and nvl(wcs.enabled_flag, 'N') = 'Y'
and nvl(wocs.enabled_flag, 'N')= 'Y'
and wcs.carrier_id = x_carrier_id
and ( (wcs.service_level is null
and x_service_level is null )
or
( wcs.service_level is not null
and wcs.service_level = x_service_level )
)
and ( (wcs.mode_of_transport is null
and x_mode_of_transport is null )
or
( wcs.mode_of_transport is not null
and wcs.mode_of_transport = x_mode_of_transport )
)
and rownum=1;
select carrier_id,
service_level,
mode_of_transport,
ship_method_code
from wsh_new_deliveries
where delivery_id = p_delivery_id;
select wcs.carrier_id,
wcs.service_level,
wcs.mode_of_transport
from wsh_carrier_services wcs,
wsh_carriers_v wcv
where wcs.ship_method_code = x_ship_method_code
and wcs.carrier_id = wcv.carrier_id
and nvl(wcs.enabled_flag, 'N') = 'Y'
and wcv.active = 'A'
and NVL(wcv.generic_flag, 'N') = 'N';
select distinct wcs.ship_method_code
from wsh_carrier_services wcs,
wsh_carriers_v wcv
where wcs.carrier_id = x_carrier_id
and wcs.carrier_id = wcv.carrier_id
and nvl(wcs.enabled_flag, 'N') = 'Y'
and wcv.active = 'A'
and NVL(wcv.generic_flag, 'N') = 'N'
and ( (wcs.service_level is null
and x_service_level is null )
or
( wcs.service_level is not null
and wcs.service_level = x_service_level )
)
and ( (wcs.mode_of_transport is null
and x_mode_of_transport is null )
or
( wcs.mode_of_transport is not null
and wcs.mode_of_transport = x_mode_of_transport )
);
select carrier_id,
service_level,
mode_of_transport,
ship_method_code
from wsh_trips
where trip_id = p_trip_id;
select count(*)
from wsh_trip_stops s
where s.trip_id = p_trip_id
and s.physical_stop_id is null
and rownum < 4;
SELECT container_item_flag, shippable_item_flag, vehicle_item_flag
FROM mtl_system_items
WHERE inventory_item_id = l_item_id AND
organization_id = l_organization_id;
SELECT primary_uom_code,
description,
hazard_class_id,
weight_uom_code,
unit_weight,
volume_uom_code,
unit_volume
FROM mtl_system_items
WHERE inventory_item_id = v_inventory_item_id
AND organization_id = v_organization_id;
SELECT master_container_item_id,
detail_container_item_id
FROM mtl_customer_items
WHERE customer_item_id = l_customer_item_id;
SELECT 1
FROM
ar_lookups
WHERE
lookup_type = 'FOB' AND
lookup_code = p_lookup_code AND
nvl(start_date_active,SYSDATE) <= SYSDATE AND
nvl(end_date_active,SYSDATE) >= SYSDATE AND
enabled_flag = 'Y';
SELECT meaning,description
from FND_LOOKUP_VALUES_VL
where lookup_code = p_lookup_code AND
lookup_type = 'FOB' AND
nvl(start_date_active,SYSDATE) <= SYSDATE AND
nvl(end_date_active,SYSDATE) >= SYSDATE AND
enabled_flag = 'Y'AND
view_application_id = 201;
FND_LOOKUP_VALUES_PKG.INSERT_ROW(
X_ROWID => l_rowid,
X_LOOKUP_TYPE => 'FOB',
X_SECURITY_GROUP_ID => 0,
X_VIEW_APPLICATION_ID => 222,
X_LOOKUP_CODE => p_fob,
X_TAG => NULL,
X_ATTRIBUTE_CATEGORY => NULL,
X_ATTRIBUTE1 => NULL,
X_ATTRIBUTE2 => NULL,
X_ATTRIBUTE3 => NULL,
X_ATTRIBUTE4 => NULL,
X_ENABLED_FLAG => 'Y',
X_START_DATE_ACTIVE => SYSDATE,
X_END_DATE_ACTIVE => NULL,
X_TERRITORY_CODE => NULL,
X_ATTRIBUTE5 => NULL,
X_ATTRIBUTE6 => NULL,
X_ATTRIBUTE7 => NULL,
X_ATTRIBUTE8 => NULL,
X_ATTRIBUTE9 => NULL,
X_ATTRIBUTE10 => NULL,
X_ATTRIBUTE11 => NULL,
X_ATTRIBUTE12 => NULL,
X_ATTRIBUTE13 => NULL,
X_ATTRIBUTE14 => NULL,
X_ATTRIBUTE15 => NULL,
X_MEANING => l_meaning,
X_DESCRIPTION => l_desc,
X_CREATION_DATE => SYSDATE,
X_CREATED_BY => FND_GLOBAL.USER_ID,
X_LAST_UPDATE_DATE => SYSDATE,
X_LAST_UPDATED_BY => FND_GLOBAL.USER_ID,
X_LAST_UPDATE_LOGIN => FND_GLOBAL.LOGIN_ID);
SELECT '1'
FROM oe_lookups
WHERE
lookup_type = 'FREIGHT_TERMS' AND
lookup_code = p_lookup_code AND
nvl(start_date_active,SYSDATE) <= SYSDATE
AND nvl(end_date_active,SYSDATE) >= SYSDATE
AND enabled_flag = 'Y';
SELECT meaning,description
FROM FND_LOOKUP_VALUES_VL
WHERE
lookup_type = 'FREIGHT TERMS' AND
lookup_code = p_lookup_code
AND nvl(start_date_active,SYSDATE) <= SYSDATE
AND nvl(end_date_active,SYSDATE) >= SYSDATE
AND enabled_flag = 'Y'
AND view_application_id = 201;
FND_LOOKUP_VALUES_PKG.INSERT_ROW(
X_ROWID => l_rowid,
X_LOOKUP_TYPE => 'FREIGHT_TERMS',
X_SECURITY_GROUP_ID => 0,
X_VIEW_APPLICATION_ID => 660,
X_LOOKUP_CODE => p_freight_terms_code,
X_TAG => NULL,
X_ATTRIBUTE_CATEGORY => NULL,
X_ATTRIBUTE1 => NULL,
X_ATTRIBUTE2 => NULL,
X_ATTRIBUTE3 => NULL,
X_ATTRIBUTE4 => NULL,
X_ENABLED_FLAG => 'Y',
X_START_DATE_ACTIVE => SYSDATE,
X_END_DATE_ACTIVE => NULL,
X_TERRITORY_CODE => NULL,
X_ATTRIBUTE5 => NULL,
X_ATTRIBUTE6 => NULL,
X_ATTRIBUTE7 => NULL,
X_ATTRIBUTE8 => NULL,
X_ATTRIBUTE9 => NULL,
X_ATTRIBUTE10 => NULL,
X_ATTRIBUTE11 => NULL,
X_ATTRIBUTE12 => NULL,
X_ATTRIBUTE13 => NULL,
X_ATTRIBUTE14 => NULL,
X_ATTRIBUTE15 => NULL,
X_MEANING => l_meaning,
X_DESCRIPTION => l_desc,
X_CREATION_DATE => SYSDATE,
X_CREATED_BY => FND_GLOBAL.USER_ID,
X_LAST_UPDATE_DATE => SYSDATE,
X_LAST_UPDATED_BY => FND_GLOBAL.USER_ID,
X_LAST_UPDATE_LOGIN => FND_GLOBAL.LOGIN_ID);
SELECT 1
FROM hz_party_sites hps,
hz_party_site_uses hpsu
WHERE hps.party_id = p_party_id
AND hps.location_id = p_location_id
AND hpsu.party_site_id = hps.party_site_id
AND hpsu.site_use_type = 'SUPPLIER_SHIP_FROM';
SELECT pick_grouping_rule_id
FROM wsh_pick_grouping_rules
WHERE p_pick_grouping_rule_id IS NOT NULL
AND pick_grouping_rule_id = p_pick_grouping_rule_id
AND trunc(sysdate) BETWEEN nvl(start_date_active,trunc(sysdate)) AND nvl(end_date_active,trunc(sysdate) + 1)
UNION ALL
SELECT pick_grouping_rule_id
FROM wsh_pick_grouping_rules
WHERE p_pick_grouping_rule_id IS NULL
AND name = p_pick_grouping_rule_name
AND trunc(sysdate) BETWEEN nvl(start_date_active,trunc(sysdate)) AND nvl(end_date_active,trunc(sysdate) + 1);
SELECT pick_sequence_rule_id
FROM wsh_pick_sequence_rules
WHERE p_pick_sequence_rule_id IS NOT NULL
AND pick_sequence_rule_id = p_pick_sequence_rule_id
AND trunc(sysdate) BETWEEN nvl(start_date_active,trunc(sysdate)) AND nvl(end_date_active,trunc(sysdate) + 1)
UNION ALL
SELECT pick_sequence_rule_id
FROM wsh_pick_sequence_rules
WHERE p_pick_sequence_rule_id IS NULL
AND name = p_pick_sequence_rule_name
AND trunc(sysdate) BETWEEN nvl(start_date_active,trunc(sysdate)) AND nvl(end_date_active,trunc(sysdate) + 1);
SELECT Ship_Confirm_rule_id
FROM wsh_Ship_Confirm_rules
WHERE p_Ship_Confirm_rule_id IS NOT NULL
AND Ship_Confirm_rule_id = p_Ship_Confirm_rule_id
AND trunc(sysdate) BETWEEN nvl(effective_start_date,trunc(sysdate)) AND nvl(effective_end_date,trunc(sysdate) + 1)
UNION ALL
SELECT Ship_Confirm_rule_id
FROM wsh_Ship_Confirm_rules
WHERE p_Ship_Confirm_rule_id IS NULL
AND name = p_Ship_Confirm_rule_name
AND trunc(sysdate) BETWEEN nvl(effective_start_date,trunc(sysdate)) AND nvl(effective_end_date,trunc(sysdate) + 1);
SELECT batch_id
FROM wsh_picking_Batches
WHERE p_picking_batch_id IS NOT NULL
AND batch_id = p_picking_batch_id
UNION ALL
SELECT batch_id
FROM wsh_picking_batches
WHERE p_picking_batch_id IS NULL
AND name = p_picking_batch_name;
select flv.lookup_code ship_method_code,
flv.meaning
from fnd_lookup_values_vl flv, wsh_carrier_services wcs
where flv.lookup_code = wcs.ship_method_code
and wcs.ship_method_code = p_ship_method_code
and flv.lookup_type = 'SHIP_METHOD'
and flv.view_application_id = 3
and wcs.enabled_flag='Y'
UNION ALL
select flv.lookup_code ship_method_code,
flv.meaning
from fnd_lookup_values_vl flv, wsh_carrier_services wcs
where flv.lookup_code = wcs.ship_method_code
and NVL(p_ship_method_code,FND_API.G_MISS_CHAR) = FND_API.G_MISS_CHAR
and flv.lookup_type = 'SHIP_METHOD'
and flv.view_application_id = 3
and flv.meaning = p_ship_method_name
and wcs.enabled_flag='Y' ;
SELECT lookup_code
FROM fnd_lookup_values_vl
WHERE UPPER(lookup_code) = UPPER(p_lookup_code) AND
lookup_type = p_lookup_type AND
nvl(start_date_active,sysdate)<=sysdate AND nvl(end_date_active,sysdate)>=sysdate AND
view_application_id = 660 AND
enabled_flag = 'Y';
SELECT lookup_code
FROM fnd_lookup_values_vl
WHERE meaning = p_meaning AND
lookup_type = p_lookup_type AND
nvl(start_date_active,sysdate)<=sysdate AND nvl(end_date_active,sysdate)>=sysdate AND
view_application_id = 660 AND
enabled_flag = 'Y';
select inventory_location_id
into x_locator_id
from mtl_item_locations_kfv
where concatenated_segments = p_locator_code
and organization_id = p_organization_id
and rownum = 1;
select cust_items.customer_item_id
into x_customer_item_id
from
( select mci.customer_item_id, mci.item_definition_level
from mtl_customer_items mci
where mci.customer_item_number = p_item_number
and mci.customer_id = p_customer_id
and mci.item_definition_level = 1
union
select mci1.customer_item_id, mci1.item_definition_level
from mtl_customer_items mci1
where mci1.customer_item_number = p_item_number
and mci1.customer_id = p_customer_id
and mci1.address_id = p_address_id
and mci1.item_definition_level = 3
order by 2 desc ) cust_items
where rownum = 1;
select ship_method_code
into x_ship_method_code
from wsh_carriers wc,
wsh_carrier_services wcs,
wsh_org_carrier_services wocs
where wocs.organization_id = p_organization_id
and wocs.carrier_service_id = wcs.carrier_service_id
and wcs.mode_of_transport = p_mode_of_transport
and wcs.service_level = p_service_level
and wcs.carrier_id = wc.carrier_id
and wc.freight_code = p_carrier_code;
SELECT carrier_id
FROM wsh_carriers_v
WHERE nvl(x_carrier_id,fnd_api.g_miss_num) <> fnd_api.g_miss_num
AND carrier_id = x_carrier_id
AND nvl(generic_flag, 'N') = 'N'
AND active = 'A'
UNION ALL
SELECT carrier_id
FROM wsh_carriers_v
WHERE nvl(x_carrier_id,fnd_api.g_miss_num) = fnd_api.g_miss_num
AND freight_code = p_freight_code
AND nvl(generic_flag, 'N') = 'N'
AND active = 'A';