duplicate error in bmddd_table_fact

Database
Enthusiast

duplicate error in bmddd_table_fact

Hi All

While I am using update command i am getting this error. Please can you help on this??

Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 1227 StartFragment: 314 EndFragment: 1195 StartSelection: 314 EndSelection: 314SyntaxEditor Code Snippet

UPDATE bmddd_table_fact 
SET PROFITFORSALE = NULL where YEARID=201709

 

14 REPLIES
Senior Apprentice

Re: duplicate error in bmddd_table_fact

Hi,

This doesn't look like a Teradata dbms error. This looks more like an application error. Have you tried the forum (if one exists) for that application?

What application are you using to execute the update command?

Cheers,

Dave

Ward Analytics Ltd - information in motion
www: http://www.ward-analytics.com
Enthusiast

Re: duplicate error in bmddd_table_fact

I am running that command in SQL Assistant .

Senior Apprentice

Re: duplicate error in bmddd_table_fact

And in SQL Assistant you're getting the folowing error message: "Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 1227 StartFragment: 314 EndFragment: 1195 StartSelection: 314 EndSelection: 314" ?

 

Ward Analytics Ltd - information in motion
www: http://www.ward-analytics.com
Enthusiast

Re: duplicate error in bmddd_table_fact

NO I AM NOT GETTING

Junior Contributor

Re: duplicate error in bmddd_table_fact

Stop shouting.

So what's the actual error code/message you get?

Enthusiast

Re: duplicate error in bmddd_table_fact

here goes error :

duplicate row error in bmddd_table_fact

Enthusiast

Re: duplicate error in bmddd_table_fact

there is anyway to update using row number???

Junior Contributor

Re: duplicate error in bmddd_table_fact

No, you can't update using a ROW_NUMBER, why would you do that, just to avoid the Duplcate Row error?

 

You should investigate why you get duplicate rows, there should be a logical Primary Key in your table and a column named PROFITFORSALE can't be a part of it. So you got bad data and should fix it (and check your load process to avoid it in future).

 

Additionally:

- a fact table is usually big and thus created as MULTISET (you currently get the error because it's SET, doing Duplicate Row check), of course only if the load process isn't faulty

- for me 201709 is not a YEARID, but YEARMONTH or MONTHID

- why do you update all rows for this month to NULL? When it will be set to a value in following step there's no need to update twice.

Enthusiast

Re: duplicate error in bmddd_table_fact

-its fact column .we have duplicates and data is like that.

-and 201709 is month id as u said .its typo from my side.

-i am inserting data into  that column , i  mean updating that column with other column values .before that operation i need to make all values null.

so thinking to update by row number ()