Inserting a Record

Database

Inserting a Record

All

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,

     DEFAULT MERGEBLOCKRATIO

     (

      NEXT_HI DECIMAL(19,0))

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?

Tags (2)
1 REPLY
Teradata Employee

Re: Inserting a Record

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.