Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Unique Key enforcement on a DATE Column for DAY (mm/dd/yy)

RE: Unique Key enforcement on a DATE Column for DAY (mm/dd/yy)

From: Mercadante, Thomas F (LABOR) <Thomas.Mercadante_at_labor.state.ny.us>
Date: Tue, 23 Oct 2007 11:22:38 -0400
Message-ID: <ABB9D76E187C5146AB5683F5A07336FF0173586B@EXCNYSM0A1AJ.nysemail.nyenet>


You could put a "before insert" trigger on the table and trunc the date column to strip the time value out of it. This would allow the unique constraint to prevent the insert from happening.


From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of BN Sent: Tuesday, October 23, 2007 10:45 AM To: oracle_L_list
Subject: Unique Key enforcement on a DATE Column for DAY (mm/dd/yy)

Greetings    

I have a requirement to enforce Uniqueuness on a DATE Column for a day only (mm/dd/yy(yy)  

Should allow users to enter data only once in a day, Can it be enforced through a Unique constraint  

Need to implement this in Oralce 8i, 9i, 10g

-- 
Regards & Thanks
BN 


--
http://www.freelists.org/webpage/oracle-l
Received on Tue Oct 23 2007 - 10:22:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US