Add DPR Subscription Member (ADDDPRSUBM)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Add DPR Subscription Member(ADDDPRSUBM) command adds a member to an existing subscription set, The source table has been registered with the Add DPR Registration (ADDDPRREG) command. The ADDDPRSUBM command reads the column definitions of the registered source table and uses them to create the target table automatically if the CRTTGTTBL parameter is specified as *YES. If the CRTTGTTBL parameter is specified as *NO, then an existing table will be used.

If the library specified on the TGTTBL parameter does not have a journal or journal receiver, they are created. The journal is called QSQJRN. The journal receiver is called QSQJRN nnnn , where nnnn is 0001 if no other journal receivers exist, and is incremented by 1 until an available name is found.

If the target table is created during the subscription, the target table is journaled to the QSQJRN journal. Otherwise, you must set up journaling for the target table separately.

If the value of the ADDREG parameter is *YES, the ADDDPRSUBM command also automatically registers the target table on the target server as a potential source table for another subscription. This is called auto-registration .

This command supports the iSeries environment only, and not the other databases that support DataPropagator.

Error Messages for ADDDPRSUBM

*ESCAPE Messages

ASN1038
No column names or expressions supplied.
ASN2051
Not authorized to Registration Extension table.
ASN2501
Not authorized to register table.
ASN303A
Row selection expression not valid.
ASN3036
Column not found.
ASN3037
Column already exists.
ASN3039
Column already exists.
ASN3041
Column functions are not allowed.
ASN3042
Columns cannot be renamed.
ASN3047
Internal error in module .
ASN3068
Key columns required for target type .
ASN3072
Relative record numbers are not being captured.
ASN3073
Record number column IBMQSQ_RRN is not available.
ASN3074
KEYCOL(IBMQSQ_RRN) not valid with target type .
ASN3078
The target file does not match the subscription.
ASN3079
The target file does not contain the correct columns.
ASN3115
Relational database is not DB2/400 V4R2 or greater.
ASN3210
UNIQUE must be *YES when TGTTYPE is *POINTINTIME.
ASN3218
A value of *RRN is not allowed on the KEYCOL parameter for this target type.
ASN3220
A value of *NONE on the KEYCOL parameter is not allowed with this target type.
ASN3231
UNIQUE must be *YES when TGTTYPE is *REPLICA.
ASN3232
UNIQUE must be *YES when TGTTYPE is *USERCOPY.
ASN3233
COLUMN must be *ALL when TGTTYPE is *REPLICA.
ASN3235
CALCCOL must be *NONE when TGTTYPE is *REPLICA.
ASN3241
Target table is registered as the wrong type.
ASN3253
Registration not found for table .
ASN3254
Registration already exists for table .
ASN3256
Not authorized to Subscription Set table.
ASN3257
Not authorized to Subscription Member table.
ASN3258
Not authorized to Subscription Columns table.
ASN3262
Source and target not valid.
ASN3263
Not authorized to Prune Control table.
ASN3266
Subscription does not exist for Apply Qualifier Set Name .
ASN3267
All members of set not from the same journal.
ASN3268
Subscription member created for Apply Qualifier Set Name
ASN3269
Member already exists.
ASN3277
Source table in contains the column.
ASN3278
TGTCCOL must be *COLUMN when TGTTYPE is *REPLICA.
ASN3283
Source table cannot be a view when TGTTYPE is *REPLICA.
ASN3290
Commit Count less than zero.
ASN3291
Registration Extension table not found.
ASN3292
Register table not found.
ASN3293
Pruning control table not found.
ASN4512
Set subscription table not found.
ASN4518
Subscription member table not found.
ASN4520
Subscription columns table not found.
Top

Parameters

Keyword Description Choices Notes
APYQUAL Apply qualifier Name Required, Positional 3
SETNAME Set name Name Required, Positional 4
TGTTBL Target table Qualified object name Required, Positional 2
Qualifier 1: Target table Name
Qualifier 2: Library Name
SRCTBL Source table Qualified object name Required, Positional 1
Qualifier 1: Source table Name
Qualifier 2: Library Name
CTLSVR Control server Name, *LOCAL Optional
SRCSVR Source server Name, *LOCAL Optional
TGTTYPE Target type *USERCOPY, *REPLICA, *POINTINTIME, *BASEAGR, *CHANGEAGR, *CCD Optional
KEYCOL Key columns Single values: *SRCTBL, *RRN, *NONE
Other values (up to 120 repetitions): Character value
Optional
CRTTGTTBL Create target table *YES, *NO Optional
CHKFMT Check target table format *YES, *NO Optional
COLUMN Source columns Single values: *ALL, *NONE
Other values (up to 300 repetitions): Character value
Optional
UNIQUE Unique key *YES, *NO Optional
TGTCOL Target columns Single values: *COLUMN
Other values (up to 300 repetitions): Element list
Optional
Element 1: Column Character value
Element 2: New column Character value
CALCCOL Calculated columns Single values: *NONE
Other values (up to 100 repetitions): Element list
Optional
Element 1: Column Character value
Element 2: Expression Character value
ROWSLT Row selection expression Character value, *ALL Optional
TGTKEYCHG Target key change Character value, *NO, *YES Optional
ADDREG Add DPR registration *YES, *NO Optional
Top

Apply qualifier (APYQUAL)

Specifies the apply qualifier. The apply qualifier is the name which is used to group the subscriptions that are to be run by the same Apply instance. You can specify a maximum of 18 characters for the apply qualifier name. This name follows the same naming conventions as an RDB name. This name must already exist in the IBMSNAP_SUBS_SET table.

Top

Set name (SETNAME)

Specifies the Set Name which identifies a group of target tables (subscription set members) that are processed by the Apply program as a group. This must be unique under the Apply Qualifier. An error results if the set name does not already exist in the IBMSNAP_SUBS_SET table. The Apply program handles the target tables in a set as a group. When one target table fails for any reason, the entire set fails.

Top

Target table (TGTTBL)

Identifies the name of the target table. The target table is automatically created if a value of *YES is specified on the CRTTGTTBL parameter and the target table does not already exist.

library/target-table-name
The qualified name of the target table.
Top

Source table (SRCTBL)

Identifies the source table from which you want to copy. This is a required parameter.

The source table refers to a table that you registered on the system identified by the SRCSVR keyword, although it does not have to physically reside on that system.

library/source-table-name
The qualified name of the source table to be copied.
Top

Control server (CTLSVR)

The relational database name where the Apply control tables exist. This is the relational database name for the control server.

*LOCAL
The Apply control tables are located on the local relational database.
rdb-name
The relational database name where the Apply control tables reside. You can use the Work with RDB Directory Entries (WRKRDBDIRE) command on the data server to find this name. If the Apply control tables are on the system where the ADDDPRSUB command is being executed, rdb-name is the relational database name that has a remote location of *LOCAL associated with it.
Top

Source server (SRCSVR)

The relational database name where the source table is registered. The source table may or may not physically reside on that system. This is the relational database name for the source server.

*LOCAL
The source table registration is located on the local relational database.
rdb-name
The relational database name where the source table is registered. You can use the Work with RDB Directory Entries (WRKRDBDIRE) command on the data server to find this name. If the source server and the target server are the same, rdb-name is the relational database name that has a remote location of *LOCAL associated with it. Otherwise, rdb-name is the relational database name that has a remote location of *LOCAL associated with it on the source server.
Top

Target type (TGTTYPE)

Specifies the type of copy used to refresh the target table. These are DataPropagator terms that describe the contents of the target table. After a target table is created as one of these types, you can use this parameter value on the SRCTBL parameter of the Add DPR Registration (ADDDPRREG) command to register this target table as a source table.

*USERCOPY
The target table is a user copy. A user copy is a target table whose content matches all or part of a source table at a given time. A user copy is handled like a point-in-time copy, but it does not contain any of the DataPropagator overhead columns that are present in the point-in-time target table.

This value is not valid when a value of *RRN is specified on the KEYCOL parameter.

*POINTINTIME
The target table is a point-in-time copy. A point-in-time copy is a target table whose content matches all or part of a source table at a given point in time.

When the target table is a point-in-time copy, you should also specify the unique key fields on the KEYCOL parameter and specify a value of *YES on the UNIQUE parameter.

*REPLICA
The target table is a replica. The target table contains only the columns from the source table. Columns that start with the DataPropagator column identifiers, IBMSNAP or IBMQSQ, are not in the table.

This target table is used only for update anywhere. The target table receives changes from the source table and changes to the target table are propagated back to the source table.

This table is automatically registered as a source table. Also, extra rows are entered into the subscription control tables so that data from the target table can be propagated back to the source table.

*CCD
The target table is a consistent copy. A consistent copy is a target table that reflects a transaction-consistent state of the source table.
*BASEAGR
The target table is a base aggregate. A base aggregate is a target table that contains data aggregated from a source table or point-in-time table.
*CHANGEAGR
The target table is a change aggregate. A change aggregate is a target table that contains data aggregations based on changes recorded for a source table.
Top

Key columns (KEYCOL)

Defines the list of columns that describe the key of the target table. The column names must be unqualified. For point-in-time, replica, and user copy target tables (as specified on the TGTTYPE parameter), you must specify the unique key fields.

*SRCTBL
The key columns in the target table are the same as those in the source table. The ADDDPRSUBM command uses the key specified in the source table if the source table is keyed. The following key columns are used:
  • Key columns that are defined through DDS when the table is created with the Create Physical File (CRTPF) command
  • Primary and unique keys that are defined with CREATE TABLE and ALTER TABLE SQL statements
  • Unique keys that are defined with CREATE INDEX SQL statements

If a column is used as a key more than once with different ordering, the target table key is defined with an ascending order.

*RRN
The key column in the target table is the IBMQSQ_RRN column. The target table is created with an IBMQSQ_RRN column and this column is used as the key. When the Apply component runs, if the source table is a user table and the target table is a point-in-time or consistent copy, the IBMQSQ_RRN column in the target table will be updated with the relative record number of the associated record in the source table. Otherwise, the IBMQSQ_RRN column in the target table will be updated with the value of the IBMQSQ_RRN column in the source table.
*NONE
The target table does not contain a primary key. This value is not allowed if the target table is a point-in-time, replica, or user copy subscription.
column-name
A list of up to 120 column names.
Top

Create target table (CRTTGTTBL)

Specifies whether the target table is to be created.

*YES
Create the target table if it does not exist. If the table exists already, it is used as the target table and its format is checked if the value of the CHKFMT parameter is *YES. The target table can be a view. No indexes will be created if the target table is a view. An additional index will not be created if the target table exists and an index already exists that matches the values specified with the KEYCOL and UNIQUE parameters. If the target table exists and indexes are created, the command will fail if the target table contains records that violate these indexes.
*NO
Do not create the target table. The table does not need to exist. If it does not exist, you must create the table in the correct format before starting the Apply component.

If the table exists and CHKFMT(*YES) is specified, the ADDDPRSUB command ensures that the format of the existing table matches the subscription. If CHKFMT(*NO) is specified, you must ensure that the format of the existing table matches the subscription.

Top

Check target table format (CHKFMT)

Specifies whether checking should be done to ensure that the columns defined for this subscription match the columns in the target table. This parameter is ignored if the value of the CRTTGTTBL parameter is *YES or if the value of the CRTTGTTBL parameter is *NO and the target table does not exist.

*YES
Checking is done to ensure that the columns defined for this subscription match the columns in the target table. The command fails if a mismatch is detected.
*NO
Differences between the subscription and the existing target table are ignored. You must ensure that the target table is compatible with the subscription.
Top

Source columns (COLUMN)

Defines the list of columns to be included in the target table. The column names must be unqualified. Choose the column names from the list of column names that were specified on the CAPCOL parameter of the registered source table.

If *BOTH was specified on the IMAGE parameter of the registered source table, you can specify before column names. The before image column names are the same as the original column names, but they are prefixed with the character specified on the PREFIX parameter of the ADDDPRREG command that created the registration on the source table.

*ALL
All columns specified on the CAPCOL parameter of the Add DPR Registration (ADDDPRREG) command for the registered source table are included.
*NONE
No columns are included. This value is required when expressions on the CALCCOL parameter contain summary functions (for example, SUM or AVG). Base aggregate and change aggregate subscriptions frequently require this parameter to be *NONE for this reason.
column-name
A list of up to 300 column names.
Top

Unique key (UNIQUE)

Specifies whether the target table has unique keys as specified on the KEYCOL parameter.

*YES
The target table supports one net change per key; that is, no matter how many changes are made to the key, only one row exists in the target table for that key. Point-in-time, replica, user copy, and condensed consistent tables should have unique keys.
*NO
The target table supports multiple changes per key. The changes are appended to the target table. You should specify this value for consistent tables that are not condensed.
Top

Target columns (TGTCOL)

Defines new names for the columns to be updated in the target table. These names override the column names in the source table. The column names must be unqualified. You can use this parameter to give more meaningful names to the target table columns.

If you specified a value of *NONE for the COLUMN parameter, then you should not use this parameter.

*COLUMN
The target columns are the same as those specified on the COLUMN parameter.
column-name
A list of up to 300 column names.
new-name
A list of up to 300 new column names.
Top

Calculated columns (CALCCOL)

Defines the list of user-defined or calculated columns in the target table. The column names must be unqualified. An SQL expression can be specified. A column name is required for each expression. A value of *NONE must be specified on the COLUMN parameter if you want to use an SQL column function on this parameter.

*NONE
No calculated columns are specified.
column-name
A list of up to 100 column names.
expression
A list of up to 100 SQL column expressions.
Top

Row selection expression (ROWSLT)

Defines the predicates to be placed in an SQL WHERE clause to select the rows to be maintained in the target table.

Note: The WHERE clause on this parameter has no relation to any WHERE clauses specified on the SQLBEFORE and SQLAFTER parameters.

*ALL
All rows in the source table are selected.
WHERE-clause
An SQL WHERE clause. The WHERE keyword is implied on this parameter, so it should not be specified. You should make sure the WHERE clause is valid on the data server platform on which you are running this clause.

You must use the SQL naming convention instead of the system naming convention. SQL table references must be in the form LIBRARY.table instead of the system naming convention ( LIBRARY/table ).

Top

Target key change (TGTKEYCHG)

Specifies the target key change. This is a flag indicating how the Apply program handles updates when the columns for the primary key of a target table are changed in the source table.

*NO
Updates to the source table are handled as updates to the target table.
*YES
The Apply program updates the target table based on the before images of the primary key column. When the source table was registered, the USEDELINS parameter should have been set to *NO. Also, the source table needs to have been registered with IMAGE(*BOTH).
Top

Add DPR registration (ADDREG)

Specifies whether or not the target table is to be registered as a source table for DataPropagator. This parameter is ignored when the TGTTYPE is *REPLICA because the target table is automatically registered as a source table.

*NO
The target table is not registered.

If the TGTTYPE is *REPLICA, this value is ignored and the target is registered as a source table.

If the target table is already registered, no checking is done to ensure that the target table and the source table are not the same table.

*YES
The target table is registered as a source table. The command fails if the target table is already registered.

If the table does not exist and the value of the CRTTGTTBL parameter is *NO, the target table is not registered. In addition, the target table is not registered if the value of the TGTTYPE parameter is *USERCOPY.

If the target table exists, has a target type other than *USERCOPY, and is already registered, the command checks to ensure the source type of the registration is the same as the target type of the subscription.

Top

Examples

None
Top

Error messages

*ESCAPE Messages

ASN1038
No column names or expressions supplied.
ASN2051
Not authorized to Registration Extension table.
ASN2501
Not authorized to register table.
ASN303A
Row selection expression not valid.
ASN3036
Column not found.
ASN3037
Column already exists.
ASN3039
Column already exists.
ASN3041
Column functions are not allowed.
ASN3042
Columns cannot be renamed.
ASN3047
Internal error in module .
ASN3068
Key columns required for target type .
ASN3072
Relative record numbers are not being captured.
ASN3073
Record number column IBMQSQ_RRN is not available.
ASN3074
KEYCOL(IBMQSQ_RRN) not valid with target type .
ASN3078
The target file does not match the subscription.
ASN3079
The target file does not contain the correct columns.
ASN3115
Relational database is not DB2/400 V4R2 or greater.
ASN3210
UNIQUE must be *YES when TGTTYPE is *POINTINTIME.
ASN3218
A value of *RRN is not allowed on the KEYCOL parameter for this target type.
ASN3220
A value of *NONE on the KEYCOL parameter is not allowed with this target type.
ASN3231
UNIQUE must be *YES when TGTTYPE is *REPLICA.
ASN3232
UNIQUE must be *YES when TGTTYPE is *USERCOPY.
ASN3233
COLUMN must be *ALL when TGTTYPE is *REPLICA.
ASN3235
CALCCOL must be *NONE when TGTTYPE is *REPLICA.
ASN3241
Target table is registered as the wrong type.
ASN3253
Registration not found for table .
ASN3254
Registration already exists for table .
ASN3256
Not authorized to Subscription Set table.
ASN3257
Not authorized to Subscription Member table.
ASN3258
Not authorized to Subscription Columns table.
ASN3262
Source and target not valid.
ASN3263
Not authorized to Prune Control table.
ASN3266
Subscription does not exist for Apply Qualifier Set Name .
ASN3267
All members of set not from the same journal.
ASN3268
Subscription member created for Apply Qualifier Set Name
ASN3269
Member already exists.
ASN3277
Source table in contains the column.
ASN3278
TGTCCOL must be *COLUMN when TGTTYPE is *REPLICA.
ASN3283
Source table cannot be a view when TGTTYPE is *REPLICA.
ASN3290
Commit Count less than zero.
ASN3291
Registration Extension table not found.
ASN3292
Register table not found.
ASN3293
Pruning control table not found.
ASN4512
Set subscription table not found.
ASN4518
Subscription member table not found.
ASN4520
Subscription columns table not found.
Top