[Home] [Help]
224: END IF;
225:
226: --6531911 : Removed multiple select stmts into one cursor stmt
227: FOR cur IN (SELECT control_level, attribute_name
228: FROM mtl_item_attributes
229: WHERE attribute_name IN ('MTL_SYSTEM_ITEMS.LOT_CONTROL_CODE'
230: ,'MTL_SYSTEM_ITEMS.SHELF_LIFE_CODE'
231: ,'MTL_SYSTEM_ITEMS.SERIAL_NUMBER_CONTROL_CODE'
232: ,'MTL_SYSTEM_ITEMS.REVISION_QTY_CONTROL_CODE'
882: declare /*Changes made for perf issue for bug 7567261*/
883: shipping_level NUMBER :=0;
884: begin
885: select count(1) into shipping_level
886: from mtl_item_attributes
887: where control_level = 1
888: and attribute_name=attr_name;
889:
890: if (shipping_level = 0) then
1003: (select organization_id
1004: from mtl_parameters
1005: where master_organization_id = p_master_org
1006: and 1=(select control_level
1007: from mtl_item_attributes
1008: where
1009: attribute_name='MTL_SYSTEM_ITEMS.SO_TRANSACTIONS_FLAG'
1010: )
1011: )
1091: (select organization_id
1092: from mtl_parameters
1093: where master_organization_id = p_master_org
1094: and 1 = (select control_level
1095: from mtl_item_attributes
1096: where attribute_name= 'MTL_SYSTEM_ITEMS.ATP_FLAG')
1097: )
1098: or bom.organization_id = p_org_id)
1099: and rownum = 1;
1273: and organization_id in
1274: (select organization_id
1275: from mtl_parameters
1276: where master_organization_id = p_master_org AND
1277: ( 1=(select control_level from mtl_item_attributes
1278: where attribute_name= 'MTL_SYSTEM_ITEMS.INVENTORY_ASSET_FLAG')
1279:
1280: OR
1281: 1=(select control_level from mtl_item_attributes
1277: ( 1=(select control_level from mtl_item_attributes
1278: where attribute_name= 'MTL_SYSTEM_ITEMS.INVENTORY_ASSET_FLAG')
1279:
1280: OR
1281: 1=(select control_level from mtl_item_attributes
1282: where attribute_name='MTL_SYSTEM_ITEMS.COSTING_ENABLED_FLAG'))
1283: )
1284: and rownum = 1;
1285:
1313: and organization_id in
1314: (select organization_id
1315: from mtl_parameters
1316: where master_organization_id = p_master_org AND
1317: ( 1=(select control_level from mtl_item_attributes
1318: where attribute_name= 'MTL_SYSTEM_ITEMS.INVENTORY_ASSET_FLAG')
1319:
1320: OR
1321: 1=(select control_level from mtl_item_attributes
1317: ( 1=(select control_level from mtl_item_attributes
1318: where attribute_name= 'MTL_SYSTEM_ITEMS.INVENTORY_ASSET_FLAG')
1319:
1320: OR
1321: 1=(select control_level from mtl_item_attributes
1322: where attribute_name='MTL_SYSTEM_ITEMS.COSTING_ENABLED_FLAG'))
1323: )
1324:
1325: and costed_flag is not null
1353: and organization_id in
1354: (select organization_id
1355: from mtl_parameters
1356: where master_organization_id = p_master_org AND
1357: ( 1=(select control_level from mtl_item_attributes
1358: where attribute_name= 'MTL_SYSTEM_ITEMS.INVENTORY_ASSET_FLAG')
1359:
1360: OR
1361: 1=(select control_level from mtl_item_attributes
1357: ( 1=(select control_level from mtl_item_attributes
1358: where attribute_name= 'MTL_SYSTEM_ITEMS.INVENTORY_ASSET_FLAG')
1359:
1360: OR
1361: 1=(select control_level from mtl_item_attributes
1362: where attribute_name='MTL_SYSTEM_ITEMS.COSTING_ENABLED_FLAG'))
1363:
1364:
1365: and primary_cost_method in (2,5,6))