Update affected more than 1 record

Source: Internet
Author: User

Use clientdataset to operate the Master/Slave table.

In the operation, del Main table (write the stored procedure in SQL and delete the sub-table with the ID field), the error update affected more than 1 record is reported, and the deletion cannot be submitted. An error is reported when a transaction is used!

After searching online for half a day, I found that none of them has a better Chinese answer.

However, I still found the English version. Haha ~!

The relationship between the master table and the sub-table and the corresponding relationship is created. If no error is reported, the deletion can also be submitted. Haha ~!

Attached English:

"Update affected more than 1 record" error

(In Delphi 2007)
Am using a clientdataset to manage editing of a simple record:

Employeeid (primary key)
Firstname (required)
Lastname (required)
Hiredate (required)
Exitdate (not required)
Nickname (not required)
Photo (image, not required)

Have one case where there are two records with the same employee
First/lastname but different keys and other values. Changing the value
Any field (e.g. Nickname) in one of these records and calling applyupdates
Generates "Update affected more than 1 record". I seem to get this error no
Matter what the provider flags are set to for the provider and client
Dataset (employeeid has pfinkey set). I don't understand because
Employeeid field shoshould uniquely identify which record to change.

How we set the provider flags for the dataset provider and for the fields
Doesn't seem to make any difference. Also, we 've been following the same
Format for all sorts of database tables previously and have not seen this
Error before now. Can anyone give me a direction to go in? No luck googling
This error and codegear's help is woeful.

Required thanks for your maintenance ance.

Jeff

 

Solved the problem:

Had a database trigger on the table that was not key specific. Updates
The dataset where firing this trigger which caused the error.

"Bill Todd" <no@no.com> wrote in message
News: 46fd9189$ 1@newsgroups.borland.com...
> Jeff W. wrote:
>
> Provider and client dataset (employeeid has pfinkey set). I don't
> Understand because the employeeid field shoshould uniquely identify
> Which record to change.
>
> You must set the providerflags on the source dataset (the one in
> DSP's dataset property) Not the CDs.
>
> --
> Bill Todd (teamb)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.