Lead your team forward
OCT 24 / 9AM ET Register nowHow to Fill a New Column with Data
When adding a new column to the RDM model, you can pre-fill it with data immediately while deploying the model or construct a ONE plan using the RDM Importer step to fill in the data later.
Using alter hints
This is done by creating an XML file alter-hints.xml
and adding it to the configuration ZIP file before deploying a new configuration (see How to Deploy an RDM Web App Configuration).
See How to Use Alter Hints for a detailed explanation of the XML structure and other practical examples.
The following example shows how to use alter-hints.xml
to fill the new column with data in three different ways:
-
Filling all records with a constant (string and integer example).
-
Inheriting values from a different column.
-
Filling a column with an SQL expression.
alter-hints.xml
<alter-hints>
<entities>
<entity sourceName="tableA" targetName="tableA">
<columns>
<!-- Filling all records with a constant -->
<column targetName="newColumnStr" expression="'string enclosed in single quotes'"/> <!-- string column example -->
<column targetName="newColumnInt" expression="0"/> <!-- integer column example -->
<!-- Inheriting values from a different column -->
<column targetName="newColumnB" expression="sourceColumn" permissionsFrom="sourceColumn"/>
<!-- Filling a column with an SQL expression -->
<column targetName="newColumnC" expression="to_char(ColumnA) || '-' || ColumnB"/>
</columns>
</entity>
</entities>
</alter-hints>
Using a ONE plan
If you want to make a full import of data into your new column, you can easily do this using a ONE plan.
Step 1 Prepare data
Prepare a data source (file, database table, and others) consisting of the primary key attribute and the new column.
You can export data from RDM using Bulk > Export and then modify the output by adding a new column to it. See Importing and Exporting Data in RDM. |
Step 2 Construct the plan
Construct a ONE plan containing the RDM Importer step. See the plan in Configuring Tasks for Importing Data from Text Files for inspiration.
The Columns tab of the RDM Importer step must contain the table unique key columns, so that the importer is able to perform the incremental merge of data. |
Was this page useful?