Duplicate Key Error on Form

hch

Member
I have a custom table (with primary key composed of 6 columns), view with all columns, and a form over it. When I try to modify one of the non-key fields via the form, I get a duplicate key error. I have tried this with a header detail form and headerless detail form and the error is consistent. I can add a row, but cannot modify. I have looked at the logs, found the keys it is trying to insert, and put them into a SQL statement. Only 1 row is returned. Any ideas?

Thanks!

E91, SQL DB, Windows
 

Lucky.2811

Active Member
Have you generated the file; To me it looks like it still has some old index rather than the primary key composed of six columns. Regenerate the file and try again.
 

CHo

VIP Member
I have a custom table (with primary key composed of 6 columns), view with all columns, and a form over it. When I try to modify one of the non-key fields via the form, I get a duplicate key error. I have tried this with a header detail form and headerless detail form and the error is consistent. I can add a row, but cannot modify. I have looked at the logs, found the keys it is trying to insert, and put them into a SQL statement. Only 1 row is returned. Any ideas?

Thanks!

E91, SQL DB, Windows
Hi.
What this issue ever resolved?
I have the same issue.

In the debug log, the UPDATE SQL statement is missing a key field in the WHERE clause. Thus triggering the duplicate key error. The missing key field is part of the primary key. I've regenerated the table to no avail.

I think the date field (missing key field) was added to the index after the table was created. Someone else created the table and the app.

Does anyone have any ideas?
 

Rauf

VIP Member
This is on fat client or thin client.
If this is on fat client, try with another fat client ( might be spec issues)
 

CHo

VIP Member
Hi.
I don't know. I was parachuted into the project last month. The objects were created by someone who is no longer with the company.

The Add screen uses the same business view as the Update screen and the Add screen is okay.
I am talking to the AS/400 admin about deleting SQL packages.
I will add creating new business view to list of possible solutions.
 
Top