[Info-Ingres] ansidate('now')

Paul Mason latepaul at gmail.com
Wed Apr 9 06:07:32 CDT 2008


The following system constants can be used:

   CURRENT_DATE
   CURRENT_TIME
   CURRENT_TIMESTAMP
   LOCAL_TIME
   LOCAL_TIMESTAMP

The difference between the LOCAL* and CURRENT* is that CURRENT* ones are
with timezone and LOCAL* are without.

>From what you've written it looks like what you're after is LOCAL_TIMESTAMP:

 sql iidbdb | cat
INGRES TERMINAL MONITOR Copyright 2007 Ingres Corporation
Ingres 2006 Release 2 Linux Version II 9.1.0 (a64.lnx/123)NPTL login
Wed Apr  9 11:05:24 2008

continue
* select local_timestamp\g
Executing . . .


+---------------------------------------+
|col1                                   |
+---------------------------------------+
|2008-04-09 11:05:31.003000001          |
+---------------------------------------+
(1 row)
continue
* \q
Ingres 2006 Release 2 Version II 9.1.0 (a64.lnx/123)NPTL logout
Wed Apr  9 11:05:33 2008

The resolution of the fractional second part (i.e. whether you really get
nanoseconds) is up to the resolution of the system clock. So as you can see,
barring some rounding, I'm getting milliseconds.

HTH
Paul

On 09/04/2008, Martin Bowes <martin.bowes at ctsu.ox.ac.uk> wrote:
>
>  Hi Everyone,
>
>
>
> What is the ansidate equivalent of 'now'?
>
>
>
> I'm trying to store data in a table and I need the time of storage to be
> as unique as possible. The nanosecond capacity of ansidate seemed to be the
> way to go. But I cant create an andsidate column with default 'now'.
>
>
>
> Furthermore, the only thing I have found is: select
> timestamp_local(date('now'))\g
>
> Trouble is, the ingresdate 'now' has no sub second capacity, and so the
> returned time always has seconds.000000000.
>
>
>
> The table in question has been in existence for a long time and the
> applications around it have already been built so I need something that can
> be retro-fitted transparently if possible.
>
>
>
> Martin Bowes
>
> _______________________________________________
> Info-Ingres mailing list
> Info-Ingres at kettleriverconsulting.com
> http://www.kettleriverconsulting.com/mailman/listinfo/info-ingres
>
>


-- 
Paul Mason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.kettleriverconsulting.com/mailman/private/info-ingres/attachments/20080409/85206d1b/attachment.html 


More information about the Info-Ingres mailing list