Re: Database table with unique no duplications

2007-03-03 Thread Anoop kumar V
Maybe I have understood the requirement incorrectly. here is what I think the author wants: He has a table with 3 fields: table1 col1, col2, col3 Now when a row is inserted he wants to ensure that 2 fields are unique: (col1 & col2) OR (col2 & col3) OR (col1 & col3). So - to understand the requi

Re: Database table with unique no duplications

2007-03-03 Thread js
Why do you recommend using trigger instead of unique index? I think when unique index works I don't have any reason to use trigger. If the field you want to be unique is big one, like char(1000) or TEXT, You have to use trigger to save the uniqueness, though. On 3/2/07, Anoop kumar V <[EMAIL PRO

Re: Database table with unique no duplications

2007-03-01 Thread Alexander Lind
declare the two fields you want unique as such? unique index. alec Kory Wheatley wrote: I have a database called accountcreation, and I want to setup a table called accountinfo. This table will require that two out of the three fields need to be "UNIQUE", I don't want duplications in these

Re: Database table with unique no duplications

2007-03-01 Thread Anoop kumar V
I would suggest you put an after insert trigger which does the validation for you. If 2 fields are already null then it will just return an error and rollback else it will allow the insert to be committed. regards, Anoop On 3/1/07, Kory Wheatley <[EMAIL PROTECTED]> wrote: I have a database cal