<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.5" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: To RR or to YY ?</title>
	<link>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html</link>
	<description>Oracle Certified Master</description>
	<pubDate>Sun, 07 Sep 2008 06:09:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.5</generator>

	<item>
		<title>by: Laurent Schneider</title>
		<link>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6181</link>
		<pubDate>Sat, 12 Apr 2008 05:52:24 +0000</pubDate>
		<guid>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6181</guid>
					<description>yes, right :
&lt;a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#sthref3818" rel="nofollow"&gt;OracleÂ® Database Concepts 10g Release 2 (10.2)&lt;/a&gt;
&lt;i&gt;Zero and positive and negative infinity (only generated on import from Version 5 Oracle databases) are stored using unique representations. Zero and negative infinity each require 1 byte; positive infinity requires 2 bytes.&lt;/i&gt;</description>
		<content:encoded><![CDATA[<p>yes, right :<br />
<a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#sthref3818" rel="nofollow">OracleÂ® Database Concepts 10g Release 2 (10.2)</a><br />
<i>Zero and positive and negative infinity (only generated on import from Version 5 Oracle databases) are stored using unique representations. Zero and negative infinity each require 1 byte; positive infinity requires 2 bytes.</i>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Aldridge</title>
		<link>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6179</link>
		<pubDate>Fri, 11 Apr 2008 20:31:59 +0000</pubDate>
		<guid>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6179</guid>
					<description>Wasn't there plus and minus infinity in version up to up to Oracle v5? I think I rememeber _reading_ about that. (I'm not that old).</description>
		<content:encoded><![CDATA[<p>Wasn&#8217;t there plus and minus infinity in version up to up to Oracle v5? I think I rememeber _reading_ about that. (I&#8217;m not that old).
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Log Buffer #92: a Carnival of the Vanities for DBAs</title>
		<link>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6177</link>
		<pubDate>Fri, 11 Apr 2008 16:39:41 +0000</pubDate>
		<guid>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6177</guid>
					<description>[...] Laurent Schneider is looking at the right-or-wrongness of date-format. He writes, &#8220;What is worst? To use DD-MON-RR or to use DD-MON-YY?&#8221;. Probably neither, as the comments point out. Chen Shapira says, &#8220;FXYYYY rules indeed.&#8221; [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Laurent Schneider is looking at the right-or-wrongness of date-format. He writes, &#8220;What is worst? To use DD-MON-RR or to use DD-MON-YY?&#8221;. Probably neither, as the comments point out. Chen Shapira says, &#8220;FXYYYY rules indeed.&#8221; [&#8230;]
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Laurent Schneider</title>
		<link>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6170</link>
		<pubDate>Thu, 10 Apr 2008 08:48:49 +0000</pubDate>
		<guid>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6170</guid>
					<description>dear, it is not inf, it is nan :D

&lt;code&gt;select  cast(utl_raw.cast_to_number('7E') as binary_double) from dual;

CAST(UTL_RAW.CAST_TO_NUMBER('7E')ASBINARY_DOUBLE)
-------------------------------------------------
                                              NAN
&lt;/code&gt;
as NaN does not exist as a Number, the only purpose to have such a number is annoying your colleagues. Of course it is not supported. And operations involving such an unsupported thing are, well, surprising :twisted:

&lt;code&gt;select cast((-utl_raw.cast_to_number('7E')) as binary_double) from dual;

CAST((-UTL_RAW.CAST_TO_NUMBER('7E'))ASBINARY_DOUBLE)
----------------------------------------------------
                                                 Inf
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>dear, it is not inf, it is nan <img src='http://laurentschneider.com/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><pre><code>select&nbsp;&nbsp;cast(utl_raw.cast_to_number(&#039;7E&#039;) as binary_double) from dual;

CAST(UTL_RAW.CAST_TO_NUMBER(&#039;7E&#039;)ASBINARY_DOUBLE)
-------------------------------------------------
&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NAN
</code></pre><br />
as NaN does not exist as a Number, the only purpose to have such a number is annoying your colleagues. Of course it is not supported. And operations involving such an unsupported thing are, well, surprising  <img src='http://laurentschneider.com/wordpress/wp-includes/images/smilies/icon_twisted.gif' alt=':twisted:' class='wp-smiley' /> </p>
<p><pre><code>select cast((-utl_raw.cast_to_number(&#039;7E&#039;)) as binary_double) from dual;

CAST((-UTL_RAW.CAST_TO_NUMBER(&#039;7E&#039;))ASBINARY_DOUBLE)
----------------------------------------------------
&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Inf
</code></pre>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Chen Shapira</title>
		<link>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6169</link>
		<pubDate>Thu, 10 Apr 2008 03:40:12 +0000</pubDate>
		<guid>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6169</guid>
					<description>Hey Laurent,

Forget about Gary's users. I want an explanation for 7E as number.

It displays as -inf in sqlplus, but it clearly doesn't behave as -inf:

SQL&#62; select UTL_RAW.CAST_TO_NUMBER('7E') from dual;

UTL_RAW.CAST_TO_NUMBER('7E')
----------------------------
                          -~

SQL&#62; select UTL_RAW.CAST_TO_NUMBER('7E')+1 from dual;

UTL_RAW.CAST_TO_NUMBER('7E')+1
------------------------------
                             1

Other single byte numbers also display the same:

SQL&#62; select UTL_RAW.CAST_TO_NUMBER('7F') from dual;

UTL_RAW.CAST_TO_NUMBER('7F')
----------------------------
                          -~

We can also get inf:

SQL&#62; select UTL_RAW.CAST_TO_NUMBER('81') from dual

UTL_RAW.CAST_TO_NUMBER('81')
----------------------------
                           ~

And of course, 0 is between :-) (but this is trivial)

SQL&#62; select UTL_RAW.CAST_TO_NUMBER('80') from dual

UTL_RAW.CAST_TO_NUMBER('80')
----------------------------
                           0

Steve Adams wrote some stuff about infinite numbers:
http://www.ixora.com.au/notes/infinity.htm
but I suspect that this is unrelated.

Please explain!</description>
		<content:encoded><![CDATA[<p>Hey Laurent,</p>
<p>Forget about Gary&#8217;s users. I want an explanation for 7E as number.</p>
<p>It displays as -inf in sqlplus, but it clearly doesn&#8217;t behave as -inf:</p>
<p>SQL&gt; select UTL_RAW.CAST_TO_NUMBER(&#8217;7E&#8217;) from dual;</p>
<p>UTL_RAW.CAST_TO_NUMBER(&#8217;7E&#8217;)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
                          -~</p>
<p>SQL&gt; select UTL_RAW.CAST_TO_NUMBER(&#8217;7E&#8217;)+1 from dual;</p>
<p>UTL_RAW.CAST_TO_NUMBER(&#8217;7E&#8217;)+1<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
                             1</p>
<p>Other single byte numbers also display the same:</p>
<p>SQL&gt; select UTL_RAW.CAST_TO_NUMBER(&#8217;7F&#8217;) from dual;</p>
<p>UTL_RAW.CAST_TO_NUMBER(&#8217;7F&#8217;)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
                          -~</p>
<p>We can also get inf:</p>
<p>SQL&gt; select UTL_RAW.CAST_TO_NUMBER(&#8217;81&#8242;) from dual</p>
<p>UTL_RAW.CAST_TO_NUMBER(&#8217;81&#8242;)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
                           ~</p>
<p>And of course, 0 is between <img src='http://laurentschneider.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  (but this is trivial)</p>
<p>SQL&gt; select UTL_RAW.CAST_TO_NUMBER(&#8217;80&#8242;) from dual</p>
<p>UTL_RAW.CAST_TO_NUMBER(&#8217;80&#8242;)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
                           0</p>
<p>Steve Adams wrote some stuff about infinite numbers:<br />
<a href="http://www.ixora.com.au/notes/infinity.htm" rel="nofollow">http://www.ixora.com.au/notes/infinity.htm</a><br />
but I suspect that this is unrelated.</p>
<p>Please explain!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Laurent Schneider</title>
		<link>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6164</link>
		<pubDate>Wed, 09 Apr 2008 11:33:10 +0000</pubDate>
		<guid>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6164</guid>
					<description>Gary, your users will love to have in UTL_RAW.CAST_TO_NUMBER('7E') in the number columns :)</description>
		<content:encoded><![CDATA[<p>Gary, your users will love to have in UTL_RAW.CAST_TO_NUMBER(&#8217;7E&#8217;) in the number columns <img src='http://laurentschneider.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Laurent Schneider</title>
		<link>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6163</link>
		<pubDate>Wed, 09 Apr 2008 09:50:20 +0000</pubDate>
		<guid>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6163</guid>
					<description>dates in BC, sounds fun !

well, truncate may reveal some inconsistencies ...

&lt;code&gt;select column_value,trunc(column_value,'CC') from table(sys.odcidatelist(date '2008-04-09',date '-2008-04-09')) ;
COLUMN_VA TRUNC(COL
--------- ---------
09-APR-08 01-JAN-01
09-APR-08 01-JAN-00

&lt;/code&gt;

:)</description>
		<content:encoded><![CDATA[<p>dates in BC, sounds fun !</p>
<p>well, truncate may reveal some inconsistencies &#8230;</p>
<p><code>select column_value,trunc(comµçVÖå÷fÇVRÂt42r’g&amp;öÒF&amp;ÆR‡7—2æöF6–FFVÆ—7B†FFRs#‚ÓBÓ’rÆFFRrÓ#‚ÓBÓ’r’’°Ð¤4ôÅTÔåõdE%Tä2„4ôÀÐ¢ÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÐÐ£’Ô&quot;Ó‚Ô¤âÓÐ£’Ô&quot;Ó‚Ô¤âÓ Ð Ð</code></p>
<p>:)
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Chen Shapira</title>
		<link>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6161</link>
		<pubDate>Wed, 09 Apr 2008 03:41:06 +0000</pubDate>
		<guid>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6161</guid>
					<description>FXYYYY rules indeed.
Thanks for the insight about limitations of YYYY.</description>
		<content:encoded><![CDATA[<p>FXYYYY rules indeed.<br />
Thanks for the insight about limitations of YYYY.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Gary</title>
		<link>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6160</link>
		<pubDate>Wed, 09 Apr 2008 01:03:58 +0000</pubDate>
		<guid>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6160</guid>
					<description>select date '08-12-31' from dual; gives the year 0008, so FXYYYY still wins out. 
If you really want to confuse co-workers, switch a bunch of dates from AD to BC. They'll never work it out. Why Oracle (or SQL) thought it would ever be necessary to store an exact date (and time) two thousand plus years ago is stunning. Who thought that would ever be useful ?
Please, give me a setting so that database-wide, Oracle would reject dates outside sensible boundaries. Default it to 1-jan-1800 to 31-dec-2199 and 99% of the date problems would disappear.</description>
		<content:encoded><![CDATA[<p>select date &#8216;08-12-31&#8242; from dual; gives the year 0008, so FXYYYY still wins out.<br />
If you really want to confuse co-workers, switch a bunch of dates from AD to BC. They&#8217;ll never work it out. Why Oracle (or SQL) thought it would ever be necessary to store an exact date (and time) two thousand plus years ago is stunning. Who thought that would ever be useful ?<br />
Please, give me a setting so that database-wide, Oracle would reject dates outside sensible boundaries. Default it to 1-jan-1800 to 31-dec-2199 and 99% of the date problems would disappear.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Laurent Schneider</title>
		<link>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6157</link>
		<pubDate>Tue, 08 Apr 2008 12:50:03 +0000</pubDate>
		<guid>http://laurentschneider.com/wordpress/2008/04/to-rr-or-to-yy.html#comment-6157</guid>
					<description>yes, YYYY-MM-DD is pretty, it even sorts right as string :mrgreen:</description>
		<content:encoded><![CDATA[<p>yes, YYYY-MM-DD is pretty, it even sorts right as string  <img src='http://laurentschneider.com/wordpress/wp-includes/images/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' />
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
