855
Views
16
Comments
Update in database getting error
Question
Application Type
Reactive

Hi,

When I update one of attribute then at that time I have getting this error like-

1 record couldn't be updated.

22 - There is already an open DataReader associated with this Command which must be closed first.

For more information, check the Service Center error logs.


error1.PNG
2026-02-05 15-36-36
Lenon Manhães Villeth
Champion

Hi friend.

It's possible to be something related to the table indexes?

Can you send the error track from SC?


Kind regards

2021-05-21 09-12-32
Purva Kumbhar

Hi,

No I am not using Indexes .

Please find screenshot

error3.PNG
2026-02-05 15-36-36
Lenon Manhães Villeth
Champion


I had this exact same error yesterday. I was trying to change a FK to 0 as well. Although zero is the null stardand value, even when the FK is not mandatory, the platform will validate and block the 0 value. So, basically you won't be able to change to zero inside this aggregate trick.

2021-05-21 09-12-32
Purva Kumbhar

Yes, Same thing happened. I am trying to change the value of FK . 

2026-02-05 15-36-36
Lenon Manhães Villeth
Champion


You'll need to change to a valid FK or use another way to update it... a timer with an SQL query running when published should do the work.

2021-05-21 09-12-32
Purva Kumbhar

Can you please share me example how can use it

2026-02-05 15-36-36
Lenon Manhães Villeth
Champion

Just set a timer to run when publish. Set a SQL UPDATE like this one bellow.

Be carreful with the conditions or the entire table will be updated.

If the FK is not mandatory it should work fine.

2021-05-21 09-12-32
Purva Kumbhar

Ok. I will try this, if I am getting any issues, then I will let you know.

2026-02-05 15-36-36
Lenon Manhães Villeth
Champion


Hey there.

If this solution solved you issue, I would be glad if you mark as solution :)

2026-02-05 15-36-36
Lenon Manhães Villeth
Champion
2021-09-21 09-26-31
Aadhavan Shanmugam

Hi Purva,

There will be 2 scenario.

  1. You are trying to apply current row with existing identifier value
  2. Trying to apply existing identifier value for foreign key.

Refer below screenshots for better understanding.



Thanks, Aadhavan S

2021-05-21 09-12-32
Purva Kumbhar

Hi,

In  entity there is one FK value . and I want to set the value for FK .When I set value this error appeared. 

2019-11-11 17-10-24
Manish Jawla
 
MVP

Hi Purva,

The FK value which you are setting is already exist in the database? because you should see the option of drop down like example below, if you already have data for it.

I have tried to set the FK key in my entity for which I don't have value in it then I got the same error.

can you make sure you have data with same Id in your FK entity and you trying to set the same Id?

Regards,

Manish Jawla

2021-05-21 09-12-32
Purva Kumbhar

Yes, Same Id I try to use there which is show in dropdown 

2025-01-02 13-34-30
Abduerhman Salama

this error appear with this record not with other records
when i try to change any values

error report:

1 record couldn't be updated.


90 - No records affected.


For more information, check the Service Center error logs.


Capture.PNG
2025-04-17 05-42-16
Ajit Kurane

Hi Purva,

I hope you are doing well!!

you can take reference of below link,

https://www.outsystems.com/forums/discussion/43680/outsystems-dbo-osusr-xxxx-with-key-0-was-not-updated/

https://www.outsystems.com/forums/discussion/58739/outsystems-dbo-osusr-with-key-0-was-not-updated/

Same error discussion has been happened in above links.

Kind Regards,

Ajit Kurane.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.