#1  
Old 26th May 2010, 10:24 PM
Matthew Balraj
 
Posts: n/a
Default How do I get current date and time

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


  #2  
Old 26th May 2010, 11:52 PM
Franz-Leo Chomse [NDX]
 
Posts: n/a
Default Re: How do I get current date and time

On Wed, 26 May 2010 15:54:14 +0530, "Matthew Balraj" <matt@gislen.com>
wrote:

>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


Using a TnxCurrentDateTimeDefaultValueDescriptor for both Insert and
Update - This gives the desired result without any coding


Regards from Germany

Franz-Leo Chomse [NexusDB Expert]
franz.leo.chomse@ndx.nexusdb_x.com (please remove "_x" to reply)
  #3  
Old 27th May 2010, 08:32 AM
Hannes Danzl[NDD]
 
Posts: n/a
Default Re: How do I get current date and time

Matthew Balraj wrote:

> 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


In the manual:
http://www.nexusdb.com/support/index...efunctions.htm

--

Hannes Danzl / NexusDB

Issue Tracker - http://www.nexusdb.com/mantis/view_all_bug_page.php
Newsgroup Web Gateway - http://www.nexusdb.com/forums/
Newsgroup Search - http://www.nexusdb.com/forums/search.php
  #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


  #5  
Old 27th May 2010, 10:58 PM
Matthew Balraj
 
Posts: n/a
Default Re: How do I get current date and time

Thank you Guys

A special thanks to Will Owyong whose suggestion was just what was needed to
be done

"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
>
>





Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Time Limitation Arnd Iffland nexusdb.public.support.adoprovider 4 13th February 2009 06:50 AM
Time limited build 70 for testing available now Hannes Danzl[NDD] nexusdb.public.support.adoprovider 11 5th January 2009 10:47 AM
Full version of current NexusDB V2 ADO Provider Petr Manas nexusdb.public.support.adoprovider 2 9th July 2007 05:18 PM
REAL release date of final ADO.NET provider Petr Manas nexusdb.public.support.adoprovider 3 31st August 2005 06:51 PM
Time Bomb in Beta 9 Simon Morris nexusdb.public.support.adoprovider 4 28th April 2004 08:55 PM


All times are GMT +11. The time now is 04:21 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.