8: workday_pattern NUMBER;
9: BEGIN
10: if x_calendar_or_shift = 0 then
11: select count(*) into workday_pattern
12: from BOM_WORKDAY_PATTERNS
13: where calendar_code = x_calendar_code
14: and shift_num is null;
15: elsif x_calendar_or_shift = 1 then
16: select count(*) into workday_pattern from BOM_WORKDAY_PATTERNS
12: from BOM_WORKDAY_PATTERNS
13: where calendar_code = x_calendar_code
14: and shift_num is null;
15: elsif x_calendar_or_shift = 1 then
16: select count(*) into workday_pattern from BOM_WORKDAY_PATTERNS
17: where calendar_code = x_calendar_code
18: and shift_num = x_shift_num;
19: end if;
20: return (workday_pattern);