I have recently just done a similar thing for a games site... The email
address and the display name of the user was to be unique... The way I
did it was via a stored procedure... So on registration I call a stored
procedure and pass all the details through, then the proc works out if
it can be added... If so then it inserts the record, if not then it does
not... But in both cases it returns a row which contains whether the
insert was successful or not so I could return an error to the flash
file to tell the user to pick another name...

HTH



-----Original Message-----
From: Kola Oyedeji [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 29, 2002 19:29
To: CF-Talk
Subject: OT: When to use database constraints


Hi

I would like to know if constraints other than keys are usually used? I
have a database where the email address must be unique and was wondering
if a constraint should be used. I could check for the existence of an
email address prior to inserting a new record but this involves another
query. Alternatively i could attempt to insert a duplicate email address
and catch any database error generated as a result. I'm just wondering
which method is best. Also the database will only be used with this CF
application.

thanks

Kola


______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to