Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help with SQL constraint
dean wrote:
> On Feb 15, 11:41 am, DA Morgan <damor..._at_psoug.org> wrote:
>> Arto Viitanen wrote: >>> dean wrote: >>>> Hello all, >>>> A table T has 2 fields, one (L) holding letters 'Y' and 'N', and one >>>> (X) holding numbers. Is there a (non trigger) constraint such that for >>>> L='N' (and only this letter) the numbers must be unique? Records >>>> where L='Y' do not have to be unique. >>>> (I need to join another table to the L='N' group of records, and the >>>> join must be key-preserved). >>>> Cheers, >>>> Dean >>> Why not divide the table to two tables, one containing to constraint >>> (with UNIQUE) and the other not. Then make a view using UNION for the >>> original table. >> Report writers will love you. >> >> The OP still hasn't answered the question: "What's wrong with triggers." >> >> Why break an application to solve a problem we still don't understand? >> -- >> Daniel A. Morgan >> University of Washington >> damor..._at_x.washington.edu >> (replace x with u to respond) >> Puget Sound Oracle Users Groupwww.psoug.org- Hide quoted text - >> >> - Show quoted text -
I have reread this entire thread and not once before did you, in my opinion, state what you just said.
So, essentially, you want to NOT have unique data but convince Oracle, by some hocus-pocus magic trick, that the data is unique.
As I presume you intend to put this into production there is no more help available from me. YOYO. There is one and only one solution ... correctly model your business requirement.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Thu Feb 15 2007 - 18:48:07 CST