Re: INSERT Trigger
Posted in 1998
Topics: Triggers, Constraints & Referential Integrity
Hi
thanks for your solution (it's enought for this problem) ;)
but I've got another question: is default works only on INSERT (or on UPDATE
either ??)
Octav Chiriac wrote:
> Roland Pich=F3r wrote:
> >Hi
> >
> >I've got following problem:
> >
> >I want to use trigger to set current date in row which I just insert (in
> >the same table)
> >
> >Any ideas how to do this (or just 'no way - it's impossible') ???
> >
> >Thanks,
> >
> >Roland Pichor
> >rpichor@ddc.daewoo.com.pl
> >
> >
> I think you could use DEFAULT on the date column. It is more simple.
>
> create table tab_name (> date_column date default today
> )
>
> If you need to insert a timestamp just use DATETIME ... DEFAULT CURRENT ...
>
> Hope it helps,
> Octav
>
> --=20
> Octav Chiriac Phone: (373) 2 21 20 96
> NetInfo S.R.L. Fax: (373) 2 21 20 96
> Chisinau (373) 2 24 00 83
> Moldova, Republic of mailto:com@netinfo.moldova.net