The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT secondary_inventory_name
FROM mtl_secondary_inventories
WHERE organization_id = l_organization_id;
SELECT msi.secondary_inventory_name, milkfv.inventory_location_id
FROM mtl_secondary_inventories msi
,mtl_item_locations milkfv
WHERE msi.organization_id = l_organization_id
AND msi.secondary_inventory_name = nvl(l_subinventory_code, msi.secondary_inventory_name)
AND milkfv.organization_id(+) = l_organization_id
AND milkfv.subinventory_code(+) = msi.secondary_inventory_name;
SELECT
mp.organization_id organization_id
, mp.organization_code organization
, msi.secondary_inventory_name subinventory_code
, msi.description subinventory_description
, msi.status_id status_id
, mmsvl1.status_code subinventory_status
, msi.pick_uom_code subinventory_pick_uom
, msi.attribute_category subinv_attribute_category
, msi.attribute1 subinventory_attribute1
, msi.attribute2 subinventory_attribute2
, msi.attribute3 subinventory_attribute3
, msi.attribute4 subinventory_attribute4
, msi.attribute5 subinventory_attribute5
, msi.attribute6 subinventory_attribute6
, msi.attribute7 subinventory_attribute7
, msi.attribute8 subinventory_attribute8
, msi.attribute9 subinventory_attribute9
, msi.attribute10 subinventory_attribute10
, msi.attribute11 subinventory_attribute11
, msi.attribute11 subinventory_attribute12
, msi.attribute13 subinventory_attribute13
, msi.attribute14 subinventory_attribute14
, msi.attribute15 subinventory_attribute15
, msi.picking_order subinventory_pick_order
, msi.default_cost_group_id subinventory_def_cost_group_id
, ccg.cost_group subinventory_def_cost_group
, milkfv.inventory_location_id locator_id
, INV_PROJECT.GET_LOCSEGS(milkfv.inventory_location_id,milkfv.organization_id) locator
, milkfv.description locator_description
, milkfv.status_id locator_status_id
, mmsvl2.status_code locator_status
, milkfv.pick_uom_code locator_pick_uom
, milkfv.attribute_category locator_attribute_category
, milkfv.attribute1 locator_attribute1
, milkfv.attribute2 locator_attribute2
, milkfv.attribute3 locator_attribute3
, milkfv.attribute4 locator_attribute4
, milkfv.attribute5 locator_attribute5
, milkfv.attribute6 locator_attribute6
, milkfv.attribute7 locator_attribute7
, milkfv.attribute8 locator_attribute8
, milkfv.attribute9 locator_attribute9
, milkfv.attribute10 locator_attribute10
, milkfv.attribute11 locator_attribute11
, milkfv.attribute12 locator_attribute12
, milkfv.attribute13 locator_attribute13
, milkfv.attribute14 locator_attribute14
, milkfv.attribute15 locator_attribute15
, milkfv.project_id locator_project_id
, pap.name locator_project
, milkfv.task_id locator_task_id
, pat.task_name locator_task
, milkfv.picking_order locator_pick_order
, milkfv.max_weight locator_weight_capacity
, milkfv.location_weight_uom_code locator_weight_capacity_uom
, milkfv.max_cubic_area locator_volume_capacity
, milkfv.volume_uom_code locator_volume_capacity_uom
, milkfv.location_maximum_units locator_unit_capacity
, milkfv.alias locator_alias
FROM mtl_parameters mp
, mtl_secondary_inventories msi
, mtl_material_statuses_vl mmsvl1
, mtl_material_statuses_vl mmsvl2
, mtl_item_locations milkfv
, pa_tasks pat
, pa_projects_all pap
, cst_cost_groups ccg
WHERE mp.organization_id = l_organization_id
AND msi.secondary_inventory_name(+) = l_subinventory_code
AND msi.organization_id(+) = mp.organization_id
AND mmsvl1.status_id(+) = msi.status_id
AND mmsvl2.status_id(+) = milkfv.status_id
AND milkfv.inventory_location_id(+) = l_locator_id
AND milkfv.subinventory_code(+) = l_subinventory_code
AND milkfv.organization_id(+) = mp.organization_id
AND pap.project_id(+) = milkfv.project_id
AND pat.task_id(+) = milkfv.task_id
AND ccg.COST_GROUP_ID(+) = msi.DEFAULT_COST_GROUP_ID;
l_selected_fields INV_LABEL.label_field_variable_tbl_type;
l_selected_fields_count NUMBER;
-- a list of columns that are selected for format
l_column_name_list LONG;
--trace(' Getting selected fields ');
/* insert a record into wms_label_requests entity to
call the label rules engine to get appropriate label */
INV_LABEL.GET_FORMAT_WITH_RULE
( p_document_id =>p_label_type_info.label_type_id,
P_LABEL_FORMAT_ID => p_label_type_info.manual_format_id,
p_organization_id =>v_location.organization_id,
p_subinventory_code =>v_location.subinventory_code,
p_locator_id =>v_location.locator_id,
P_BUSINESS_FLOW_CODE => p_label_type_info.business_flow_code,
P_LAST_UPDATE_DATE =>sysdate,
P_LAST_UPDATED_BY =>FND_GLOBAL.user_id,
P_CREATION_DATE =>sysdate,
P_CREATED_BY =>FND_GLOBAL.user_id,
--P_PRINTER_NAME => l_printer,-- Removed in R12: 4396558
x_return_status =>l_return_status,
x_label_format_id =>l_label_format_id,
x_label_format =>l_label_format,
x_label_request_id =>l_label_request_id);
x_variables => l_selected_fields
, x_variables_count => l_selected_fields_count
, p_format_id => l_label_format_id);
IF (l_selected_fields_count=0) OR (l_selected_fields.count =0 ) THEN
IF (l_debug = 1) THEN
trace('no fields defined for this format: ' || l_label_format|| ',' ||l_label_format_id);
trace(' Found selected_fields for format ' || l_label_format ||', num='|| l_selected_fields_count);
/* Loop for each selected fields, find the columns and write into the XML_content*/
FOR i IN 1..l_selected_fields.count LOOP
IF (l_debug = 1) THEN
l_column_name_list := l_column_name_list || ',' ||l_selected_fields(i).column_name;
IF (l_selected_fields(i).SQL_STMT IS NOT NULL AND l_selected_fields(i).column_name = 'sql_stmt') THEN
IF (l_debug = 1) THEN
trace('Custom Labels Trace [INVLAP6B.pls]: ------------------------- REPORT BEGIN-------------------------------------');
trace('Custom Labels Trace [INVLAP6B.pls]: LABEL_FIELD_ID : ' || l_selected_fields(i).label_field_id);
trace('Custom Labels Trace [INVLAP6B.pls]: FIELD_VARIABLE_NAME : ' || l_selected_fields(i).variable_name);
trace('Custom Labels Trace [INVLAP6B.pls]: COLUMN_NAME : ' || l_selected_fields(i).column_name);
trace('Custom Labels Trace [INVLAP6B.pls]: SQL_STMT : ' || l_selected_fields(i).sql_stmt);
l_sql_stmt := l_selected_fields(i).sql_stmt;
|| l_selected_fields(i).variable_name
|| '">'
|| l_sql_stmt_result
|| variable_e;
ELSIF LOWER(l_selected_fields(i).column_name) = 'current_date' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || INV_LABEL.G_DATE || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'current_time' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || INV_LABEL.G_TIME || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'request_user' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || INV_LABEL.G_USER || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'organization' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.organization || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_code' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_code || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_description' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_description || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_status' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_status || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_pick_uom' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_pick_uom || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinv_attribute_category' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinv_attribute_category || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_attribute1' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_attribute1 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_attribute2' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_attribute2 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_attribute3' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_attribute3 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_attribute4' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_attribute4 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_attribute5' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_attribute5 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_attribute6' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_attribute6 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_attribute7' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_attribute7 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_attribute8' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_attribute8 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_attribute9' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_attribute9 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_attribute10' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_attribute10 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_attribute11' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_attribute11 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_attribute12' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_attribute12 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_attribute13' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_attribute13 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_attribute14' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_attribute14 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_attribute15' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_attribute15 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_pick_order' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_pick_order || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_def_cost_group' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.subinventory_def_cost_group || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_description' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_description || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_status' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_status || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_pick_uom' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_pick_uom || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_attribute_category' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_attribute_category || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_attribute1' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_attribute1 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_attribute2' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_attribute2 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_attribute3' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_attribute3 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_attribute4' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_attribute4 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_attribute5' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_attribute5 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_attribute6' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_attribute6 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_attribute7' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_attribute7 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_attribute8' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_attribute8 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_attribute9' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_attribute9 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_attribute10' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_attribute10 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_attribute11' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_attribute11 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_attribute12' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_attribute12 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_attribute13' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_attribute13 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_attribute14' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_attribute14 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_attribute15' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_attribute15 || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_project' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_project || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_task' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_task || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_pick_order' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_pick_order || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_weight_capacity' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_weight_capacity || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_weight_capacity_uom' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_weight_capacity_uom || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_volume_capacity' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_volume_capacity || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_volume_capacity_uom' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_volume_capacity_uom || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_unit_capacity' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_unit_capacity || VARIABLE_E;
ELSIF LOWER(l_selected_fields(i).column_name) = 'locator_alias' THEN l_location_data := l_location_data || VARIABLE_B || l_selected_fields(i).variable_name || '">' || v_location.locator_alias || VARIABLE_E;