My Oracle Support Banner

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 SEPTEMBER 29, 2020

Applies to:

Oracle Human Resources - Version and later
Information in this document applies to any platform.


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:


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.


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

  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;

  select business_group_id
  into   l_business_group_id
  from   per_business_groups
  where  name = 'Your business group';
  (   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         => 'Last name',
      p_sex               => 'U',
      p_first_name        => 'First name',
      -- 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

2. you will get the following error


To view full details, sign in with your My Oracle Support account.

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

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.