<?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 DateTime Parameter in Oracle PROC SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DateTime-Parameter-in-Oracle-PROC-SQL/m-p/149245#M29464</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have three tables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODS.DATE (SAS TABLE) - Column DATE (numeric &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; format DATETIME20.&lt;/P&gt;&lt;P&gt;ODS.CUSTOMER (SAS TABLE) - Column ID (numeric &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt;&lt;/P&gt;&lt;P&gt;ORA.CUSTOMER (ORACLE TABLE) - Column ID (number), Column DAT (date)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to run this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;PROC SQL NOPRINT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;select date into :LOAD_DATE from ODS.DATE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;QUIT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;connect to oracle as conn (path='XXXX' user=XXXXX password="XXXXX");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;insert into ODS.CUSTOMER&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;select ID from connection to conn (&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select ID from ORA.CUSTOMER where dat &amp;gt;= "&amp;amp;LOAD_DATE"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;disconnect from conn;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following error is occurring:&lt;/P&gt;&lt;P&gt;- ERROR: ORACLE prepare error: ORA-00904: " 01JAN1900:00:00:00": invalid identifier. SQL statement: select * from ORA.CUSTOMER where dat &amp;gt;= " 01JAN1900:00:00:00". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Does anyone know how I Can pass the parameter correctly for Oracle?&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Mar 2014 18:54:42 GMT</pubDate>
    <dc:creator>DavidCaliman</dc:creator>
    <dc:date>2014-03-19T18:54:42Z</dc:date>
    <item>
      <title>DateTime Parameter in Oracle PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DateTime-Parameter-in-Oracle-PROC-SQL/m-p/149245#M29464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have three tables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODS.DATE (SAS TABLE) - Column DATE (numeric &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; format DATETIME20.&lt;/P&gt;&lt;P&gt;ODS.CUSTOMER (SAS TABLE) - Column ID (numeric &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt;&lt;/P&gt;&lt;P&gt;ORA.CUSTOMER (ORACLE TABLE) - Column ID (number), Column DAT (date)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to run this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;PROC SQL NOPRINT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;select date into :LOAD_DATE from ODS.DATE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;QUIT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;connect to oracle as conn (path='XXXX' user=XXXXX password="XXXXX");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;insert into ODS.CUSTOMER&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;select ID from connection to conn (&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select ID from ORA.CUSTOMER where dat &amp;gt;= "&amp;amp;LOAD_DATE"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;disconnect from conn;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following error is occurring:&lt;/P&gt;&lt;P&gt;- ERROR: ORACLE prepare error: ORA-00904: " 01JAN1900:00:00:00": invalid identifier. SQL statement: select * from ORA.CUSTOMER where dat &amp;gt;= " 01JAN1900:00:00:00". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Does anyone know how I Can pass the parameter correctly for Oracle?&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Mar 2014 18:54:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DateTime-Parameter-in-Oracle-PROC-SQL/m-p/149245#M29464</guid>
      <dc:creator>DavidCaliman</dc:creator>
      <dc:date>2014-03-19T18:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime Parameter in Oracle PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DateTime-Parameter-in-Oracle-PROC-SQL/m-p/149246#M29465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where clauses are usually pushed to Oracle using implicit pass-thru, the SAS/ACCESS engine will translate the date constant for you.&lt;/P&gt;&lt;P&gt;You need to add a format specification in the select into: clause (date9. - given this is a SAS date), and add a d when you refer to it: "&amp;amp;LOAD_DATE"d&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Mar 2014 19:05:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DateTime-Parameter-in-Oracle-PROC-SQL/m-p/149246#M29465</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-03-19T19:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime Parameter in Oracle PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DateTime-Parameter-in-Oracle-PROC-SQL/m-p/149247#M29466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a link to Oracle documentation on datetime literals. &lt;A href="http://docs.oracle.com/cd/E11882_01/server.112/e26088/sql_elements003.htm#SQLRF51063" title="http://docs.oracle.com/cd/E11882_01/server.112/e26088/sql_elements003.htm#SQLRF51063"&gt;Literals&lt;/A&gt;&amp;nbsp; Example: DATE '1998-12-25'&lt;/P&gt;&lt;P&gt;(Note that unlike SAS Oracle only has DATETIME and does not have separate DATE type).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; background-color: #ffffff;"&gt;select cats("DATE '",put(datepart(date),YYMMDD10.),"'") into :LOAD_DATE from ODS.DATE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; background-color: #ffffff;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'courier new', courier;"&gt;select ID from connection to conn (&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select ID from ORA.CUSTOMER where dat &amp;gt;= &amp;amp;LOAD_DATE&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'courier new', courier;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Mar 2014 20:39:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DateTime-Parameter-in-Oracle-PROC-SQL/m-p/149247#M29466</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-03-19T20:39:25Z</dc:date>
    </item>
  </channel>
</rss>

