Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2015-04

How to force unique field values with TBufDataSet

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Gabor Boros

Hi All,

Added ixUnique type index with IndexDefs or AddIndex, set IndexName or IndexFieldNames. But no effect, I can add same field values without any error.

Gabor

Reply by email

Michael Van Canneyt
to Gabor Boros
Gabor Boros wrote 5 lines
Hi All, Added ixUnique type index with IndexDefs or AddIndex, set IndexName or IndexFieldNames. But no effect, I can add same field values without any error.

To the best of my knowledge, this is meant to import actual server index definitions, not to enforce in local data.

It would often be useless to do so: it may wel be that a value is unique locally (in memory), but is not unique when you save it in the DB, for instance when you load only part of the data in your dataset.

Michael.

Reply by email

stdreamer
to Michael Van Canneyt
Michael Van Canneyt wrote 23 lines
On Mon, 27 Apr 2015, Gabor Boros wrote: > Hi All, > > Added ixUnique type index with IndexDefs or AddIndex, set IndexName or > IndexFieldNames. But no effect, I can add same field values without > any error. To the best of my knowledge, this is meant to import actual server index definitions, not to enforce in local data. It would often be useless to do so: it may wel be that a value is unique locally (in memory), but is not unique when you save it in the DB, for instance when you load only part of the data in your dataset. Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

you are kidding right? Have you just removed all local/single user application as target audience for TBuffdataset or is it my lack of understanding?

Reply by email

Michael Van Canneyt
to stdreamer
stdreamer wrote 27 lines
On 27/04/2015 12:40 μμ, Michael Van Canneyt wrote: > > > On Mon, 27 Apr 2015, Gabor Boros wrote: > >> Hi All, >> >> Added ixUnique type index with IndexDefs or AddIndex, set IndexName or >> IndexFieldNames. But no effect, I can add same field values without >> any error. > > To the best of my knowledge, this is meant to import actual server index > definitions, not to enforce in local data. > > It would often be useless to do so: it may wel be that a value is unique > locally (in memory), but is not unique when you save it in the DB, for > instance when you load only part of the data in your dataset. > > Michael. > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > > you are kidding right? Have you just removed all local/single user application as target audience for TBuffdataset or is it my lack of understanding?

I am not kidding.

The indexes work in the sense that they sort correctly, but the ixUnique is AFAIK not enforced.
I am not sure that ixCaseInsensitive is observed.

I have checked this, and ixUnique at least is not even used in bufdataset.

All this does not mean we will not accept patches to implement this, but currently uniqueness certainly is not enforced.

Michael.

Reply by email

stdreamer
to Michael Van Canneyt
Michael Van Canneyt wrote 49 lines
On Mon, 27 Apr 2015, stdreamer wrote: > On 27/04/2015 12:40 μμ, Michael Van Canneyt wrote: >> >> >> On Mon, 27 Apr 2015, Gabor Boros wrote: >> >>> Hi All, >>> >>> Added ixUnique type index with IndexDefs or AddIndex, set IndexName or >>> IndexFieldNames. But no effect, I can add same field values without >>> any error. >> >> To the best of my knowledge, this is meant to import actual server index >> definitions, not to enforce in local data. >> >> It would often be useless to do so: it may wel be that a value is unique >> locally (in memory), but is not unique when you save it in the DB, for >> instance when you load only part of the data in your dataset. >> >> Michael. >> _______________________________________________ >> fpc-pascal maillist - >> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal >> >> > you are kidding right? Have you just removed all local/single user > application as target audience for TBuffdataset or is it my lack of > understanding? I am not kidding. The indexes work in the sense that they sort correctly, but the ixUnique is AFAIK not enforced. I am not sure that ixCaseInsensitive is observed. I have checked this, and ixUnique at least is not even used in bufdataset. All this does not mean we will not accept patches to implement this, but currently uniqueness certainly is not enforced. Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

much better thank you for the clarification.

Reply by email