HR_CONTRACT_API.CREATE_PERSON does not allow Gender Unknown and throws error ORA-20001: The entry for gender is not recognized. Check and re-enter M or F.

(Doc ID 353778.1)

Last updated on AUGUST 25, 2017

Applies to:

Oracle Human Resources - Version 11.5.10.0 to 11.5.10.2 [Release 11.5.10]
Information in this document applies to any platform.

Symptoms

On 11.5.10 in Production:
When attempting to use the hr_contact_api.create_person api to load contacts to load all contacts with the unknown gender (U). The form allows this, but the API gives the following error:


ERROR
Hr_contact_api.create_person does not allow gender unknown ora-20001
Error: SQLCODE=-20001 SQLERRM=ORA-20001: The entry for gender is not recognized. Check and re-enter M or F.



STEPS
--------
The issue can be reproduced at will with the following steps:
1. use a script to call the contact API

declare
  l_business_group_id        hr_all_organization_units.business_group_id%type;
  l_person_id             per_all_people_f.person_id%type;
  l_object_version_number per_all_people_f.object_version_number%type;
  l_effective_start_date  per_all_people_f.effective_start_date%type;
  l_effective_end_date    per_all_people_f.effective_end_date%type;
  l_full_name             per_all_people_f.full_name%type;
  l_comment_id            per_all_people_f.comment_id%type;
  l_per_date_from         per_all_people_f.effective_start_date%type;
  l_name_combination_warning boolean;
  l_orig_hire_warning     boolean;
begin

  select business_group_id
  into   l_business_group_id
  from   per_business_groups
  where  name = 'Your business group';
 
  hr_contact_api.create_person
  (   p_validate          => false,
      p_start_date        => to_date('15/01/1990', 'dd/mm/yyyy'),
      p_business_group_id => l_business_group_id,
      p_last_name         => 'Lincoln',
      p_sex               => 'U',
      p_first_name        => 'Abraham',
      -- p_per_information_category => 'ZA',
      -- p_per_information4 => 'N',
      p_person_id                => l_person_id,
      p_object_version_number    => l_object_version_number,
      p_effective_start_date     => l_effective_start_date,
      p_effective_end_date       => l_effective_end_date,
      p_full_name                => l_full_name,
      p_comment_id               => l_comment_id,
      p_name_combination_warning => l_name_combination_warning,
      p_orig_hire_warning        => l_orig_hire_warning
  );
end;

2. you will get the following error

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms