/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2010 Applaud Solutions UK Ltd                |
 |                             All rights reserved                            |
 *===========================================================================*/

SET VERIFY OFF
SET FEEDBACK OFF
WHENEVER OSERROR  EXIT FAILURE ROLLBACK
WHENEVER SQLERROR EXIT FAILURE ROLLBACK

DECLARE

  --
  -- Local constants, exceptions and variables
  --
  l_UDT             CONSTANT varchar2(22) := 'XXAS_SRC_CRITERIA';
  l_YES             CONSTANT varchar2(1)  := 'Y';
  l_EFF_DT          CONSTANT date         := to_date('1900-01-01','YYYY-MM-DD');
  l_BG_ID           CONSTANT number       := to_number('&1');
  l_PERMISSION_COL  CONSTANT varchar2(10) := 'Permission';
  l_SEARCHABLE_COL  CONSTANT varchar2(10) := 'Searchable';
  l_FACET_COL       CONSTANT varchar2(12) := 'Use as Facet';
  l_MULTIROW_COL    CONSTANT varchar2(8)  := 'Multirow';

  e_already_exists          EXCEPTION;

  l_exists                  varchar2(1);
  l_user_table_id           number;
  l_udt_ovn                 number;
  l_permission_col_id       number;
  l_permission_col_ovn      number;
  l_searchable_col_id       number;
  l_searchable_col_ovn      number;
  l_facet_col_id            number;
  l_facet_col_ovn           number;
  l_multirow_col_id         number;
  l_multirow_col_ovn        number;
  l_sequence                number := 1;
  l_row_id                  number;
  l_row_ovn                 number;
  l_row_eff_start           date;
  l_row_eff_end             date;
  l_val_id                  number;
  l_val_ovn                 number;
  l_val_eff_start           date;
  l_val_eff_end             date;

  --
  -- Gets the UDT if already created
  --
  CURSOR csr_get_udt IS
  SELECT l_YES
  FROM   pay_user_tables udt
  WHERE  udt.user_table_name = l_UDT
  AND    udt.business_group_id = l_BG_ID;

BEGIN

  --
  -- Check if the UDT already exists
  --
  OPEN  csr_get_udt;
  FETCH csr_get_udt INTO l_exists;
  CLOSE csr_get_udt;

  IF l_exists IS NOT NULL THEN
    RAISE e_already_exists;
  END IF;

  --
  -- Create the UDT
  --
  pay_user_table_api.create_user_table
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_business_group_id     => l_BG_ID
    ,p_range_or_match        => 'M'
    ,p_user_key_units        => 'T'
    ,p_user_table_name       => l_UDT
    ,p_user_table_id         => l_user_table_id
    ,p_object_version_number => l_udt_ovn);

  --
  -- Create the Permission UDT column
  --
  pay_user_column_api.create_user_column
    (p_validate              => FALSE
    ,p_business_group_id     => l_BG_ID
    ,p_user_table_id         => l_user_table_id
    ,p_user_column_name      => l_PERMISSION_COL
    ,p_user_column_id        => l_permission_col_id
    ,p_object_version_number => l_permission_col_ovn);

  --
  -- Create the Searchable UDT column
  --
  pay_user_column_api.create_user_column
    (p_validate              => FALSE
    ,p_business_group_id     => l_BG_ID
    ,p_user_table_id         => l_user_table_id
    ,p_user_column_name      => l_SEARCHABLE_COL
    ,p_user_column_id        => l_searchable_col_id
    ,p_object_version_number => l_searchable_col_ovn);

  --
  -- Create the Facet UDT column
  --
  pay_user_column_api.create_user_column
    (p_validate              => FALSE
    ,p_business_group_id     => l_BG_ID
    ,p_user_table_id         => l_user_table_id
    ,p_user_column_name      => l_FACET_COL
    ,p_user_column_id        => l_facet_col_id
    ,p_object_version_number => l_facet_col_ovn);

  --
  -- Create the Multirow UDT column
  --
  pay_user_column_api.create_user_column
    (p_validate              => FALSE
    ,p_business_group_id     => l_BG_ID
    ,p_user_table_id         => l_user_table_id
    ,p_user_column_name      => l_MULTIROW_COL
    ,p_user_column_id        => l_multirow_col_id
    ,p_object_version_number => l_multirow_col_ovn);
    
  --
  -- Create the Person Name Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'Person Name'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the Person Name Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_PUBLIC_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Person Name Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Person Name Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Person Name Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
  --
  -- Create the Employee Number Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'EN'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the Employee Number Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_SECURED_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Employee Number Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Employee Number Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Employee Number Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
  --
  -- Create the Contingent Worker Number Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'CN'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the Contingent Worker Number Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_SECURED_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Contingent Worker Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Contingent Worker Number Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Contingent Worker Number Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
  --
  -- Create the Email Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'Email'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the Email Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_PUBLIC_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Email Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Email Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Email Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
  --
  -- Create the NI Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'NI'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the NI Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_SECURED_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the NI Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the NI Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the NI Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
  --
  -- Create the Person Type Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'Person Type'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the Person Type Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_SECURED_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Person Type Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Person Type Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Person Type Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
  --
  -- Create the Position Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'Position'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the Position Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_PUBLIC_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Position Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Position Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Position Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
  --
  -- Create the Job Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'Job'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the Job Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_PUBLIC_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Job Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Job Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Job Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
  --
  -- Create the Department Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'Department'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the Department Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_PUBLIC_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Department Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Department Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Department Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
  --
  -- Create the Location Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'Location'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the Location Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_PUBLIC_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Location Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Location Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Location Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
  --
  -- Create the Payroll Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'Payroll'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the Payroll Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_SECURED_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Payroll Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Payroll Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Payroll Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
  --
  -- Create the Grade Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'Grade'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the Grade Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_SECURED_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Grade Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Grade Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Grade Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Assignment Category Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'Assignment Category'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the Assignment Category Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_SECURED_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Assignment Category Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Assignment Category Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Assignment Category Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
  --
  -- Create the Employee Category Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'Employee Category'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the Employee Category Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_SECURED_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Employee Category Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Employee Category Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Employee Category Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
  --
  -- Create the FTE Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'FTE'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the FTE Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_SECURED_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the FTE Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the FTE Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the FTE Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
  --
  -- Create the Service Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'Service'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the Service Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_PUBLIC_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Sevice Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Service Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Service Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Qualifications Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'Qualifications'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the Qualifications Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_SECURED_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Qualifications Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Qualifications Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Qualifications Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
  --
  -- Create the Competencies Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'Competencies'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the Competencies Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_SECURED_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Competencies Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Competencies Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Competencies Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
  --
  -- Create the About Me Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'About Me'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the About Me Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_PUBLIC_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the About Me Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the About Me Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the About Me Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'N'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
  --
  -- Create the Tags Row
  --
  pay_user_row_api.create_user_row
    (p_validate              => FALSE
    ,p_effective_date        => l_EFF_DT
    ,p_user_table_id         => l_user_table_id
    ,p_row_low_range_or_name => 'Tags'
    ,p_display_sequence      => l_sequence
    ,p_business_group_id     => l_BG_ID
    ,p_user_row_id           => l_row_id
    ,p_object_version_number => l_row_ovn
    ,p_effective_start_date  => l_row_eff_start
    ,p_effective_end_date    => l_row_eff_end);

  l_sequence := l_sequence + 1;

  --
  -- Create the Tags Permission Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_permission_col_id
    ,p_value                   => 'XXAS_SRC_PUBLIC_PERM'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Tags Searchable Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_searchable_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Tags Facet Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_facet_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);

  --
  -- Create the Tags Multirow Value
  --
  pay_user_column_instance_api.create_user_column_instance
    (p_validate                => FALSE
    ,p_effective_date          => l_EFF_DT
    ,p_user_row_id             => l_row_id
    ,p_user_column_id          => l_multirow_col_id
    ,p_value                   => 'Y'
    ,p_business_group_id       => l_BG_ID
    ,p_user_column_instance_id => l_val_id
    ,p_object_version_number   => l_val_ovn
    ,p_effective_start_date    => l_val_eff_start
    ,p_effective_end_date      => l_val_eff_end);
    
EXCEPTION

  WHEN e_already_exists THEN
    --
    -- No action required; UDT already exists
    --
    NULL;

END;
/
COMMIT;
EXIT;
