I am new to Teradata and debugging a issue related to insert. I have two tables in teradata. Find below the definitions
CREATE SET TABLE TablePrimary ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT,
PRIMARY INDEX I_H_U_K ( NEXT_HI );
I have second table say TableSecondary which has a column referring to Next_hi in TablePrimary for the primary key. I would like to know If I insert a record in the TableSecondary, Do i need to insert the key value in TablePrimary?
If you want to define a refrential integrity constrain - there are 2-3 ways.
if its hard RI--> which as you said will have to insert record in the primary table before inserting in to foreign key (secondary table)
Soft RI--> just create the relation ship . But it doesnt need to have primary table to be inserted first.