<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: datetime format in sql pass through for Oracle in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/datetime-format-in-sql-pass-through-for-Oracle/m-p/50731#M10601</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;after checking, my NLS_LANGUAGE under Oracle is : American,&lt;/P&gt;&lt;P&gt;And both this proposed solutions are working, i'll stay on the NLS_DATE_LANGUAGE parameter of TO_DATE for convenience.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue seems to be with TOAD, he accept 01Aou and not 01aug whith American as language!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Aug 2011 10:17:14 GMT</pubDate>
    <dc:creator>checkno</dc:creator>
    <dc:date>2011-08-25T10:17:14Z</dc:date>
    <item>
      <title>datetime format in sql pass through for Oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-format-in-sql-pass-through-for-Oracle/m-p/50729#M10599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i'm querying an oracle database with sql pass through &lt;/P&gt;&lt;P&gt;the issue is with the format of the datetime passed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On Oracle this query return the error 01843 not a valid month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select to_date('18aug11:17:36:34','ddmonyy:hh24:mi:ss') from dual&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is fixed by changing AUG to AOU, cause my nls_date_language=french under Oracle&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is when i execute the equivalent pass trough for the fixed query from my SEG, i have the opposite behavior:&lt;/P&gt;&lt;P&gt;the query with AUG is OK&lt;/P&gt;&lt;P&gt;and the query with AOU return an ERROR: ORACLE execute error: ORA-01843: not a valid month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just for information, under sas also my locale language is set&amp;nbsp; to FRENCH_FRANCE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2011 16:17:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-format-in-sql-pass-through-for-Oracle/m-p/50729#M10599</guid>
      <dc:creator>checkno</dc:creator>
      <dc:date>2011-08-18T16:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: datetime format in sql pass through for Oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-format-in-sql-pass-through-for-Oracle/m-p/50730#M10600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would double check your language setting through the sas pass-through session:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; FROM NLS_DATABASE_PARAMETERS &lt;/P&gt;&lt;P&gt;WHERE parameter IN ( 'NLS_LANGUAGE', 'NLS_TERRITORY', 'NLS_CHARACTERSET');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can change these on a per session basis by:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;execute by oracle(ALTER SESSION SET NLS_LANGUAGE = FRENCH_FRANCE.WE8ISO8859P1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might also look into altering the NLS parameters on your executing server for example in unix:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%sysexec(export NLS_LANG=FRENCH_FRANCE.WE8ISO8859P1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can lookup your valid languages using:&lt;/P&gt;&lt;P&gt;SELECT parameter, value &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; FROM V$NLS_VALID_VALUES;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More simply:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can pass the optional NLS_DATE_LANGUAGE parameter to your TO_DATE function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT TO_DATE('1-Août-01','DD-MON-YY','NLS_DATE_LANGUAGE=FRENCH') FROM DUAL;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2011 16:33:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-format-in-sql-pass-through-for-Oracle/m-p/50730#M10600</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-08-24T16:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: datetime format in sql pass through for Oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-format-in-sql-pass-through-for-Oracle/m-p/50731#M10601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;after checking, my NLS_LANGUAGE under Oracle is : American,&lt;/P&gt;&lt;P&gt;And both this proposed solutions are working, i'll stay on the NLS_DATE_LANGUAGE parameter of TO_DATE for convenience.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue seems to be with TOAD, he accept 01Aou and not 01aug whith American as language!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2011 10:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-format-in-sql-pass-through-for-Oracle/m-p/50731#M10601</guid>
      <dc:creator>checkno</dc:creator>
      <dc:date>2011-08-25T10:17:14Z</dc:date>
    </item>
  </channel>
</rss>

