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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Date/Time Trigger Problem

Re: Date/Time Trigger Problem

From: Ulrik Hoffmann <ulrik_at_hoffmann-kiel.de>
Date: Mon, 15 Nov 1999 08:15:44 +0100
Message-ID: <80obvi$13nq0$1@fu-berlin.de>


Hi Dave,

the following should work

CREATE OR REPLACE TRIGGER TR_YOUR_TABLE_BIU  BEFORE INSERT OR UPDATE ON YOUR_TABLE
FOR EACH ROW
DECLARE
  v_datestr varchar2(20) :=to_char(:new.date,'ddmmyyyy')||:new.time; BEGIN
    :new.fulldatetime:=to_date(v_datestr,'ddmmyyyyhh24mi'); END ; Hope that helps,

bye
Uli

<dcody_at_my-deja.com> schrieb in im Newsbeitrag: 80nqjq$599$1_at_nnrp1.deja.com...
> I have inherited a database in which there is a date field and a
> separate time field. This cannot be changed.
>
> What I want to do is create a trigger which will combine the values
> from these two fields (DATE) and (TIME) into a single new field named
> FULLDATETIME.
>
> For the life of me I cannot figure out the syntax to create the trigger.
>
> Functionally, we want to wind up wirh
>
> FULLDATETIME = DATE + TIME
>
> BTW DATE is a DATE field, but only the date portion is significant.
> TIME is a VARCHAR2(4), and is stored as military (24hr) time ('0435',
> '1543', etc.
>
> Can anyone help?
> Dave
>
>
>
>
> (http://mondrian.sba.com/forums/Index.cfm?CFApp=21&Message
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Mon Nov 15 1999 - 01:15:44 CST

Original text of this message

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