V4RB ... finding duplicate values

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Apr 16 21:06:10 CDT 2003


on 4/16/03 4:03 PM, Pedro fp at lists at pedro.net.au wrote:

> G'day Folks
> 
> I have a table that has one field that must be unique & has the flags
> set as kv_Unique + kv_Indexed but without some handling has a real
> possibility of there being duplicate values. Thankfully there is also a
> rule for breaking the duplication.
> 
> I've considered doing an SQLselect like this ...
> SELECT RecID FROM myTable WHERE myUniqueField = myNewValue
> & checking the recordCount which should always be 0 or 1 but it occurs
> to me that even though I haven't found it there might be a better way
> to do this check. Is there?
> 
> If not is it valid to submit a query like ...
> SELECT FROM myTable WHERE myUniqueField = myNewValue
> since I don't actually need any fields for this check?

This is not valid.
Actually SELECT RecID .. Is the best way, because RecID is virtual.

So you want check if such value exists BEFORE INSERT it ?

Why not simply try to insert new record, and catch error from Valentina ?
This is more effective way.

> Whatever check I use must be applied to every record as the data is
> being imported & if it turns out the value already exists the check
> must be repeated for the modified value until a unique value is
> achieved.

-- 
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://listserv.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list