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

Home -> Community -> Usenet -> c.d.o.server -> Re: Help executing trigger

Re: Help executing trigger

From: Pete's <empete2000_at_yahoo.com>
Date: 1 Jul 2003 05:51:07 -0700
Message-ID: <6724a51f.0307010451.65c6581d@posting.google.com>


Why not add a default value to the column, like SYSDATE. i.e.

alter table schema.my_table modify (date_column default sysdate);

That way, if an insert does not specify the column, the date should be inserted. Or, if you need it in a trigger(depending how it's set up),  

begin
...... some code not related to sysdate

  update my_table

     set date_column = SYSDATE
    where rowid = <the current row being updated>;

end;

something like that. The point is, in pl/sql or in sql, you don't have to used 'select sysdate from dual;' to get the date.

HTH,
Pete's

The views I may have expressed here are solely my own and not that of my employer.

"kiran" <kiran.news.invalid_at_web2news.net> wrote in message news:<45998N029_at_web2news.com>...
> Hi,
>
> How to execute a trigger or pl/sql in sqlplus
>
> Is there an optimised way to load the current date and time in a
> column instead of using sysdate from dual.
Received on Tue Jul 01 2003 - 07:51:07 CDT

Original text of this message

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