Sleep

This sleep procedure internally utilizes the Java sleep method and generally does not require any special database privileges. The parameter is defined in milliseconds.

Example

The following invokes a sleep for 5 seconds.

begin
    ria_dih.sleep(5000);
end;
/

create_cx_table

The CX tables are used in conversions to store the legacy key value in a CX ID column and provide a cross-reference between the legacy key and the newly generated ID. For more information, see CX Tables and CI Views.

This procedure can be used to create such a CX table from a base CI table. It adds a CX ID column and, optionally, a CX foreign key to a parent. The base table is renamed to the name specified in the tbl_renamed parameter. The renamed table can be dropped afterward if not needed.

Parameters

Parameter Description
CX_<table_name>

Name of the CX table to be created. For example, CX_PER.

Type: varchar2

<table_name>

The name of the CI table to be created. For example, CI_PER.


Type: varchar2

<col_name>

Primary key column name to create an external version for.

For example, if PER_ID is specified, a CX_PER_ID column will be added to the CX table. A unique index would be created for each of these two columns.

Type: varchar2

<tbl_renamed>

Backup name for the original CI table that can be any non-existent table name. This can be dropped afterward if it is no longer needed.

Type: varchar2

<fk_col_name>

Specifies the external foreign key column name to create a table that has a foreign key reference to a parent. For example, for table CX_BSEG, the CX_BILL_ID column will be specified here to create the CX_BILL_ID, which would point to the parent CX_BILL.

Type: varchar2
Default: null

Examples

The following example creates a CX_ACCT table from CI_ACCT with a new CX_ACCT_ID column. It also creates two unique indexes, one for ACCT_ID and another one for CX_ACCT_ID.

{% code overflow=“wrap” %}

begin
 	    ria_dih.create_cx_table(cx_tbl_name => 'CX_ACCT',
                                   tbl_name => 'CI_ACCT',
                                   col_name => 'ACCT_ID',
                                   tbl_renamed => 'C$_ACCT');
end;
/

{% endcode %}

The following example creates a CX_SA table from CI_SA with new CX_SA_ID and CX_ACCT_ID columns. It also creates two unique indexes, one for SA_ID and another one for CX_SA_ID. The original CI_SA table will be renamed to C$_SA and can be dropped if no longer needed.

{% code overflow=“wrap” %}

begin
	    ria_dih.create_cx_table(cx_tbl_name => 'CX_SA',
                                   tbl_name => 'CI_SA',
                                   col_name => 'SA_ID',
                                   tbl_renamed => 'C$_SA',
                                   fk_col_name => 'CX_ACCT_ID');
end;
/

{% endcode %}

reload_k_table

In an on-premise data migration, the relevant K tables in the staging schema must be copied from the production schema so that the key generation routines can check for uniqueness against the latest version of the K tables.

This procedure can be invoked from a script executable as part of a migration chain to refresh a K table from the production schema. It drops and recreates the table, copying the rows before creating the index.

Parameters

Parameter Description
<k_table_name>

Specifies the K table to copy. For example CI_PER_K.

Type: varchar2

<ignore_converted_ids>

If set to true, it will not copy the K rows generated by the previous conversion run. Those converted IDs do typically not need to be used in a uniqueness check, as they will be replaced by the IDs created by the current run.

For this to work, the CX_CONVERTED_ID table must exist and be used to track converted data. If the table does not exist, this parameter is ignored. For more information, see Data Migration Control Tables.

Type: boolean
Default: false

<source_schema>

Specifies the schema from which to copy the K table.

Type: varchar2
Default: CISADM

<rows_affected> When used from a PL/SQL block, this provides the number of rows affected after the copy operation. The example below illustrates this.

Example

This procedure can be invoked individually for specific tables from a script executable. However, the following example uses reload_k_table in a template SQL statement for the executable class SQLSetWorkEntryExecutor. This example was taken from the RELOAD_K_TABLE executable provided with the tool.

declare
    l_rows_affected integer;
begin
    ria_dih.reload_k_table(k_table_name => '{targetTable}',
                           ignore_converted_ids => false,
                           source_schema => 'CISADM',
                           rows_affected => l_rows_affected);
    ? := l_rows_affected;
end;