Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help executing trigger
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
![]() |
![]() |