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
4 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.