Ignoring duplicated rows and keep inserting.

Database
Enthusiast

Ignoring duplicated rows and keep inserting.

Hi guys!

I wanna know if what I wish is possible:

I'm inserting in Teradata these rows at the same time:
INSERT INTO TABLE1(FILED1, FILED2) VALUES('Field1' ,0);
INSERT INTO TABLE1(FILED1, FILED2) VALUES('Field2' ,1);
INSERT INTO TABLE1(FILED1, FILED2) VALUES('Field1' ,0);
INSERT INTO TABLE1(FILED1, FILED2) VALUES('Field4' ,3);


Is there anything I can do that allows me to ignore the duplicated row and keep inserting without pops an error?

Thanks for help,
Anderson
6 REPLIES
Junior Contributor

Re: Ignoring duplicated rows and keep inserting.

Hi Anderson,
which tool do you use?

Does it stop after the dup row and doesn't finish? Most tools allow a setting to ignore errors.

Or you just don't want that error message? AFAIK there's no way to avoid it.

Dieter
Enthusiast

Re: Ignoring duplicated rows and keep inserting.

Hi Dieter.

I'm performing this insert batch in Teradata SQL Assintant.
To invoke this, i've programmed a routine in C#(.NET).

When the dup row happens, it stops and throwns an error and doesn't continue.

I wanted something to ,even catching dup rows, continue inserting the next rows and don't allow dup rows.

Thanks,
Anderson
Junior Contributor

Re: Ignoring duplicated rows and keep inserting.

Hi Anderson,
in SQL Assistant just uncheck
tools -> options -> query -> Stop query execution if an SQL error occurs

Dieter

Re: Ignoring duplicated rows and keep inserting.

Hello Anderson,

Can you confirm the post from 04-Aug-2009 helped you with your problem?

Thanks.

New Member

Re: Ignoring duplicated rows and keep inserting.

No it didn't work. I tried it. having the same issue. I could use help too . 

Teradata Employee

Re: Ignoring duplicated rows and keep inserting.

This should change the session mode in SQL Assistant from ANSI to Teradata, but that may not work since the ODBC Driver may have been updated while SQL Assistant was not.  (You need to be in Teradata mode to ignore duplicate rows.)  Try Teradata Studio.  The means of changing mode varies with the tool.  I have not tried it myself, but apparently in Studio the method is: "To change the TMODE property, press the Add button and select the property TMODE. Choose the propert..."