Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Ingres > Re: [Info-Ingre...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 5785 of 5952
Post > Topic >>

Re: [Info-Ingres] ansidate('now')

by "Paul Mason" <latepaul@[EMAIL PROTECTED] > Apr 9, 2008 at 12:07 PM

------=_Part_16542_25802935.1207739252479
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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 Cor****ation
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@[EMAIL PROTECTED]
> 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@[EMAIL PROTECTED]
> http://www.kettleriverconsulting.com/mailman/listinfo/info-ingres
>
>


-- 
Paul Mason

------=_Part_16542_25802935.1207739252479
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

The following system constants can be used:<br><br>&nbsp;&nbsp;
CURRENT_DATE <br>&nbsp;&nbsp; CURRENT_TIME<br>&nbsp;&nbsp;
CURRENT_TIMESTAMP<br>&nbsp;&nbsp; LOCAL_TIME<br>&nbsp;&nbsp;
LOCAL_TIMESTAMP<br><br>The difference between the LOCAL* and CURRENT* is
that CURRENT* ones are with timezone and LOCAL* are without.<br>
<br>From what you&#39;ve written it looks like what you&#39;re after is
LOCAL_TIMESTAMP:<br><br>&nbsp;sql iidbdb | cat<br>INGRES TERMINAL MONITOR
Copyright 2007 Ingres Cor****ation<br>Ingres 2006 Release 2 Linux Version
II 9.1.0 (a64.lnx/123)NPTL login<br>
Wed Apr&nbsp; 9 11:05:24 2008<br><br>continue<br>* select
local_timestamp\g<br>Executing . .
.<br><br><br>+---------------------------------------+<br>|col1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
|<br>+---------------------------------------+<br>
|2008-04-09
11:05:31.003000001&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
|<br>+---------------------------------------+<br>(1 row)<br>continue<br>*
\q<br>Ingres 2006 Release 2 Version II 9.1.0 (a64.lnx/123)NPTL
logout<br>Wed Apr&nbsp; 9 11:05:33 2008<br><br>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&#39;m getting milliseconds.<br>
<br>HTH<br>Paul<br><br><div><span class="gmail_quote">On 09/04/2008, <b
class="gmail_sendername">Martin Bowes</b> &lt;<a
href="mailto:martin.bowes@[EMAIL PROTECTED]
">martin.bowes@[EMAIL PROTECTED]
>&gt;
wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid
rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">









<div link="blue" vlink="purple" lang="EN-GB">

<div>

<p>Hi Everyone,</p>

<p>&nbsp;</p>

<p>What is the ansidate equivalent of &#39;now&#39;?</p>

<p>&nbsp;</p>

<p>I&#39;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
&#39;now&#39;.</p>

<p>&nbsp;</p>

<p>Furthermore, the only thing I have found is: select
timestamp_local(date(&#39;now&#39;))\g</p>

<p>Trouble is, the ingresdate &#39;now&#39; has no sub second capacity,
and so the returned time always has seconds.000000000.</p>

<p>&nbsp;</p>

<p>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.</p>

<p>&nbsp;</p><span class="sg">

<p>Martin Bowes</p>

</span></div>

</div>


<br>_______________________________________________<br>
Info-Ingres mailing list<br>
<a onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:Info-Ingres@[EMAIL PROTECTED]
">Info-Ingres@[EMAIL PROTECTED]
><br>
<a onclick="return top.js.OpenExtLink(window,event,this)"
href="http://www.kettleriverconsulting.com/mailman/listinfo/info-ingres"
target="_blank">http://www.kettleriverconsulting.com/mailman/listinfo/info-ingres</a><br>

<br></blockquote></div><br><br clear="all"><br>-- <br>Paul Mason

------=_Part_16542_25802935.1207739252479--
 




 1 Posts in Topic:
Re: [Info-Ingres] ansidate('now')
"Paul Mason" &l  2008-04-09 12:07:32 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Sun Jul 6 16:40:51 CDT 2008.