21: begin
22: --
23: select status
24: into l_status
25: from pay_upgrade_status
26: where upgrade_definition_id = p_upg_def_id
27: and business_group_id = p_bus_grp;
28: --
29: /* If we are trying to reset a completed status
37: 1 = 2);
38: --
39: end if;
40: --
41: update pay_upgrade_status
42: set status = p_status
43: where upgrade_definition_id = p_upg_def_id
44: and business_group_id = p_bus_grp;
45: --
45: --
46: exception
47: when no_data_found then
48: if (p_status in ('U', 'P')) then
49: insert into pay_upgrade_status
50: (upgrade_definition_id,
51: status,
52: business_group_id)
53: values (p_upg_def_id,
66: begin
67: --
68: select status
69: into l_status
70: from pay_upgrade_status
71: where upgrade_definition_id = p_upg_def_id
72: and legislation_code = p_leg_code;
73: --
74: /* If we are trying to reset a completed status
82: 1 = 2);
83: --
84: end if;
85: --
86: update pay_upgrade_status
87: set status = p_status
88: where upgrade_definition_id = p_upg_def_id
89: and legislation_code = p_leg_code;
90: --
90: --
91: exception
92: when no_data_found then
93: if (p_status in ('U', 'P')) then
94: insert into pay_upgrade_status
95: (upgrade_definition_id,
96: status,
97: legislation_code)
98: values (p_upg_def_id,
111: begin
112: --
113: select status
114: into l_status
115: from pay_upgrade_status
116: where upgrade_definition_id = p_upg_def_id
117: and legislation_code is null
118: and business_group_id is null;
119: --
128: 1 = 2);
129: --
130: end if;
131: --
132: update pay_upgrade_status
133: set status = p_status
134: where upgrade_definition_id = p_upg_def_id
135: and legislation_code is null
136: and business_group_id is null;
137: --
138: exception
139: when no_data_found then
140: if (p_status in ('U', 'P', 'C')) then
141: insert into pay_upgrade_status
142: (upgrade_definition_id,
143: status
144: )
145: values (p_upg_def_id,