The following lines contain the word 'select', 'insert', 'update' or 'delete':
PROCEDURE Select_Printer( p_concurrent_program_id IN NUMBER,
p_organization_id IN NUMBER,
p_level_type_id IN NUMBER,
p_level_value_id IN VARCHAR2,
p_equipment_instance IN VARCHAR2,
x_printer OUT NOCOPY VARCHAR2);
-- Now, Populate pl/sql table so that we can do the SELECT in a loop.
/* Bug 7341536 --Increased the Iteration of the for loop from 8 to 9 as there* are 9 Level
-- This is regression due to fix done in RFID project done in R12 in
version 115.13 (No Bug no specified) */
for i in 1..9 -- hardcoded 8 since we have 8 levels. 8th value added for Bug 3534965(3510460 Frontport)
loop
level_table(i).priority_seq := i; -- priority seq is not used. Populating it anyway..
-- Call Select_Printer in a loop starting with equipment instance.
-- If you find a printer, just return. Otherwise, continue with the next
-- level and so on until you find an appropriate printer.
for i in 1..level_table.count
loop
if ( level_table(i).level_value_id is not null ) then
-- Pass l_organization_id instead of p_organization_id since it gets manipulated above.
-- Removed Label_Id parameter for Bug 2996792.
Select_Printer( p_concurrent_program_id, l_organization_id, level_table(i).level_type_id,
level_table(i).level_value_id, p_equipment_instance, x_printer);
-- Therefore, we will include the condition of "label_id is null" in the following select.
-- Similarly, with equipment_instance.
-- For safety, include rownum=1.
--Bug fix 2726195 replaced table name with view wsh_report_printers_v
if (p_equipment_instance is not null ) then
begin
-- Removed Label_Id from Query for Bug 2996792.
select printer_name
into x_printer
from wsh_report_printers_v
where nvl(default_printer_flag,'N') = 'Y'
and enabled_flag = 'Y'
and concurrent_program_id = p_concurrent_program_id
and level_type_id = 10001 -- site level
and level_value_id = 0 -- site value
and (equipment_instance is null and p_equipment_instance is not null)
and rownum = 1; -- make sure we get only 1 row.
PROCEDURE Select_Printer( p_concurrent_program_id IN NUMBER,
p_organization_id IN NUMBER,
p_level_type_id IN NUMBER,
p_level_value_id IN VARCHAR2,
p_equipment_instance IN VARCHAR2,
x_printer OUT NOCOPY VARCHAR2) is
--
--Bug fix 2726195 replaced table name with view wsh_report_printers_v
--
cursor printer is
select printer_name
from wsh_report_printers_v
where nvl(default_printer_flag,'N') = 'Y'
and enabled_flag = 'Y'
and concurrent_program_id = p_concurrent_program_id
and level_type_id = p_level_type_id
and nvl(equipment_instance,'NOTHING') = nvl(p_equipment_instance, 'NOTHING')
and decode(level_type_id, 10006, subinventory, level_value_id) = p_level_value_id
-- consider organization_id only for Zone or Equipment type only. Bugfix 3980388
and decode(level_type_id, 10006, nvl(organization_id,-9),
10007, nvl(organization_id,-9),
nvl(p_organization_id,-9)) = nvl(p_organization_id,-9);
l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'SELECT_PRINTER';
WSH_DEBUG_SV.log(l_module_name,'Printer Selected : ',x_printer);
END Select_Printer;