How Can We Help?

(530) Define extended fields in the target database

QMirror/DB uses system table QMIRROR.ZEXFLD to add extended fields in the replicated tables. Insert records into QMIRROR.ZEXFLD to define extended fields, and QMirror/DB will maintain these fields for you. Please refer to (A30) Extended fields master (ZEXFLD) for table structure and field comments.

After maintaining QMIRROR.ZEXFLD, you need to re-download the files which you updated. Please refer to (430) Re-download specified AS400 table manually.

1. System maintained extended field

System maintained extended fields are calculated fields in the replicated tables. You can define the formula into field EXFUNC. The formula could be a simple function, stored function, or a complex stored procedure. QMirror/DB will update the contents in the extended fields according to EXFUNC when records are inserted or changed.

E.g. INSERT INTO QMIRROR.ZEXFLD
(EXLIB, EXFILE, EXFLDE, EXFLDT, EXFUNC, EXFTXT)
VALUES (‘LIBR1’, ‘FILEA’, ‘AMTEXT’, ‘CHAR(200)’,
‘MYFUNC(BILLAMT)’, ‘Convert amount to text’)

(Notes: MYFUNC is a stored function defined by user)

2. User-maintained extended field

A table with user-maintained extended fields must have unique keys described inthe field QMIRROR.ZAMTBF.TBUNIQ. QMirror/DB extracts unique keys fromAS400 physical file or logical files and inserts them into TBUNIQ. If there is nounique key, manually enter the unique keys in TBUNIQ. Be aware that if thephysical file has been moved to another library, all data in user-maintainedextended fields in your tables will be lost.

E.g. INSERT INTO QMIRROR.ZEXFLD
(EXLIB, EXFILE, EXFLDE, EXFLDT, EXFTXT)
VALUES (‘LIBR1’, ‘FILEA’, ‘PASSWD’, ‘CHAR(20)’,
‘Password for Web users’)

Previous (525) Dynamic table selection
Next (535) Data encryption in the target database

Table of Contents
Scroll to Top