Subject Re: [ib-support] Unique key that accepts null
Author Helen Borrie
At 06:09 PM 10-08-01 +0800, you wrote:
>Thanks Helen,
>
>Would the trigger slows down performance noticeably? Since we are using
>Exists here to test the whole table records' values.

No, exists() is not very expensive, especially if you place an index on the column that it check.


>My purpose here is to allow users to key in barcode numbers for items that
>they keep, but some items are without barcode numbers, so I have to allow
>null.

Yes; and sometimes barcodes get duplicated (by the manufacturers, in error) so a UNIQUE constraint can cause problems even where all items have a barcode. Generally I would want to log such cases and flag the row for a warning.

Helen

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________