Unique Constraint Failed, Why?

Das Goravani goravanis at gmail.com
Sat Sep 18 19:41:56 UTC 2021


I don’t understand this, and I’m frustrated.

I exported the data, without the RSN or primary key, using ODT because there’s a list as one column

I imported the data, and had it assign new primary keys, which it does automatically

I examined the data and indeed the primary keys start at 1 and continue up from there perfectly

I try to Select the first record, that works, and then enter a repeat loop where I simply sort the list, and then update

And on the 2nd record and beyond it fails the update saying Unique constraint failed on the primary key

I JUST exported and imported fresh data into a fresh table making new primary keys

It should be pristine now.. it should not fail

I still ask the questions I asked in my last email, about Rob’s instructions to find the culprit.. need clarifications

Thanks

Das Goravani



> On Sep 18, 2021, at 2:19 PM, Rob Mostyn <mostyn at platformis.net> wrote:
> 
> 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 
> 
> _____________________________________________________________
> 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