Unique Constraint Failed, Why?
Rob Mostyn
mostyn at platformis.net
Sat Sep 18 18:19:09 UTC 2021
Try and find the culprit Das.
select primarykeycolumn, count(*)
from table
group by primarykeycolumn
having count(*) > 1
Rob
As Carl Sagan once said:
One of the great commandments of science is, "Mistrust arguments from authority." ... Too many such arguments have proved too painfully wrong. Authorities must prove their contentions like everybody else.
> On 18 Sep 2021, at 19:53, Das Goravani <goravanis at gmail.com> wrote:
>
>
> Hello $all,
>
> I am doing what I think is really routine stuff.
>
> But I can’t save data for one table, it gives the error “Unique constraint failed”
>
> The column it fails on is the Primary Key, which is column type “Sequence”.
>
> On all my many $schemas I have a field like CustRSN type Sequence and it’s marked as Primary Key
>
> I find on these unique columns all the time and they are the primary key that Updates work by.. always works, no problem.
>
> But today on this one table it’s not working.
>
> It’s giving that error. It won’t Update data.
>
> I have reindexed the data twice, and no joy.
>
> What can be doing this? It is 10.2 30204 and SQLite
>
> There is nothing special going on with this one today.. this should work but it won’t.
>
> Any ideas?
>
> I’m up to the point where I’m considering doing an export and import to build a new database table out of the 1000 records in it.
>
> Das
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
More information about the omnisdev-en
mailing list