[V4RB] Best way to implement Uniqueness Across 2 Fields
Ruslan Zasukhin
sunshine at public.kherson.ua
Wed Jun 9 18:11:16 CDT 2004
On 6/9/04 5:44 PM, "Bob Keeney" <bkeeney at everestkc.net> wrote:
> I have a table that has 2 fields, a string and a ptr to another table.
>
> sWord, vstring
> ptrCase, vPtrObject
>
> What is the best way to implement a unique record based on sWord and
> ptrCase? For example, the values (Dog, 1) and (Dog, 2) are valid but I
> don't want the user to add another (Dog, 1). Am I going to have to do
> this via code? Will I have to do a SQL check before attempting to add
> the value?
>
> I need this to be as fast as possible because this table could be
> 500,000+ rows. Any help is appreciated.
1) you can do this via SQL
2) and you can create BaseObject method with fUnique + fIndexed flags
I think it can be of STRING type and have formula
ptr + sWord
So you get "1dog"
There is chnace that second way will be faster, because you just try ADD new
record, Valentina internally do checks, in case of failure you get refuse
and error code.
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list