79: Begin
80: hr_utility.set_location('Entering:'||l_proc, 5);
81: p_rec.object_version_number := 1; -- Initialise the object version
82: --
83: -- Insert the row into: hr_questionnaires
84: --
85: insert into hr_questionnaires
86: ( questionnaire_template_id,
87: name,
81: p_rec.object_version_number := 1; -- Initialise the object version
82: --
83: -- Insert the row into: hr_questionnaires
84: --
85: insert into hr_questionnaires
86: ( questionnaire_template_id,
87: name,
88: text,
89: available_flag,
158: --
159: l_proc varchar2(72) := g_package||'pre_insert';
160: l_exists varchar2(1);
161: --
162: Cursor C_Sel1 is select hr_questionnaires_s.nextval from sys.dual;
163: --
164: Cursor C_Sel2 is
165: select null
166: from hr_questionnaires
162: Cursor C_Sel1 is select hr_questionnaires_s.nextval from sys.dual;
163: --
164: Cursor C_Sel2 is
165: select null
166: from hr_questionnaires
167: where questionnaire_template_id = hr_qsn_ins.g_questionnaire_template_id_i;
168: --
169: Begin
170: hr_utility.set_location('Entering:'||l_proc, 5);
180: --
181: -- The primary key values are already in use.
182: --
183: fnd_message.set_name('PER','PER_289391_KEY_ALREADY_USED');
184: fnd_message.set_token('TABLE_NAME','hr_questionnaires');
185: fnd_message.raise_error;
186: end if;
187: Close C_Sel2;
188: --
255: );
256: exception
257: when hr_api.cannot_find_prog_unit then
258: hr_api.cannot_find_prog_unit_error
259: (p_module_name => 'HR_QUESTIONNAIRES'
260: ,p_hook_type => 'AI'
261: );
262: end;
263: hr_utility.set_location(' Leaving:'||l_proc, 10);