Re: 6781 DATE Formatting with Oracle Developer

From: Geoff White <whiteg_at_ccis.adisys.com.au>
Date: Thu, 25 Mar 1999 10:04:12 +0800
Message-ID: <36F9999C.2783F45E_at_ccis.adisys.com.au>


kevinr75_at_my-dejanews.com wrote:

> Hello
>
> I am using Oracle forms 5.
>
> I am trying to accomplish the following effect.
>
> I want my users to enter date in format MM/DD/YYYY. This I set in the format
> mask in the property palette of the text item.
>
> However when a record is saved or updated I want to add to the date that a
> preset time '23:59:59'.
>
> So if the user enters 12/19/1974, I want the database to store 12/19/1975
> 23:59:59
>
> I know I can do this at the database level with insert and update trigger but
> is there anyway to do this with oracle forms.
>
> Any ideas.
>
> Thanks
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

If your field is defined as DATE then the time component will be zero. You could have a line in your PRE-INSERT and/or PRE-UPDATE trigger

   :my_block.the_item := :my_block.the_item + to_date('23:59:59', 'HH:MM:SS');

If your field is defined as DATETIME you would need to do a trunc(:my_block.the_item) before adding the time to be on the safe side.

This is untested but should work.

Geoff Received on Thu Mar 25 1999 - 03:04:12 CET

Original text of this message