IBM Support

Attempting to create a foreign key results in SQLCODE -204 error

Troubleshooting


Problem

Attempting to create a foreign key with the Content Manager System Administration client fails with ICM7015, SQL RC -204 when deferred DDL is being used--i.e., when the ICMSQL DD is specified in the library server WLM PROC.

Symptom

The following error occurs at the Content Manager System Administration client:

"DGL3704A: Error found in component type attribute; ICM7015: During an SQL operation in the library server, an unexpected error occurred. For details on the error, refer to the database document. (STATE) : [LS RC = 7015, SQL RC = -204]"

Cause

The underlying component tables for the item type which the foreign key is referencing have not yet been created. As per the HOLDDATA for 8.3 fix pack 8 library server roll-up PTF UK35056, the table creation jobs for the target item type tables must have been run successfully prior to attempting to define a foreign key which references that item type. This restriction was introduced as part of the fix for APAR IO07451 in fix pack 8.

Diagnosing The Problem

An error similar to the following appears in the library server trace:


     ICMPLSCP handleForeignKeys                07094 04/22 22:26:11.013 GMT ;22222305794413 58:120cfecd157:X7fc5 A519819 Input
        varstmt3  <ALTER TABLE LSSCH.ICMUT01509001 ADD CONSTRAINT UC015090119931260 UNIQUE (ATTR0000001199 )>
        sqlcode   -204
     ICMPLSCP ALTER TABLE ADD UNIQUE CONSTRAINT 07108 04/22 22:26:11.054 GMT ;22222305794413 58:120cfecd157:X7fc5 A519819 SQL Error
        sqlca.sqlcode-204
         < DSNT408I SQLCODE = -204, ERROR:  LSSCH.ICMUT01509001 IS AN UNDEFINED NAME

Resolving The Problem

Prior to creating a foreign key on an item type which references an attribute in a target item type, be sure to have already run the table creation jobs that were generated when creating that target item type.

[{"Product":{"code":"SSLQWS","label":"Content Manager for z\/OS"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Library Server","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"8.5.0.1;8.5;8.4.3.4;8.4.3.3;8.4.3.2;8.4.3.1;8.4.3;8.4.2.3;8.4.2.2;8.4.2.1;8.4.2;8.4.1.1;8.4.1;8.4.0.1;8.4","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
14 October 2019

UID

swg21384505