Feedback
 
Did this article resolve your question/issue?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025

 


Article

SQL command to add a FOREIGN KEY constraint to an existing table fails with the error (7545)

« Go Back

Information

 
Article Number000063753
EnvironmentProduct: OpenEdge
Version: All supported versions
OS: All supported platforms
Question/Problem Description
SQL command to add a FOREIGN KEY constraint to an existing table fails with the error (7545)
Steps to Reproduce
Clarifying Information
SQL command used:

alter table pub.tableName
add constraint FK_tableName foreign key (column1, column2, column3) references pub.AnotherTableName (column1, column2, column3);
Error MessageError: [DataDirect][OpenEdge JDBC Driver][OpenEdge] No matching key defined for the referenced table (7545)
SQLState: HY000
ErrorCode: -20103
Defect/Enhancement Number
Cause
Columns defining a primary or foreign key must not accept the NULL value.
Resolution
Make sure that the table columns chosen as primary or foreign key do not accept NULL values by making them mandatory.
In a .df file a line mentioning:
 MANDATORY
should be visible for those columns.
Workaround
Notes
Attachment 
Last Modified Date10/2/2015 2:56 PM