Reference Index -- How It Work

Database

Reference Index -- How It Work

Hello all,

I have two tables (employee and department). I wanty create standard referential integrity between them. I am trying to use code like below to accomplish that

create table employee
,no fallback
,no before journal
,no after journal
,checksum = default
,default mergeblockratio
(
empno integer not null,
name varchar(30) character set unicode not casespecific,
deptno smallint
)
unique primary index(empno);

create table department
,no fallback
,no before journal
,no after journal
,checksum = default
,default mergeblockratio
(
deptno smallint not null,
name varchar(30) character set unicode not casespecific
)
unique primary index(deptno);

alter table employee add constraint foreign key (deptno) references department(deptno);

After constraint had been created table employee_0 equal as table employee was created by Teradata Database.

I can drop table employee_0 and constraint will work.

If table employee_0 exists I can't create constraint.

What is this table for? What is reference index, how does it work?

2 REPLIES

Re: Reference Index -- How It Work

My Database version is 13.10. Thanks.

Junior Supporter

Re: Reference Index -- How It Work

It's the system generated error table. It will collect the rows that break the referential integrity.

You should take a look at SQL Data Definition Language - Detailed Topics. "ALTER TABLE" pag 55.

HTH.

Cheers.

Carlos.