62:
63: begin
64: select distinct case when (attribute_value_code/10) < 2 then 1 else 0 end
65: into l_temp
66: from wip_preference_values
67: where preference_id=26 and
68: level_id in (select level_id
69: from wip_preference_levels
70: where organization_id = p_organization_id and
106:
107: begin
108: select distinct decode(mod(attribute_value_code,10),1,1,0)
109: into l_temp
110: from wip_preference_values
111: where preference_id=26 and
112: level_id in (select level_id
113: from wip_preference_levels
114: where organization_id = p_organization_id and
348: from wip_preference_levels
349: where organization_id = p_organization_id
350: and department_id is null
351: and level_id in (select level_id
352: from wip_preference_values
353: where preference_id = 26)
354: and rownum=1;
355:
356: exception
364:
365: begin
366: select to_number(attribute_value_code)
367: into l_pref_value
368: from wip_preference_values
369: where level_id = l_level_id
370: and preference_id = 26;
371: exception
372: when no_data_found then
375: -- if records are inherited, then we will consider site as the upper level and not responsibility.
376:
377: select to_number(attribute_value_code)
378: into l_pref_value
379: from wip_preference_values
380: where level_id = 1
381: and preference_id = 26;
382:
383: when others then