Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle Timestamps
> Is anybody here know if we can use the timestamps of Oracle in an
> application ?
> By timestamps, I mean the one which are updated when a row in inserted or
> updated.
> And if yes, how can we ??
>
> Thanks
>
> Pascal
>
> pbrenner_at_technologist.com
>
>
You must have two (or one) extra-fields in your table, like 'DateCreated'
and
'DateChanged' of format date. Then you need a trigger on the table like
Create Or Replace Trigger TR_MyTable_BIU befor insert or update
on Mytable for each row
is
begin
if inserting then
:new.datecreated:=sydate;
end if;
if updating then
:new.datechanged:=sysdate;
end if;
end;
Remember the : before new!
Greetings
Uli
Received on Mon May 24 1999 - 08:09:22 CDT
![]() |
![]() |