Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

why should we use SET table ? - response (15) by AdamL

$
0
0

In reference to third comment posted by Fred, 
 

I created a similar table T2_S1 as original source table T1.

CREATE volatile SET TABLE T2_S1 (c1 INTEGER NOT NULL,c2 INTEGER) UNIQUE PRIMARY INDEX (c1) on commit preserve rows;

Now, i tried insert select into this SET table. But, it gave the error.

 

INSERT T2_S1 SELECT c1,c2 FROM T1;/* succeeds - quietly eliminates the duplicate and inserts 2 rows */

 

Here it is failing, *** Failure 2801 Duplicate unique prime key error in iTunes_User.T2_MS.

                Statement# 1, Info =0 

 *** Total elapsed time was 1 second.

 

It seems the insert select for set table case with duplicates being discarded, is not working fine.

 

Can u please suggest, the behavior here? Is it, when we select all the columns i.e an entire row from the source table, duplicate row check is done for the target table.

 

Regards,

Adam

 


Viewing all articles
Browse latest Browse all 27759

Trending Articles