<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: And on the seventh day, God fiddled with His NLS settings</title>
	<atom:link href="http://andrewfraserdba.com/2007/04/25/and-on-the-seventh-day-god-fiddled-with-his-nls-settings/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewfraserdba.com/2007/04/25/and-on-the-seventh-day-god-fiddled-with-his-nls-settings/</link>
	<description>Oracle DBA (plus SQL Server)</description>
	<lastBuildDate>Wed, 25 Jan 2012 13:00:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Andrew Fraser</title>
		<link>http://andrewfraserdba.com/2007/04/25/and-on-the-seventh-day-god-fiddled-with-his-nls-settings/#comment-4185</link>
		<dc:creator>Andrew Fraser</dc:creator>
		<pubDate>Wed, 05 Oct 2011 15:55:02 +0000</pubDate>
		<guid isPermaLink="false">http://andrewfraser.wordpress.com/2007/04/25/and-on-the-seventh-day-god-fiddled-with-his-nls-settings/#comment-4185</guid>
		<description>Another example - replace:

where trunc(sysdate - ((to_number(to_char(sysdate, &#039;D&#039;))) ))  = trunc(startdate)

with this:

where sysdate between trunc(startdate) and trunc(startdate)+7</description>
		<content:encoded><![CDATA[<p>Another example &#8211; replace:</p>
<p>where trunc(sysdate &#8211; ((to_number(to_char(sysdate, &#8216;D&#8217;))) ))  = trunc(startdate)</p>
<p>with this:</p>
<p>where sysdate between trunc(startdate) and trunc(startdate)+7</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://andrewfraserdba.com/2007/04/25/and-on-the-seventh-day-god-fiddled-with-his-nls-settings/#comment-57</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Thu, 15 Nov 2007 22:32:19 +0000</pubDate>
		<guid isPermaLink="false">http://andrewfraser.wordpress.com/2007/04/25/and-on-the-seventh-day-god-fiddled-with-his-nls-settings/#comment-57</guid>
		<description>You can depend on the name of the day if you force the language in your to_char function. So no matter the session NLS setting it would return in your reference language, say english.

where to_char(workdate,’Dy’,&#039;nls_date_language=english&#039;) = ‘Sat’</description>
		<content:encoded><![CDATA[<p>You can depend on the name of the day if you force the language in your to_char function. So no matter the session NLS setting it would return in your reference language, say english.</p>
<p>where to_char(workdate,’Dy’,&#8217;nls_date_language=english&#8217;) = ‘Sat’</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: greg</title>
		<link>http://andrewfraserdba.com/2007/04/25/and-on-the-seventh-day-god-fiddled-with-his-nls-settings/#comment-58</link>
		<dc:creator>greg</dc:creator>
		<pubDate>Fri, 19 Oct 2007 09:10:17 +0000</pubDate>
		<guid isPermaLink="false">http://andrewfraser.wordpress.com/2007/04/25/and-on-the-seventh-day-god-fiddled-with-his-nls-settings/#comment-58</guid>
		<description>&quot;The fix is to name the day of the week rather than count to it:

select address, &#039;These customers want visited Saturdays&#039;
from customer
where to_char(workdate,’Dy’) = ‘Sat’ ;&quot;

No, it&#039;s NOT. That&#039;s still NLS dependent. Use &#039;J&#039;:

SQL&gt; alter session set NLS_LANGUAGE = &#039;HUNGARIAN&#039;;

Session altered

SQL&gt; select to_char(sysdate,&#039;D Day, Dy&#039;), mod(to_number(to_char(sysdate,&#039;J&#039;)),7) from dual;

TO_CHAR(SYSDATE,&#039;DDAY,DY&#039;) MOD(TO_NUMBER(TO_CHAR(SYSDATE,
-------------------------- ------------------------------
5 Péntek   , P.                                         4</description>
		<content:encoded><![CDATA[<p>&#8220;The fix is to name the day of the week rather than count to it:</p>
<p>select address, &#8216;These customers want visited Saturdays&#8217;<br />
from customer<br />
where to_char(workdate,’Dy’) = ‘Sat’ ;&#8221;</p>
<p>No, it&#8217;s NOT. That&#8217;s still NLS dependent. Use &#8216;J&#8217;:</p>
<p>SQL&gt; alter session set NLS_LANGUAGE = &#8216;HUNGARIAN&#8217;;</p>
<p>Session altered</p>
<p>SQL&gt; select to_char(sysdate,&#8217;D Day, Dy&#8217;), mod(to_number(to_char(sysdate,&#8217;J')),7) from dual;</p>
<p>TO_CHAR(SYSDATE,&#8217;DDAY,DY&#8217;) MOD(TO_NUMBER(TO_CHAR(SYSDATE,<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
5 Péntek   , P.                                         4</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Kelsey</title>
		<link>http://andrewfraserdba.com/2007/04/25/and-on-the-seventh-day-god-fiddled-with-his-nls-settings/#comment-56</link>
		<dc:creator>Simon Kelsey</dc:creator>
		<pubDate>Fri, 27 Apr 2007 10:51:15 +0000</pubDate>
		<guid isPermaLink="false">http://andrewfraser.wordpress.com/2007/04/25/and-on-the-seventh-day-god-fiddled-with-his-nls-settings/#comment-56</guid>
		<description>Hi Andrew,

I read this post with interest, I&#039;ve worked in a few places where there have been all manner of NLS &quot;nightmares&quot; but I&#039;ve never come across this particular one!  Thanks for the warning!

Cheers,
SimonK.</description>
		<content:encoded><![CDATA[<p>Hi Andrew,</p>
<p>I read this post with interest, I&#8217;ve worked in a few places where there have been all manner of NLS &#8220;nightmares&#8221; but I&#8217;ve never come across this particular one!  Thanks for the warning!</p>
<p>Cheers,<br />
SimonK.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

