View Single Post
  #4  
Old 27th May 2010, 10:52 AM
Will Owyong [NDX]
 
Posts: n/a
Default Re: How do I get current date and time

"Matthew Balraj" <matt@gislen.com> wrote in message
news:4bfcf7a3@DSVR011613....
> Hi
>
> In SQL 2005 Select getdate() would return the current date and
> time. What is the equivalent in NexusDB.
>
> I want to use it in an After insert trigger to populate a time stamp field
>
> Thanks
> Matthew


current_date
current_timestamp
current_time
E.g. select current_timestamp from #dummy;

Alternatively you could modify the table in Enterprise Manager to populate
the timestamp field on insert via the data dictionary, potentially removing
the need for the trigger (if that is all you use it for).

When _creating_ a new table, this can be done in SQL as:
drop table if exists mytable;
create table mytable (
....
tstampField timestamp default current_timestamp,
....etc.
);

--
Regards
Will Owyong [NDX]
Newcastle, NSW, AUSTRALIA
GMT+10