Using the COPYDB-Format Files

If you opted to create COPYDB-format files while running the installation aid program, you may have to edit them into a format suitable for posting to their DP4 Databases. This is because some ODBC data sources do not have key fields and, worse still, some ODBC drivers, for example Oracle's, are incapable of providing the installation aid program with keyfield information. In either case, you must edit the COPYDB-format file with a text editor and add this information yourself.

The most efficient way of finding out whether a COPYDB-format file requires editing is to post it to its DP4 database - see later in this section.

Adding Key Field Information

Suppose, for instance, an Oracle BONUS table had a two-part primary key comprising ENAME+JOB, the relevant lines of the COPYDB-format file might omit this key information as follows:

#reldata name="BONUS" flags=0 read=0 write=0 last_change=0
________________
Bonus
________________
#field_descr name="ENAME" type=C length=10 occurs=1 read=0 write=0
format=0 iotype=C,
def=""
#relfield name="ENAME" key=0 sequence=5
________________
Ename
________________
#field_descr name="JOB" type=C length=9 occurs=1 read=0 write=0 format=0
iotype=C,
def=""
#relfield name="JOB" key=0 sequence=10

To rectify this omission, you would edit the key precedence to key=1 for ENAME and key=2 for JOB.

Changing Fieldnames

At times, you may wish to change the field names, either by editing the COPYDB-format file or by using the DP4 utility MAKEDB after you have built the database. If you do this, you must alter any corresponding name translation entries in the .INI file (see Using the .INI Files ).

Posting the COPYDB-Format File

Once you have made the desired changes to the COPYDB-format files, use the DP4 utility MAKEDB to create empty DP4 databases for them. It's important that the names of the DP4 databases match the names you specified when running the installation aid program. If you cannot recall the names, you can view the information that describes the correspondence of a DP4 Database name with an ODBC data source name in the [sql] section of the appropriate .INI file (see Configuring the ODBC Connection in Using the .INI Files ).