Comments on: Business Rule: Only One per Day, but keep the time https://technology.amis.nl/2011/08/24/business-rule-only-one-per-day-but-keep-the-time/ Friends of Oracle and Java Sat, 25 Apr 2015 11:36:47 +0000 hourly 1 http://wordpress.org/?v=4.2 By: Alex https://technology.amis.nl/2011/08/24/business-rule-only-one-per-day-but-keep-the-time/#comment-6865 Tue, 20 Sep 2011 08:49:39 +0000 http://technology.amis.nl/blog/?p=13298#comment-6865 @Florence,
The business rule that is supposed to be enforced requires a single record per day, so only one record is allowed for August 24. However the customer also wants to know when (at what time)  this record was entered.
The constraint must limit only one record per day. But when querying the data, the time-component of the DATE column must still be there.
Does this clarify things?
(sorry to comment so late, your comment was only public just now)

]]>
By: Sebastian https://technology.amis.nl/2011/08/24/business-rule-only-one-per-day-but-keep-the-time/#comment-6864 Fri, 16 Sep 2011 14:10:37 +0000 http://technology.amis.nl/blog/?p=13298#comment-6864 Pretty amazing stuff.
Thanks for sharing.

]]>
By: Alex https://technology.amis.nl/2011/08/24/business-rule-only-one-per-day-but-keep-the-time/#comment-6863 Thu, 08 Sep 2011 11:43:20 +0000 http://technology.amis.nl/blog/?p=13298#comment-6863 The objective is to record a record per ID, per Day, and still keep the time component.
When you use TRUNC (SYSDATE), you will loose the time component (because it will be set to midnight).
Even with a TIMESTAMP, you will loose the time component when you TRUNC it.
Guess I should have explained the requirement more clearly. Thank you for your comment.

]]>
By: Marco Gralike https://technology.amis.nl/2011/08/24/business-rule-only-one-per-day-but-keep-the-time/#comment-6862 Thu, 08 Sep 2011 10:47:54 +0000 http://technology.amis.nl/blog/?p=13298#comment-6862 Can the one second issue be avoided via using timestamp…?

]]>
By: Florence M. Cano https://technology.amis.nl/2011/08/24/business-rule-only-one-per-day-but-keep-the-time/#comment-6861 Fri, 26 Aug 2011 05:14:48 +0000 http://technology.amis.nl/blog/?p=13298#comment-6861 The codes are are quite complicated. As i can see,the  the output in the above script, only one record is inserted into the table, the other attempt yields an exception.

]]>