Index the user Id field and when someone enters a user ID go read the
index to see if it's been used.  Would that work? 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Wendy Smoak
Sent: Friday, October 08, 2004 12:31 PM
To: [EMAIL PROTECTED]
Subject: [U2] Enforcing uniqueness of two fields per record?

I have a situation where I _need_ two unique keys on each record.
Each record has a numeric ID that matches our PERSON file, and they
also need to have a userID so they can log in on a web page.

It will be fairly catastrophic if I ever let two people have the same
userID.  It could mean showing someone's confidential financial
information to another person. :/

Can UniData help at all here?  The file is currently keyed by
PersonID, and before I write a record I check the index to see if that
userID is already there on another record.

A composite key doesn't help, this is really a candidate key, and I
need to enforce uniqueness on two fields. 

Two things I'm investigating are: a trigger to move the
checking-of-the-index as close as possible to the record write & index
update, having a second file keyed by UserID that will keep me from
having two PersonIDs with the same UserID.

Any advice?  At this point I'm wishing I could right-click on the
field name and check a box to enforce uniqueness!

--
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to