gen and save child id

Overview

This function generates a unique child ID for the inherited ID of the supplied parent_id and inserts it into the target_k_table.

Parameters

ParameterDescription
id_nameName of the ID.

Type: varchar2
id_sizeSpecifies the length of the ID to generate.

Type: number
target_k_tableSpecifies where the generated child and inherited IDs will be inserted.

Type: varchar2
parent_id

Specifies the parent ID used to generate the child and inherited IDs.

Type: varchar2

env_idSpecifies the ID of the source environment.

Type: number
thread_numberSpecifies the actual thread number if the function is invoked from multiple threads to prevent generating duplicate IDs, which will result in unique constraint errors at the time of commit.

Type: number
Default: 1
thread_countSpecifies the actual thread count if the function is invoked from multiple threads to prevent generating duplicate IDs, which will result in unique constraint errors at the time of commit.

Type: number
Default: 1
inherited_id_sizeSpecifies the number of digits to copy from the parent_id to generated_id.

If the id_size is more than the inherited_id_size, the remaining digits are randomly generated.

Type: number
Default: 6
max_retriesSpecifies the number of retries the generation will run if a duplicate ID already exists in the target_k_table.

Type: number
Default: 10
generated_idIndicates the generated ID after the function is executed.

Type: varchar2

Example

The following mapping expression generates a new 12-digit BILL_ID and inserts the id into the CI_BILL_K table. The first 6 digits of the BILL_ID will be the same as the first 6 digits of the ACCT_ID, and the remaining 6 digits would be randomly generated.

ria_dih.gen_and_save_child_id('BILL_ID',
                              12,
                              'CI_BILL_K',
                              ACCT_ID,
                              {ENV_ID},
                              {$threadNumber},
                              {$threadCount})

The {$threadNumber} and {$threadCount} variables allow the generation function to work in multiple threads.