All Forums Database
DTV 2 posts Joined 09/12
04 Dec 2012
Do not insert a record into a table with a foreign key.

 
We get error when we insert record into the table with foreign key on column  «KEY»:
 
create table t1
("KEY" integer not null primary key);
create table t1_1
("VERSION" integer not null primary key,
"KEY" integer not null,
constraint C_FK1 foreign key("KEY") references WITH CHECK OPTION t1("KEY")
);
insert into t1("KEY") values (1);
insert into t1_1("VERSION","KEY") values (1,1);
 
When we try to insert a record into the table t1_1  we got error:
Failed [3610: HY000] Internal error: Please do not resubmit the last request. SubCode, CrashCode: 0, 3701
 
What is wrong with such foreign keys? It works for Oracle and MSSQL without errors.
If we rename both columns to “KEY_” or remove “WITH CHECK OPTION” the error disappears.
We need foreign keys on such columns for compatibility and we need  “WITH CHECK OPTION” to ensure referential integrity.
How can we fix error on Teradata?

CarlosAL 512 posts Joined 04/08
05 Dec 2012

>>"How can we fix error on Teradata?"
 
Not using reserved words as column names?
 
Cheers.
Carlos.
 

ToddAWalter 316 posts Joined 10/11
05 Dec 2012

Any time you get a 3610 error, it should be reported as a Teradata incident. It represents a fault in the database engine that should be identified and repaired.

DTV 2 posts Joined 09/12
11 Dec 2012

Can we use quoted keywords as field names for foreign keys? Is it allowed by SQL specification supported by Teradata RBDMS?

You must sign in to leave a comment.