3976: Incorrect referential constraint definition

Database

3976: Incorrect referential constraint definition

ALTER TABLE XXX

 ADD CONSTRAINT R_374 FOREIGN KEY (QuarterPeriodNum) REFERENCES WITH NO CHECK OPTION YYY (QuarterPeriodNum)

[Teradata][ODBC Teradata Driver][Teradata Database] Incorrect referential constraint definition.

Execution Failed!

ALTER TABLE Failed. 3976:  Incorrect referential constraint definition.

Can some body help me why I am getting this error.

3 REPLIES

Re: 3976: Incorrect referential constraint definition

I am using TD 13.10 version, please help...

Re: 3976: Incorrect referential constraint definition

Please include the DDL of the parent and child tables you are attempting to build the reference for.

Re: 3976: Incorrect referential constraint definition

Hi,

Can you please share the parent table definition as well. As the error might be due to the definition of QuarterPeriodNum column. 

This column must be defined as UNIQUE and NOT NULL in order to be referenced.

Khurram