home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.oracle      Overblown overpriced overengineered SHIT      2,288 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,865 of 2,288   
   Agoston Bejo to .com   
   Re: Unique constraint and NULL values   
   21 Oct 04 17:03:58   
   
   XPost: comp.databases.oracle.misc, comp.databases.oracle.server   
   From: gusz1@freemail.hu   
      
   See the answer below.   
      
   "Mark C. Stock"  wrote in message   
   news:zsqdnU_QrsleJurcRVn-vA@comcast.com...   
   > "Agoston Bejo"  wrote in message   
   > news:cl8ba7$d04$1@news.caesar.elte.hu...   
   > | I want to enforce such a constraint on a column that would ensure that   
   the   
   > | values be all unique, but this wouldn't apply to NULL values. (I.e.   
   there   
   > | may be more than one NULL value in the column.)   
   > | How can I achieve this?   
   > | I suppose I would get the most-hated "table/view is changing,   
   > | trigger/function may not see it" error if I tried to write a trigger   
   that   
   > | checks the uniqueness of non-null values upon insert/update.   
   > |   
   > |   
   >   
   > did you try a standard UNIQUE constraint on the column?   
      
      
   Yes, I did, and (1, null) and (1, null) couldn't be inserted twice. The   
   Oracle version I'm currently using (or to be more exact forced to use) is   
   8.1.7.  Maybe in later versions this was corrected, I don't know. Here, when   
   I tried it, it worked the way I described in my original post.   
      
   >   
   > unlike SQL-Server (unless they've changed it since I last worked on it),   
   > Oracle processes null values properly in this scenario (i.e., one NULL   
   value   
   > is never consider equal to another NULL value)   
   >   
   > ++ mcs   
   >   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca